All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2 v3] cpu hotplug: Preserve topology directory after soft remove event
@ 2016-09-21 11:39 Prarit Bhargava
  2016-09-21 11:39 ` [PATCH 1/2 v3] drivers/base: Combine topology.c and cpu.c Prarit Bhargava
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Prarit Bhargava @ 2016-09-21 11:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Prarit Bhargava, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	x86, Greg Kroah-Hartman, Peter Zijlstra, Len Brown,
	Borislav Petkov, Andi Kleen, Jiri Olsa, Juergen Gross

The information in /sys/devices/system/cpu/cpuX/topology
directory is useful for userspace monitoring applications and in-tree
utilities like cpupower & turbostat.

When down'ing a CPU the /sys/devices/system/cpu/cpuX/topology directory is
removed during the CPU_DEAD hotplug callback in the kernel.  The problem
with this model is that the CPU has not been physically removed and the
data in the topology directory is still valid.  IOW, the cpu is still
present but the kernel has removed the topology directory making it
very difficult to determine exactly where the cpu is located.

This patchset adds CONFIG_PERMANENT_CPU_TOPOLOGY, and is Y by default for
x86, an N for all other arches.  When enabled the kernel is modified so
that the topology directory is added to the core cpu sysfs files so that
the topology directory exists for the lifetime of the CPU.  When
disabled, the behavior of the current kernel is maintained (that is, the
topology directory is removed on a down and added on an up).  Adding
CONFIG_PERMANENT_CPU_TOPOLOGY may require additional architecture so that
the cpumask data the CPU's topology is not cleared during a CPU down.

This patchset combines drivers/base/topology.c and drivers/base/cpu.c to
implement CONFIG_PERMANENT_CPU_TOPOLOGY and leaves all arches except
x86 with the current behavior.

peterz asked when the topology directory is destroyed when
CONFIG_PERMANENT_CPU_TOPOLOGY=y.  The topology directory's lifetime will
change when CONFIG_PERMANENT_CPU_TOPOLOGY=y from existing when the thread
is online, to being created when the struct device associated with the thread
is created, and similarly being destroyed when the struct device is destroyed.

[v2 & v3]: Fix ktest build robot build failures

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Len Brown <len.brown@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Juergen Gross <jgross@suse.com>

Prarit Bhargava (2):
  drivers/base: Combine topology.c and cpu.c
  cpu hotplug: add CONFIG_PERMANENT_CPU_TOPOLOGY

 arch/x86/kernel/smpboot.c |    3 -
 drivers/base/Kconfig      |   12 ++++
 drivers/base/Makefile     |    2 +-
 drivers/base/cpu.c        |  148 +++++++++++++++++++++++++++++++++++++++
 drivers/base/topology.c   |  168 ---------------------------------------------
 5 files changed, 161 insertions(+), 172 deletions(-)
 delete mode 100644 drivers/base/topology.c

-- 
1.7.9.3

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2016-09-28 10:06 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-21 11:39 [PATCH 0/2 v3] cpu hotplug: Preserve topology directory after soft remove event Prarit Bhargava
2016-09-21 11:39 ` [PATCH 1/2 v3] drivers/base: Combine topology.c and cpu.c Prarit Bhargava
2016-09-21 11:39 ` [PATCH 2/2 v3] cpu hotplug: add CONFIG_PERMANENT_CPU_TOPOLOGY Prarit Bhargava
2016-09-21 13:04 ` [PATCH 0/2 v3] cpu hotplug: Preserve topology directory after soft remove event Borislav Petkov
2016-09-21 13:32   ` Prarit Bhargava
2016-09-21 14:01     ` Borislav Petkov
2016-09-22 11:59       ` Prarit Bhargava
2016-09-22 12:10         ` Borislav Petkov
2016-09-26 11:45           ` Prarit Bhargava
2016-09-26 11:57             ` Borislav Petkov
2016-09-27 11:45               ` Prarit Bhargava
2016-09-27 13:49                 ` Greg Kroah-Hartman
2016-09-27 15:26                   ` Prarit Bhargava
2016-09-28  5:05                     ` Borislav Petkov
2016-09-28  6:48                     ` Peter Zijlstra
2016-09-28 10:06                       ` Prarit Bhargava
2016-09-28  5:02                 ` Borislav Petkov
2016-09-26 11:59             ` Peter Zijlstra
2016-09-27 11:47               ` Prarit Bhargava
2016-09-27 11:57                 ` Peter Zijlstra

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.