lkml.org 
[lkml]   [2022]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] torture: use for_each_present() loop in torture_online_all()
On Mon, Nov 14, 2022 at 04:35:06PM +0100, Sven Schnelle wrote:
> "Paul E. McKenney" <paulmck@kernel.org> writes:
>
> > On Fri, Nov 11, 2022 at 01:51:24PM +0100, Sven Schnelle wrote:
> >> A CPU listed in the possible mask doesn't have to be present, in
> >> which case it would crash the kernel in torture_online_all().
> >> To prevent this use a for_each_present() loop.
> >>
> >> Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
> >
> > Looks good to me! Any reason for no mailing list on CC?
>
> No, my fault. I setup get_maintainer.pl to be called from git
> send-email, but looks like i did it wrong :-)

Been there, done that! ;-)

> > Ah, and any synchronization required in case it is possible for a CPU
> > to leave the cpu_present_mask? Or can they only be added?
>
> Hmm... I think the main question is, whether it is ok for a cpu to be
> removed from the system when rcutorture is running? In both cases it
> would disappear from the cpu online mask, so i don't think the patch
> would change the behaviour. But i can check and send additional patches
> if there are other places that needs adjustment.

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?

Thanx, Paul

\
 
 \ /
  Last update: 2022-11-14 17:36    [W:0.093 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site