]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
rcu: Stop spurious warnings from synchronize_sched_expedited
authorHugh Dickins <hughd@google.com>
Fri, 17 Feb 2012 21:20:31 +0000 (13:20 -0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 21 Feb 2012 23:33:34 +0000 (15:33 -0800)
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.

Because the warning is under a get_online_cpus(), it is not possible
for any CPUs to go offline, though it is quite possible that the
task might migrate between the raw_smp_processor_id() and the check
of cpu_is_offline().  This is not a problem because the task cannot
migrate from an offline CPU to an online one or vice versa.  The point
of the check is to verify that synchronize_sched_expedited() is not
called from an offline CPU, for example, from a CPU_DYING notifier, or,
more important, from an outgoing CPU making its way from its CPU_DYING
notifiers to the idle loop.

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/rcutree.c

index eacc10b035310f3d718718651ce5eb43b3f216dc..1050d6d3922c182f09bfe602ee07e3a185f4be80 100644 (file)
@@ -2014,7 +2014,7 @@ void synchronize_sched_expedited(void)
        /* Note that atomic_inc_return() implies full memory barrier. */
        firstsnap = snap = atomic_inc_return(&sync_sched_expedited_started);
        get_online_cpus();
-       WARN_ON_ONCE(cpu_is_offline(smp_processor_id()));
+       WARN_ON_ONCE(cpu_is_offline(raw_smp_processor_id()));
 
        /*
         * Each pass through the following loop attempts to force a