Re: [PATCH 1/2] torture: use for_each_present() loop in torture_online_all()

From: Sven Schnelle
Date: Thu Nov 17 2022 - 01:30:59 EST


Hi Paul,

"Paul E. McKenney" <paulmck@xxxxxxxxxx> writes:

>> > Yes, rcutorture has lower-level checks for CPUs being hotplugged
>> > behind its back. Which might be sufficient. But this patch is in
>> > response to something bad happening if the CPU is also not present in
>> > the cpu_present_mask. Would that same bad thing happen if rcutorture saw
>> > the CPU in cpu_online_mask, but by the time it attempted to CPU-hotplug
>> > it, that CPU was gone not just from cpu_online_mask, but also from
>> > cpu_present_mask?
>> >
>> > Or are CPUs never removed from cpu_present_mask?
>>
>> In the current implementation CPUs can only be added to the
>> cpu_present_mask, but never removed. This might change in the future
>> when we get support from firmware for that, but the current s390 code
>> doesn't do that.
>
> Very good!
>
> Then could the patch please check that bits are never removed?
> That way the code will complain should firmware support be added.
>
> Thanx, Paul

I'm not sure whether i fully understand that. If the CPU could
be removed from the system and the cpu_present_mask, that could
happen at any time. So i don't see how we should check about that?

Regards
Sven