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

From: Prarit Bhargava
Date: Tue Sep 27 2016 - 07:48:10 EST




On 09/26/2016 07:59 AM, Peter Zijlstra wrote:
> On Mon, Sep 26, 2016 at 07:45:37AM -0400, Prarit Bhargava wrote:
>>> But then code which reads those will have to *know* that those cores are
>>> offline - otherwise it would be confused by what it is reading there.
>>
>> When offline, /sys/devices/system/cpuX/cpu/online is 0. The problem is that
>> when online is 0, topology disappears so there is no way to determine _the
>> location_ of the offline'd thread.
>
> As far as all that code is concerned, that CPU doesn't even have a
> location anymore.
>
> While there might be some distinction between hotplug and physical
> hotplug on the user API side (I really wouldn't know), there isn't on
> the kernel side.
>
> Once you unplug a CPU, its _gone_. There isn't another hotplug operation
> once you really take the CPU out.

There's a difference between soft remove (via sysfs) and a true hot remove
operation (where the whole thing is physically removed). Soft remove only
results in the processor being made "not available" to the scheduler.

>
> Offline means out gone, vamoosh.

No, that is incorrect. The socket that contains the cores (and threads) is
still plugged in.

>
> And it doesn't make sense to talk about the location of a resource
> that's not there.
>

Again, it is _physically_ there.

P.