[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1474385183-11211-1-git-send-email-prarit@redhat.com>
Date: Tue, 20 Sep 2016 11:26:21 -0400
From: Prarit Bhargava <prarit@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: Prarit Bhargava <prarit@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Peter Zijlstra <peterz@...radead.org>,
Len Brown <len.brown@...el.com>, Borislav Petkov <bp@...e.de>,
Andi Kleen <ak@...ux.intel.com>, Jiri Olsa <jolsa@...hat.com>,
Juergen Gross <jgross@...e.com>
Subject: [PATCH 0/2 v2] cpu hotplug: Preserve topology directory after soft remove event
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.
Signed-off-by: Prarit Bhargava <prarit@...hat.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: "H. Peter Anvin" <hpa@...or.com>
Cc: x86@...nel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Len Brown <len.brown@...el.com>
Cc: Borislav Petkov <bp@...e.de>
Cc: Andi Kleen <ak@...ux.intel.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Juergen Gross <jgross@...e.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 | 147 +++++++++++++++++++++++++++++++++++++++
drivers/base/topology.c | 168 ---------------------------------------------
5 files changed, 160 insertions(+), 172 deletions(-)
delete mode 100644 drivers/base/topology.c
--
1.7.9.3
Powered by blists - more mailing lists