Re: [RFC PATCH v1] stop_machine: Add stop_housekeeping_cpuslocked()
From: Frederic Weisbecker
Date: Wed Dec 18 2024 - 12:32:37 EST
Le Wed, Dec 18, 2024 at 06:27:54PM +0100, Peter Zijlstra a écrit :
> On Wed, Dec 18, 2024 at 07:15:31PM +0200, Costa Shulyupin wrote:
>
> > Which synchronizations do these functions require instead of stop_machine?
>
> *sigh*, so you're asking us to do your homework?
>
> But clearly you're not realizing the scope of the thing: stop_machine()
> serializes against every preempt_disable() region in the entire kernel.
>
> So you're telling me there isn't a single preempt_disable() region in
> the kernel that depends on being before stop_machine() in its entirety?
>
> I know for a fact I've written some in the past 20 years -- what I don't
> know if any of them still live and are still relying on it, because I've
> also added synchronize_rcu_sched(), which later became synchronize_rcu()
> which implies the same, in various parts of the hotplug machinery.
>
> Anyway, without you doing some proper analysis, your patches are going
> exactly nowhere.
And so given the cost of such analysis and resulting possible patches, here
is an important question: is it worth the effort? What is the usecase of
shutting down a CPU while other isolated CPUs run critical isolated stuff?
Thanks.