rcu: Remove impossible wakeup rcu GP kthread action from rcu_report_qs_rdp()
PATCH v2 1/1 rcu: Remove impossible wakeup rcu GP kthread action from rcu_report_qs_rdp()
When inovke rcu_report_qs_rdp(), if current CPU's rcu_data structure's -> grpmask has not been cleared from the corresponding rcu_node structure's ->qsmask, after that will clear and report quiescent state, but in this time, this also means that current grace period is not end, the current grace period is ongoing, because the rcu_gp_in_progress() currently return true, so for non-offloaded rdp, invoke rcu_accelerate_cbs() is impossible to return true.
This commit therefore remove impossible rcu_gp_kthread_wake() calling.
--- kernel/rcu/tree.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
kernel/rcu/tree.c +1 -4
@@ -1956,7 +1956,6 @@ rcu_report_qs_rdp(struct rcu_data *rdp) {unsigned long flags;unsigned long mask; -bool needwake = false;bool needacc = false;struct rcu_node *rnp;
@@ -1988,7 +1987,7 @@ rcu_report_qs_rdp(struct rcu_data *rdp)* NOCB kthreads have their own way to deal with that... */ if (!rcu_rdp_is_offloaded (rdp)) { - needwake =rcu_accelerate_cbs (rnp, rdp); +WARN_ON_ONCE (rcu_accelerate_cbs (rnp, rdp)); }else if (!rcu_segcblist_completely_offloaded (&rdp->cblist)) {/* * ...but NOCB kthreads may miss or delay callbacks acceleration
@@ -2000,8 +1999,6 @@ rcu_report_qs_rdp(struct rcu_data *rdp)rcu_disable_urgency_upon_qs (rdp);rcu_report_qs_rnp (mask, rnp, rnp->gp_seq, flags);/* ^^^ Released rnp->lock */ -if (needwake) -rcu_gp_kthread_wake ();if (needacc) {rcu_nocb_lock_irqsave (rdp, flags);
Signature · 1 line
2.25.1
Quoted 28 lines · Zqiang
When inovke
rcu_report_qs_rdp(), if current CPU'srcu_datastructure's -> grpmask has not been cleared from the correspondingrcu_nodestructure's ->qsmask, after that will clear and report quiescent state, but in this time, this also means that current grace period is not end, the current grace period is ongoing, because thercu_gp_in_progress()currently return true, so for non-offloaded rdp, invokercu_accelerate_cbs()is impossible to return true.This commit therefore remove impossible
rcu_gp_kthread_wake()calling.Signed-off-by Zqiang <[email protected]>--- kernel/rcu/tree.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)kernel/rcu/tree.c +0
-1@@ -1956,7 +1956,6 @@ rcu_report_qs_rdp(struct rcu_data *rdp) {unsigned long flags;unsigned long mask; -bool needwake = false;bool needacc = false;struct rcu_node *rnp;
kernel/rcu/tree.c rcu_report_qs_rdp(struct rcu_data *rdp) · line 1990
Quoted 5 lines
kernel/rcu/tree.c +1
-1@@ -1988,7 +1987,7 @@ rcu_report_qs_rdp(struct rcu_data *rdp)* NOCB kthreads have their own way to deal with that... */ if (!rcu_rdp_is_offloaded (rdp)) { - needwake =rcu_accelerate_cbs (rnp, rdp); +WARN_ON_ONCE (rcu_accelerate_cbs (rnp, rdp));
Please also add a comment explaining why we don't expect to have to wake up the GP kthread.
Thanks!
Quoted 15 lines
kernel/rcu/tree.c +0
-2}else if (!rcu_segcblist_completely_offloaded (&rdp->cblist)) {/* * ...but NOCB kthreads may miss or delay callbacks acceleration @@ -2000,8 +1999,6 @@ rcu_report_qs_rdp(struct rcu_data *rdp)rcu_disable_urgency_upon_qs (rdp);rcu_report_qs_rnp (mask, rnp, rnp->gp_seq, flags);/* ^^^ Released rnp->lock */ -if (needwake) -rcu_gp_kthread_wake ();if (needacc) {rcu_nocb_lock_irqsave (rdp, flags);Signature · 1 line
2.25.1
Quoted 34 lines · Zqiang
When inovke
rcu_report_qs_rdp(), if current CPU'srcu_datastructure's -> grpmask has not been cleared from the correspondingrcu_nodestructure's ->qsmask, after that will clear and report quiescent state, but in this time, this also means that current grace period is not end, the current grace period is ongoing, because thercu_gp_in_progress()currently return true, so for non-offloaded rdp, invokercu_accelerate_cbs()is impossible to return true.This commit therefore remove impossible
rcu_gp_kthread_wake()calling.Signed-off-by Zqiang <[email protected]>--- kernel/rcu/tree.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)kernel/rcu/tree.c +1
-2@@ -1956,7 +1956,6 @@ rcu_report_qs_rdp(struct rcu_data *rdp) {unsigned long flags;unsigned long mask; -bool needwake = false;bool needacc = false;struct rcu_node *rnp;@@ -1988,7 +1987,7 @@ rcu_report_qs_rdp(struct rcu_data *rdp)* NOCB kthreads have their own way to deal with that... */ if (!rcu_rdp_is_offloaded (rdp)) { - needwake =rcu_accelerate_cbs (rnp, rdp); +WARN_ON_ONCE (rcu_accelerate_cbs (rnp, rdp));
Quoted 2 lines
Please also add a comment explaining why we don't expect to have to wake up the GP kthread.
Thanks Frederic, I will add comment next version.
Quoted 21 lines
Reviewed-by Frederic Weisbecker <[email protected]>Thanks!
kernel/rcu/tree.c +0
-2}else if (!rcu_segcblist_completely_offloaded (&rdp->cblist)) {/* * ...but NOCB kthreads may miss or delay callbacks acceleration @@ -2000,8 +1999,6 @@ rcu_report_qs_rdp(struct rcu_data *rdp)rcu_disable_urgency_upon_qs (rdp);rcu_report_qs_rnp (mask, rnp, rnp->gp_seq, flags);/* ^^^ Released rnp->lock */ -if (needwake) -rcu_gp_kthread_wake ();if (needacc) {rcu_nocb_lock_irqsave (rdp, flags);Signature · 1 line
2.25.1