From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941038AbcIGLok (ORCPT ); Wed, 7 Sep 2016 07:44:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53614 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S940995AbcIGLoY (ORCPT ); Wed, 7 Sep 2016 07:44:24 -0400 From: Prarit Bhargava To: linux-kernel@vger.kernel.org Cc: Prarit Bhargava , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Greg Kroah-Hartman , Peter Zijlstra , Len Brown , Borislav Petkov , Andi Kleen , Jiri Olsa , Juergen Gross Subject: [PATCH 0/2] cpu hotplug, keep topology directory after soft remove event Date: Wed, 7 Sep 2016 07:44:15 -0400 Message-Id: <1473248657-17359-1-git-send-email-prarit@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 07 Sep 2016 11:44:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Prarit Bhargava Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: x86@kernel.org Cc: Greg Kroah-Hartman Cc: Peter Zijlstra Cc: Len Brown Cc: Borislav Petkov Cc: Andi Kleen Cc: Jiri Olsa Cc: Juergen Gross 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 | 146 +++++++++++++++++++++++++++++++++++++++ drivers/base/topology.c | 168 --------------------------------------------- 5 files changed, 159 insertions(+), 172 deletions(-) delete mode 100644 drivers/base/topology.c -- 1.7.9.3