mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-08 22:32:55 +00:00
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 <laijs@linux.alibaba.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
This commit is contained in:
parent
2eeba5838f
commit
3717e1e9f2
@ -444,16 +444,9 @@ rcu_preempt_deferred_qs_irqrestore(struct task_struct *t, unsigned long flags)
|
|||||||
local_irq_restore(flags);
|
local_irq_restore(flags);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
t->rcu_read_unlock_special.b.exp_hint = false;
|
t->rcu_read_unlock_special.s = 0;
|
||||||
t->rcu_read_unlock_special.b.deferred_qs = false;
|
if (special.b.need_qs)
|
||||||
if (special.b.need_qs) {
|
|
||||||
rcu_qs();
|
rcu_qs();
|
||||||
t->rcu_read_unlock_special.b.need_qs = false;
|
|
||||||
if (!t->rcu_read_unlock_special.s && !rdp->exp_deferred_qs) {
|
|
||||||
local_irq_restore(flags);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Respond to a request by an expedited grace period for a
|
* Respond to a request by an expedited grace period for a
|
||||||
@ -461,17 +454,11 @@ rcu_preempt_deferred_qs_irqrestore(struct task_struct *t, unsigned long flags)
|
|||||||
* tasks are handled when removing the task from the
|
* tasks are handled when removing the task from the
|
||||||
* blocked-tasks list below.
|
* blocked-tasks list below.
|
||||||
*/
|
*/
|
||||||
if (rdp->exp_deferred_qs) {
|
if (rdp->exp_deferred_qs)
|
||||||
rcu_report_exp_rdp(rdp);
|
rcu_report_exp_rdp(rdp);
|
||||||
if (!t->rcu_read_unlock_special.s) {
|
|
||||||
local_irq_restore(flags);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Clean up if blocked during RCU read-side critical section. */
|
/* Clean up if blocked during RCU read-side critical section. */
|
||||||
if (special.b.blocked) {
|
if (special.b.blocked) {
|
||||||
t->rcu_read_unlock_special.b.blocked = false;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Remove this task from the list it blocked on. The task
|
* Remove this task from the list it blocked on. The task
|
||||||
|
Loading…
Reference in New Issue
Block a user