linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 1/2] sched/core: Convert synchronize_rcu_mult to synchronize_rcu
@ 2018-10-02  1:20 Joel Fernandes
  2018-10-02  1:20 ` [PATCH RFC 2/2] rcu: Remove synchronize_rcu_mult since it has no more users Joel Fernandes
  2018-10-02  3:38 ` [PATCH RFC 1/2] sched/core: Convert synchronize_rcu_mult to synchronize_rcu Paul E. McKenney
  0 siblings, 2 replies; 5+ messages in thread
From: Joel Fernandes @ 2018-10-02  1:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: kernel-team, Joel Fernandes (Google),
	Ingo Molnar, Josh Triplett, Lai Jiangshan, Mathieu Desnoyers,
	Paul E. McKenney, Peter Zijlstra, Steven Rostedt

From: "Joel Fernandes (Google)" <joel@joelfernandes.org>

synchronize_rcu_mult is now obsolete since all the different RCU flavors
have been consolidated and the API is now common on the updater side.
sched/core.c is the only user of it. All call_rcu_<flavor> calls boil
down to the same call_rcu. So there's no point in calling
synchronize_rcu_mult infact it could potentially be slower due to
waiting for the call_rcu callback twice. Just call synchronize_rcu here
which should do the job.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
---
 kernel/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 625bc9897f62..d8311f3cf58c 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5791,7 +5791,7 @@ int sched_cpu_deactivate(unsigned int cpu)
 	 *
 	 * Do sync before park smpboot threads to take care the rcu boost case.
 	 */
-	synchronize_rcu_mult(call_rcu, call_rcu_sched);
+	synchronize_rcu();
 
 	if (!sched_smp_initialized)
 		return 0;
-- 
2.19.0.605.g01d371f741-goog


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

* [PATCH RFC 2/2] rcu: Remove synchronize_rcu_mult since it has no more users
  2018-10-02  1:20 [PATCH RFC 1/2] sched/core: Convert synchronize_rcu_mult to synchronize_rcu Joel Fernandes
@ 2018-10-02  1:20 ` Joel Fernandes
  2018-10-02  3:38 ` [PATCH RFC 1/2] sched/core: Convert synchronize_rcu_mult to synchronize_rcu Paul E. McKenney
  1 sibling, 0 replies; 5+ messages in thread
From: Joel Fernandes @ 2018-10-02  1:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: kernel-team, Joel Fernandes (Google),
	Ingo Molnar, Josh Triplett, Lai Jiangshan, Mathieu Desnoyers,
	Paul E. McKenney, Peter Zijlstra, Steven Rostedt

From: "Joel Fernandes (Google)" <joel@joelfernandes.org>

sched/core.c was the only user of synchronize_rcu_mult. It has been
coverted to use synchronize_rcu. So lets remove the synchronize_rcu_mult
implementation entirely.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
---
 include/linux/rcupdate_wait.h | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/include/linux/rcupdate_wait.h b/include/linux/rcupdate_wait.h
