linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Prarit Bhargava <prarit@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Len Brown <len.brown@intel.com>, Borislav Petkov <bp@suse.de>,
	Andi Kleen <ak@linux.intel.com>, Jiri Olsa <jolsa@redhat.com>,
	Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH 2/2] cpu hotplug, add CONFIG_PERMANENT_CPU_TOPOLOGY
Date: Thu, 08 Sep 2016 09:45:26 -0400	[thread overview]
Message-ID: <57D16B76.2070303@redhat.com> (raw)
In-Reply-To: <20160908074542.GY10138@twins.programming.kicks-ass.net>



On 09/08/2016 03:45 AM, Peter Zijlstra wrote:
> On Wed, Sep 07, 2016 at 07:44:17AM -0400, Prarit Bhargava wrote:
>> 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 and the cpu's location is
>> now lost to userspace.
>>
>> This patch 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 while the CPU is physically present.  When
>> disabled, the behavior of the current kernel is maintained (that is, the
>> topology directory is removed on a soft down and added on an soft 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.
> 
> So how do you physically remove things and how does the information then
> get removed?
> 

Physical hotremove was done with a toggle switch enabled test box.

The topology directory gets removed when either common_cpu_attr_groups
(!CONFIG_HOTPLUG_CPU) or hotplugable_cpu_attr_groups (CONFIG_HOTPLUG_CPU) are
destroyed.  The cpu device's attributes are set in register_cpu() and the device
is destroyed in unregister_cpu().

IOW, the patch expands the lifetime of the topology directories to match that of
the device.

> Also, why is that an x86 only feature?

The only arch that I could test on was x86 and I wasn't able to test to see if
topology fields are valid for other arches on a soft remove.  So x86 by default
for now and other arches can make their decisions.

P.

      reply	other threads:[~2016-09-08 13:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-07 11:44 [PATCH 0/2] cpu hotplug, keep topology directory after soft remove event Prarit Bhargava
2016-09-07 11:44 ` [PATCH 1/2] drivers/base: Combine topology.c and cpu.c Prarit Bhargava
2016-09-07 13:31   ` kbuild test robot
2016-09-07 11:44 ` [PATCH 2/2] cpu hotplug, add CONFIG_PERMANENT_CPU_TOPOLOGY Prarit Bhargava
2016-09-08  7:45   ` Peter Zijlstra
2016-09-08 13:45     ` Prarit Bhargava [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57D16B76.2070303@redhat.com \
    --to=prarit@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=bp@suse.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=jolsa@redhat.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).