Re: [RFC PATCH v2 02/10] CPU hotplug: Provide APIs for "full" atomicreaders to prevent CPU offline

From: Srivatsa S. Bhat
Date: Wed Dec 05 2012 - 14:02:30 EST


Replaying what Tejun wrote:

On 12/06/2012 12:13 AM, Srivatsa S. Bhat wrote:
> Some of the atomic hotplug readers cannot tolerate CPUs going offline while
> they are in their critical section. That is, they can't get away with just
> synchronizing with the updates to the cpu_online_mask; they really need to
> synchronize with the entire CPU tear-down sequence, because they are very
> much involved in the hotplug related code paths.
>
> Such "full" atomic hotplug readers need a way to *actually* and *truly*
> prevent CPUs from going offline while they are active.
>

I don't think this is a good idea. You really should just need
get/put_online_cpus() and get/put_online_cpus_atomic(). The former
the same as they are. The latter replacing what
preempt_disable/enable() was protecting. Let's please not go
overboard unless we know they're necessary. I strongly suspect that
breaking up reader side from preempt_disable and making writer side a
bit lighter should be enough. Conceptually, it really should be a
simple conversion - convert preempt_disable/enable() pairs protecting
CPU on/offlining w/ get/put_cpu_online_atomic() and wrap the
stop_machine() section with the matching write lock.

Thanks.

-- tejun

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/