aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2015-12-13 11:57:10 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2016-02-23 22:59:52 -0500
commit23a9bacd357ab8388c7e07101b186a4282874992 (patch)
tree4764d724950b9f227699311cf66304f55cfa36a6 /kernel/rcu
parent4914950aaa12de8a2004b8031b45480526caf42b (diff)
rcu: Set rdp->gpwrap when CPU is idle
Commit #e3663b1024d1 ("rcu: Handle gpnum/completed wrap while dyntick idle") sets rdp->gpwrap on the wrong side of the "if" statement in dyntick_save_progress_counter(), that is, it sets it when the CPU is not idle instead of when it is idle. Of course, if the CPU is not idle, its rdp->gpnum won't be lagging beind the global rsp->gpnum, which means that rdp->gpwrap will never be set. This commit therefore moves this code to the proper leg of that "if" statement. This change means that the "else" cause is just "return 0" and the "then" clause ends with "return 1", so also move the "return 0" to follow the "if", dropping the "else" clause. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcu')
-rw-r--r--kernel/rcu/tree.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 68f4bee3ecc3..976a166f3fa3 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1083,13 +1083,12 @@ static int dyntick_save_progress_counter(struct rcu_data *rdp,
1083 rcu_sysidle_check_cpu(rdp, isidle, maxj); 1083 rcu_sysidle_check_cpu(rdp, isidle, maxj);
1084 if ((rdp->dynticks_snap & 0x1) == 0) { 1084 if ((rdp->dynticks_snap & 0x1) == 0) {
1085 trace_rcu_fqs(rdp->rsp->name, rdp->gpnum, rdp->cpu, TPS("dti")); 1085 trace_rcu_fqs(rdp->rsp->name, rdp->gpnum, rdp->cpu, TPS("dti"));
1086 return 1;
1087 } else {
1088 if (ULONG_CMP_LT(READ_ONCE(rdp->gpnum) + ULONG_MAX / 4, 1086 if (ULONG_CMP_LT(READ_ONCE(rdp->gpnum) + ULONG_MAX / 4,
1089 rdp->mynode->gpnum)) 1087 rdp->mynode->gpnum))
1090 WRITE_ONCE(rdp->gpwrap, true); 1088 WRITE_ONCE(rdp->gpwrap, true);
1091 return 0; 1089 return 1;
1092 } 1090 }
1091 return 0;
1093} 1092}
1094 1093
1095/* 1094/*