Re: [PATCH tip/core/rcu 3/4] rcu: stop spurious warnings fromsynchronize_sched_expedited

From: Peter Zijlstra
Date: Tue Feb 21 2012 - 13:57:26 EST


On Tue, 2012-02-21 at 10:28 -0800, Paul E. McKenney wrote:
> On Tue, Feb 21, 2012 at 07:00:17PM +0100, Peter Zijlstra wrote:
> > On Tue, 2012-02-21 at 09:58 -0800, Paul E. McKenney wrote:
> > > From: Hugh Dickins <hughd@xxxxxxxxxx>
> > >
> > > synchronize_sched_expedited() is spamming CONFIG_DEBUG_PREEMPT=y
> > > users with an unintended warning from the cpu_is_offline() check:
> > > use raw_smp_processor_id() instead of smp_processor_id() there.
> >
> > This fails to mention why it makes sense to test a random cpu for
> > offline-ness..
>
> The check was already there, Hugh simply fixed it to use raw_. The check
> itself was added in c0d6d01bf (Check for illegal use of RCU from offlined
> CPUs). The purpose is to catch improper use of RCU from CPU_DYING
> notifiers and on the path from the CPU_DYING notifiers to the idle loop.

Then I think this patch wants to add a comment explaining this. Because
cpu_offline(raw_smp_processor_id()) looks really rather suspicious.
--
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/