index 8a16c3eb3dd0..c0578ba23c1a 100644
--- a/include/linux/rcupdate_wait.h
+++ b/include/linux/rcupdate_wait.h
@@ -31,21 +31,4 @@ do {									\
 
 #define wait_rcu_gp(...) _wait_rcu_gp(false, __VA_ARGS__)
 
-/**
- * synchronize_rcu_mult - Wait concurrently for multiple grace periods
- * @...: List of call_rcu() functions for different grace periods to wait on
- *
- * This macro waits concurrently for multiple types of RCU grace periods.
- * For example, synchronize_rcu_mult(call_rcu, call_rcu_tasks) would wait
- * on concurrent RCU and RCU-tasks grace periods.  Waiting on a give SRCU
- * domain requires you to write a wrapper function for that SRCU domain's
- * call_srcu() function, supplying the corresponding srcu_struct.
- *
- * If Tiny RCU, tell _wait_rcu_gp() does not bother waiting for RCU,
- * given that anywhere synchronize_rcu_mult() can be called is automatically
- * a grace period.
- */
-#define synchronize_rcu_mult(...) \
-	_wait_rcu_gp(IS_ENABLED(CONFIG_TINY_RCU), __VA_ARGS__)
-
 #endif /* _LINUX_SCHED_RCUPDATE_WAIT_H */
-- 
2.19.0.605.g01d371f741-goog


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

* Re: [PATCH RFC 1/2] sched/core: Convert synchronize_rcu_mult to synchronize_rcu
  2018-10-02  1:20 [PATCH RFC 1/2] sched/core: Convert synchronize_rcu_mult to synchronize_rcu Joel Fernandes
  2018-10-02  1:20 ` [PATCH RFC 2/2] rcu: Remove synchronize_rcu_mult since it has no more users Joel Fernandes
@ 2018-10-02  3:38 ` Paul E. McKenney
  2018-10-02 21:20   ` Joel Fernandes
  1 sibling, 1 reply; 5+ messages in thread
From: Paul E. McKenney @ 2018-10-02  3:38 UTC (permalink / raw)
  To: Joel Fernandes
  Cc: linux-kernel, kernel-team, Ingo Molnar, Josh Triplett,
	Lai Jiangshan, Mathieu Desnoyers, Peter Zijlstra, Steven Rostedt

On Mon, Oct 01, 2018 at 06:20:11PM -0700, Joel Fernandes wrote:
> From: "Joel Fernandes (Google)" <joel@joelfernandes.org>
> 
> synchronize_rcu_mult is now obsolete since all the different RCU flavors
> have been consolidated and the API is now common on the updater side.
> sched/core.c is the only user of it. All call_rcu_<flavor> calls boil
> down to the same call_rcu. So there's no point in calling
> synchronize_rcu_mult infact it could potentially be slower due to
> waiting for the call_rcu callback twice. Just call synchronize_rcu here
> which should do the job.
> 
> Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>

Well, the theory was that I was going to keep this series hidden until
the consolidation hit mainline just to avoid confusion, but please see
5fc9d4e000b1 ("rcu: Eliminate synchronize_rcu_mult()"), which I just
now pushed to -rcu.  To your credit, you did get most of it.  ;-)

Here is the full list:

pick 1f3e6eaed8fa Apply coccinelle script to consolidate calls to RCU-bh and RCU-sched
pick 5fc9d4e000b1 rcu: Eliminate synchronize_rcu_mult()
pick a8475496801e rcu: Consolidate the RCU update functions invoked by sync.c
pick d8ffb03461ad sched/membarrier: Replace synchronize_sched() with synchronize_rcu()

Of course, I will need to rerun the coccinelle script and split the
result across subsystems, but I am waiting until the current pull
request hits mainline.  Let's face it, none of us need to do debugging
on someone consolidating their RCU updates before at least this commit
and its predecessors hit mainline:

709fdce7545c ("rcu: Express Tiny RCU updates in terms of RCU rather than RCU-sched")

I sent the pull request to Ingo a few days ago, so with some luck this
will all get to mainline during the next merge window, and then it is
open season on outside-of-RCU cleanups.  ;-)

							Thanx, Paul

> ---
>  kernel/sched/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 625bc9897f62..d8311f3cf58c 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -5791,7 +5791,7 @@ int sched_cpu_deactivate(unsigned int cpu)
>  	 *
>  	 * Do sync before park smpboot threads to take care the rcu boost case.
>  	 */
> -	synchronize_rcu_mult(call_rcu, call_rcu_sched);
> +	synchronize_rcu();
>  
>  	if (!sched_smp_initialized)
>  		return 0;
> -- 
> 2.19.0.605.g01d371f741-goog
> 


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

* Re: [PATCH RFC 1/2] sched/core: Convert synchronize_rcu_mult to synchronize_rcu
  2018-10-02  3:38 ` [PATCH RFC 1/2] sched/core: Convert synchronize_rcu_mult to synchronize_rcu Paul E. McKenney
@ 2018-10-02 21:20   ` Joel Fernandes
  2018-10-02 22:07     ` Paul E. McKenney
  0 siblings, 1 reply; 5+ messages in thread
From: Joel Fernandes @ 2018-10-02 21:20 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: linux-kernel, kernel-team, Ingo Molnar, Josh Triplett,
	Lai Jiangshan, Mathieu Desnoyers, Peter Zijlstra, Steven Rostedt

On Mon, Oct 01, 2018 at 08:38:01PM -0700, Paul E. McKenney wrote:
> On Mon, Oct 01, 2018 at 06:20:11PM -0700, Joel Fernandes wrote:
> > From: "Joel Fernandes (Google)" <joel@joelfernandes.org>
> > 
> > synchronize_rcu_mult is now obsolete since all the different RCU flavors
> > have been consolidated and the API is now common on the updater side.
> > sched/core.c is the only user of it. All call_rcu_<flavor> calls boil
> > down to the same call_rcu. So there's no point in calling
> > synchronize_rcu_mult infact it could potentially be slower due to
> > waiting for the call_rcu callback twice. Just call synchronize_rcu here
> > which should do the job.
> > 
> > Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
> 
> Well, the theory was that I was going to keep this series hidden until
> the consolidation hit mainline just to avoid confusion, but please see
> 5fc9d4e000b1 ("rcu: Eliminate synchronize_rcu_mult()"), which I just
> now pushed to -rcu.  To your credit, you did get most of it.  ;-)

Glad you already took care of that ;-) I should have taken a peek at rcu/test
branch :D

