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

From: Peter Zijlstra
Date: Mon Sep 26 2016 - 07:59:59 EST


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.

Offline means out gone, vamoosh.

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