rcu.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rcu: Move common code out of if-else block
@ 2019-03-02  8:57 Akira Yokosawa
  2019-03-05  1:33 ` Paul E. McKenney
  0 siblings, 1 reply; 2+ messages in thread
From: Akira Yokosawa @ 2019-03-02  8:57 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: Josh Triplett, Joel Fernandes, Steven Rostedt, Mathieu Desnoyers,
	Lai Jiangshan, rcu

From 97f4bcece9a9beb792b623f847570144a0a71ccc Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@gmail.com>
Date: Sat, 2 Mar 2019 17:25:19 +0900
Subject: [PATCH] rcu: Move common code out of if-else block

As the result of recent addition of "rdp->core_needs_qs = false;" in
the "if" block, now both branches of the if-else have the same
assignment.

Factor it out and reduce line count.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
Cc: Joel Fernandes <joel@joelfernandes.org>
---
Hi Paul,

This patch is supposed to do the change mentioned in off-the-list
correspondence.  As the earlier change by Joel has not landed on
tip tree, I avoided mentioning the commit id of the change
(ac2baf64948d in -rcu as of today) in the change log.

Does this work for you? 

        Thanks, Akira
--
 kernel/rcu/tree.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 7273ef0..449e8a4 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1910,12 +1910,10 @@ rcu_report_qs_rdp(int cpu, struct rcu_data *rdp)
 		return;
 	}
 	mask = rdp->grpmask;
+	rdp->core_needs_qs = false;
 	if ((rnp->qsmask & mask) == 0) {
-		rdp->core_needs_qs = false;
 		raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
 	} else {
-		rdp->core_needs_qs = false;
-
 		/*
 		 * This GP can't end until cpu checks in, so all of our
 		 * callbacks can be processed during the next GP.
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] rcu: Move common code out of if-else block
  2019-03-02  8:57 [PATCH] rcu: Move common code out of if-else block Akira Yokosawa
@ 2019-03-05  1:33 ` Paul E. McKenney
  0 siblings, 0 replies; 2+ messages in thread
From: Paul E. McKenney @ 2019-03-05  1:33 UTC (permalink / raw)
  To: Akira Yokosawa
  Cc: Josh Triplett, Joel Fernandes, Steven Rostedt, Mathieu Desnoyers,
	Lai Jiangshan, rcu

On Sat, Mar 02, 2019 at 05:57:17PM +0900, Akira Yokosawa wrote:
> >From 97f4bcece9a9beb792b623f847570144a0a71ccc Mon Sep 17 00:00:00 2001
> From: Akira Yokosawa <akiyks@gmail.com>
> Date: Sat, 2 Mar 2019 17:25:19 +0900
> Subject: [PATCH] rcu: Move common code out of if-else block
> 
> As the result of recent addition of "rdp->core_needs_qs = false;" in
> the "if" block, now both branches of the if-else have the same
> assignment.
> 
> Factor it out and reduce line count.
> 
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> Cc: Joel Fernandes <joel@joelfernandes.org>

Queued and pushed, thank you both!

It passes (very) light rcutorture testing.  I will hit it harder
this evening.

							Thanx, Paul

> ---
> Hi Paul,
> 
> This patch is supposed to do the change mentioned in off-the-list
> correspondence.  As the earlier change by Joel has not landed on
> tip tree, I avoided mentioning the commit id of the change
> (ac2baf64948d in -rcu as of today) in the change log.
> 
> Does this work for you? 
> 
>         Thanks, Akira
> --
>  kernel/rcu/tree.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 7273ef0..449e8a4 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -1910,12 +1910,10 @@ rcu_report_qs_rdp(int cpu, struct rcu_data *rdp)
>  		return;
>  	}
>  	mask = rdp->grpmask;
> +	rdp->core_needs_qs = false;
>  	if ((rnp->qsmask & mask) == 0) {
> -		rdp->core_needs_qs = false;
>  		raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
>  	} else {
> -		rdp->core_needs_qs = false;
> -
>  		/*
>  		 * This GP can't end until cpu checks in, so all of our
>  		 * callbacks can be processed during the next GP.
> -- 
> 2.7.4
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-05  1:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-02  8:57 [PATCH] rcu: Move common code out of if-else block Akira Yokosawa
2019-03-05  1:33 ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).