Re: Question on comment header for for_each_domain()

From: Peter Zijlstra
Date: Thu Nov 08 2018 - 04:22:00 EST


On Wed, Nov 07, 2018 at 03:00:02PM -0800, Paul E. McKenney wrote:
> Hello!
>
> The header comment for for_each_domain() talks about a call to
> synchronize_sched() within detach_destroy_domains(), but I am not
> seeing any such call. Because synchronize_sched() is now folded into
> synchronize_rcu(), I have a patch that edits the comment, but it looks
> like a larger change is needed.
>
> Or am I blind today?

I think you're quite right and that comment is a wee bit stale.

The sched domain tree is indeed protected by regular RCU (not RCU-sched
as the comment seems to imply) and this is per destroy_sched_domains()
using call_rcu().

And most (I didn't look at all) uses for the sched-domain tree do indeed
employ rcu_read_lock().