Skip to content

Commit 2eeba58

Browse files
Lai Jiangshanpaulmckrcu
authored andcommitted
rcu: Clear .exp_hint only when deferred quiescent state has been reported
Currently, the .exp_hint flag is cleared in rcu_read_unlock_special(), which works, but which can also prevent subsequent rcu_read_unlock() calls from helping expedite the quiescent state needed by an ongoing expedited RCU grace period. This commit therefore defers clearing of .exp_hint from rcu_read_unlock_special() to rcu_preempt_deferred_qs_irqrestore(), thus ensuring that intervening calls to rcu_read_unlock() have a chance to help end the expedited grace period. Signed-off-by: Lai Jiangshan <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent c130d2d commit 2eeba58

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

kernel/rcu/tree_plugin.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@ rcu_preempt_deferred_qs_irqrestore(struct task_struct *t, unsigned long flags)
444444
local_irq_restore(flags);
445445
return;
446446
}
447+
t->rcu_read_unlock_special.b.exp_hint = false;
447448
t->rcu_read_unlock_special.b.deferred_qs = false;
448449
if (special.b.need_qs) {
449450
rcu_qs();
@@ -610,7 +611,6 @@ static void rcu_read_unlock_special(struct task_struct *t)
610611
struct rcu_data *rdp = this_cpu_ptr(&rcu_data);
611612
struct rcu_node *rnp = rdp->mynode;
612613

613-
t->rcu_read_unlock_special.b.exp_hint = false;
614614
exp = (t->rcu_blocked_node && t->rcu_blocked_node->exp_tasks) ||
615615
(rdp->grpmask & rnp->expmask) ||
616616
tick_nohz_full_cpu(rdp->cpu);
@@ -640,7 +640,6 @@ static void rcu_read_unlock_special(struct task_struct *t)
640640
local_irq_restore(flags);
641641
return;
642642
}
643-
WRITE_ONCE(t->rcu_read_unlock_special.b.exp_hint, false);
644643
rcu_preempt_deferred_qs_irqrestore(t, flags);
645644
}
646645

0 commit comments

Comments
 (0)