> Here is the full list:
> 
> pick 1f3e6eaed8fa Apply coccinelle script to consolidate calls to RCU-bh and RCU-sched
> pick 5fc9d4e000b1 rcu: Eliminate synchronize_rcu_mult()
> pick a8475496801e rcu: Consolidate the RCU update functions invoked by sync.c
> pick d8ffb03461ad sched/membarrier: Replace synchronize_sched() with synchronize_rcu()
> 
> Of course, I will need to rerun the coccinelle script and split the
> result across subsystems, but I am waiting until the current pull
> request hits mainline.  Let's face it, none of us need to do debugging
> on someone consolidating their RCU updates before at least this commit
> and its predecessors hit mainline:
> 
> 709fdce7545c ("rcu: Express Tiny RCU updates in terms of RCU rather than RCU-sched")
> 
> I sent the pull request to Ingo a few days ago, so with some luck this
> will all get to mainline during the next merge window, and then it is
> open season on outside-of-RCU cleanups.  ;-)

Cool, thanks,

 - Joel


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

* Re: [PATCH RFC 1/2] sched/core: Convert synchronize_rcu_mult to synchronize_rcu
  2018-10-02 21:20   ` Joel Fernandes
@ 2018-10-02 22:07     ` Paul E. McKenney
  0 siblings, 0 replies; 5+ messages in thread
From: Paul E. McKenney @ 2018-10-02 22:07 UTC (permalink / raw)
  To: Joel Fernandes
  Cc: linux-kernel, kernel-team, Ingo Molnar, Josh Triplett,
	Lai Jiangshan, Mathieu Desnoyers, Peter Zijlstra, Steven Rostedt

On Tue, Oct 02, 2018 at 02:20:19PM -0700, Joel Fernandes wrote:
> On Mon, Oct 01, 2018 at 08:38:01PM -0700, Paul E. McKenney wrote:
> > On Mon, Oct 01, 2018 at 06:20:11PM -0700, Joel Fernandes wrote:
> > > From: "Joel Fernandes (Google)" <joel@joelfernandes.org>
> > > 
> > > synchronize_rcu_mult is now obsolete since all the different RCU flavors
> > > have been consolidated and the API is now common on the updater side.
> > > sched/core.c is the only user of it. All call_rcu_<flavor> calls boil
> > > down to the same call_rcu. So there's no point in calling
> > > synchronize_rcu_mult infact it could potentially be slower due to
> > > waiting for the call_rcu callback twice. Just call synchronize_rcu here
> > > which should do the job.
> > > 
> > > Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
> > 
> > Well, the theory was that I was going to keep this series hidden until
> > the consolidation hit mainline just to avoid confusion, but please see
> > 5fc9d4e000b1 ("rcu: Eliminate synchronize_rcu_mult()"), which I just
> > now pushed to -rcu.  To your credit, you did get most of it.  ;-)
> 
> Glad you already took care of that ;-) I should have taken a peek at rcu/test
> branch :D

You wouldn't have seen anything before yesterday, so no worries!

> > Here is the full list:
> > 
> > pick 1f3e6eaed8fa Apply coccinelle script to consolidate calls to RCU-bh and RCU-sched
> > pick 5fc9d4e000b1 rcu: Eliminate synchronize_rcu_mult()
> > pick a8475496801e rcu: Consolidate the RCU update functions invoked by sync.c
> > pick d8ffb03461ad sched/membarrier: Replace synchronize_sched() with synchronize_rcu()
> > 
> > Of course, I will need to rerun the coccinelle script and split the
> > result across subsystems, but I am waiting until the current pull
> > request hits mainline.  Let's face it, none of us need to do debugging
> > on someone consolidating their RCU updates before at least this commit
> > and its predecessors hit mainline:
> > 
> > 709fdce7545c ("rcu: Express Tiny RCU updates in terms of RCU rather than RCU-sched")
> > 
> > I sent the pull request to Ingo a few days ago, so with some luck this
> > will all get to mainline during the next merge window, and then it is
> > open season on outside-of-RCU cleanups.  ;-)
> 
> Cool, thanks,

And Ingo did pull it, and you should have been CCed on a few of the
-tip notifications.  ;-)

							Thanx, Paul


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

end of thread, other threads:[~2018-10-02 22:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-02  1:20 [PATCH RFC 1/2] sched/core: Convert synchronize_rcu_mult to synchronize_rcu Joel Fernandes
2018-10-02  1:20 ` [PATCH RFC 2/2] rcu: Remove synchronize_rcu_mult since it has no more users Joel Fernandes
2018-10-02  3:38 ` [PATCH RFC 1/2] sched/core: Convert synchronize_rcu_mult to synchronize_rcu Paul E. McKenney
2018-10-02 21:20   ` Joel Fernandes
2018-10-02 22:07     ` 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).