Re: [PATCH 0/2 v3] cpu hotplug: Preserve topology directory after soft remove event

From: Prarit Bhargava
Date: Wed Sep 28 2016 - 06:06:57 EST

On 09/28/2016 02:48 AM, Peter Zijlstra wrote:
> On Tue, Sep 27, 2016 at 11:26:14AM -0400, Prarit Bhargava wrote:
>> I see now that the issue is not understanding the difference between physical
>> and soft thread removal. I will write that up and get back to everyone.
> You don't seem to understand that from the kernels POV there is no such
> distinction.

And I'm saying you're wrong. Unlike PCI, CPU sysfs unplug does not completely
remove the device from the kernel's knowledge. If that were the case then

/sys/devices/system/cpu/cpuX/online (and other files left after the unplug)
wouldn't exist.

If you do a physical removal (signaled via ACPI or interrupt) the entire device
is removed from the kernel's POV.

Yes, the sysfs removal is a subset of the physical removal. But the end result
is very different.

> There is only one unplug operation that caters to both cases. Therefore
> unplug needs to assume the most stringent (ie. physical) for things to
> work right.

See last comment above.