]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
rcu: Fix up pending cbs check in rcu_prepare_for_idle
authorNeeraj Upadhyay <neeraju@codeaurora.org>
Mon, 7 Aug 2017 05:50:10 +0000 (11:20 +0530)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 9 Oct 2017 21:24:14 +0000 (14:24 -0700)
The pending-callbacks check in rcu_prepare_for_idle() is backwards.
It should accelerate if there are pending callbacks, but the check
rather uselessly accelerates only if there are no callbacks.  This commit
therefore inverts this check.

Fixes: 15fecf89e46a ("srcu: Abstract multi-tail callback list handling")
Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: <stable@vger.kernel.org> # 4.12.x
kernel/rcu/tree_plugin.h

index e012b9be777e3ba00ccf2fe4d05df78b78abd8f5..fed95fa941e61737e55b84ce080135059c2dfbd3 100644 (file)
@@ -1507,7 +1507,7 @@ static void rcu_prepare_for_idle(void)
        rdtp->last_accelerate = jiffies;
        for_each_rcu_flavor(rsp) {
                rdp = this_cpu_ptr(rsp->rda);
-               if (rcu_segcblist_pend_cbs(&rdp->cblist))
+               if (!rcu_segcblist_pend_cbs(&rdp->cblist))
                        continue;
                rnp = rdp->mynode;
                raw_spin_lock_rcu_node(rnp); /* irqs already disabled. */