Skip to content

Commit 3717e1e

Browse files
Lai Jiangshanpaulmckrcu
authored andcommitted
rcu: Clear ->rcu_read_unlock_special only once
In rcu_preempt_deferred_qs_irqrestore(), ->rcu_read_unlock_special is cleared one piece at a time. Given that the "if" statements in this function use the copy in "special", this commit removes the clearing of the individual pieces in favor of clearing ->rcu_read_unlock_special in one go just after it has been determined to be non-zero. Signed-off-by: Lai Jiangshan <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 2eeba58 commit 3717e1e

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

kernel/rcu/tree_plugin.h

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -444,34 +444,21 @@ 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;
448-
t->rcu_read_unlock_special.b.deferred_qs = false;
449-
if (special.b.need_qs) {
447+
t->rcu_read_unlock_special.s = 0;
448+
if (special.b.need_qs)
450449
rcu_qs();
451-
t->rcu_read_unlock_special.b.need_qs = false;
452-
if (!t->rcu_read_unlock_special.s && !rdp->exp_deferred_qs) {
453-
local_irq_restore(flags);
454-
return;
455-
}
456-
}
457450

458451
/*
459452
* Respond to a request by an expedited grace period for a
460453
* quiescent state from this CPU. Note that requests from
461454
* tasks are handled when removing the task from the
462455
* blocked-tasks list below.
463456
*/
464-
if (rdp->exp_deferred_qs) {
457+
if (rdp->exp_deferred_qs)
465458
rcu_report_exp_rdp(rdp);
466-
if (!t->rcu_read_unlock_special.s) {
467-
local_irq_restore(flags);
468-
return;
469-
}
470-
}
471459

472460
/* Clean up if blocked during RCU read-side critical section. */
473461
if (special.b.blocked) {
474-
t->rcu_read_unlock_special.b.blocked = false;
475462

476463
/*
477464
* Remove this task from the list it blocked on. The task

0 commit comments

Comments
 (0)