rcu: Don't wake rcuc/X kthreads on NOCB CPUs
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Thu, 15 Dec 2016 23:37:47 +0000 (15:37 -0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 23 Jan 2017 19:37:13 +0000 (11:37 -0800)
Chris Friesen notice that rcuc/X kthreads were consuming CPU even on
NOCB CPUs.  This makes no sense because the only purpose or these
kthreads is to invoke normal (non-offloaded) callbacks, of which there
will never be any on NOCB CPUs.  This problem was due to a bug in
cpu_has_callbacks_ready_to_invoke(), which should have been checking
->nxttail[RCU_NEXT_TAIL] for NULL, but which was instead (incorrectly)
checking ->nxttail[RCU_DONE_TAIL].  Because ->nxttail[RCU_DONE_TAIL] is
never NULL, the only effect is to cause the rcuc/X kthread to execute
when it should not do so.

This commit therefore checks ->nxttail[RCU_NEXT_TAIL], which is NULL
for NOCB CPUs.

Reported-by: Chris Friesen <chris.friesen@windriver.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
kernel/rcu/tree.c

index d7b63b88434b4e218b88a308d77d4983c6c69043..be2301238a2387d16e62dd8ceb1485599439bd53 100644 (file)
@@ -611,7 +611,7 @@ static int
 cpu_has_callbacks_ready_to_invoke(struct rcu_data *rdp)
 {
        return &rdp->nxtlist != rdp->nxttail[RCU_DONE_TAIL] &&
-              rdp->nxttail[RCU_DONE_TAIL] != NULL;
+              rdp->nxttail[RCU_NEXT_TAIL] != NULL;
 }
 
 /*