2024-01-29 23:25:37

by Boqun Feng

[permalink] [raw]
Subject: [PATCH 1/8] rcu/exp: Remove full barrier upon main thread wakeup

From: Frederic Weisbecker <[email protected]>

When an expedited grace period is ending, care must be taken so that all
the quiescent states propagated up to the root are correctly ordered
against the wake up of the main expedited grace period workqueue.

This ordering is already carried through the root rnp locking augmented
by an smp_mb__after_unlock_lock() barrier.

Therefore the explicit smp_mb() placed before the wake up is not needed
and can be removed.

Signed-off-by: Frederic Weisbecker <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>
---
kernel/rcu/tree_exp.h | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/kernel/rcu/tree_exp.h b/kernel/rcu/tree_exp.h
index 2ac440bc7e10..014ddf672165 100644
--- a/kernel/rcu/tree_exp.h
+++ b/kernel/rcu/tree_exp.h
@@ -198,10 +198,9 @@ static void __rcu_report_exp_rnp(struct rcu_node *rnp,
}
if (rnp->parent == NULL) {
raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
- if (wake) {
- smp_mb(); /* EGP done before wake_up(). */
+ if (wake)
swake_up_one_online(&rcu_state.expedited_wq);
- }
+
break;
}
mask = rnp->grpmask;
--
2.43.0



2024-01-30 16:10:04

by Frederic Weisbecker

[permalink] [raw]
Subject: Re: [PATCH 1/8] rcu/exp: Remove full barrier upon main thread wakeup

Le Mon, Jan 29, 2024 at 03:23:39PM -0800, Boqun Feng a ?crit :
> From: Frederic Weisbecker <[email protected]>
>
> When an expedited grace period is ending, care must be taken so that all
> the quiescent states propagated up to the root are correctly ordered
> against the wake up of the main expedited grace period workqueue.
>
> This ordering is already carried through the root rnp locking augmented
> by an smp_mb__after_unlock_lock() barrier.
>
> Therefore the explicit smp_mb() placed before the wake up is not needed
> and can be removed.
>
> Signed-off-by: Frederic Weisbecker <[email protected]>
> Signed-off-by: Paul E. McKenney <[email protected]>

[Offlist]

For further posting, don't forget to add your own SoB while posting patches :-)

Thanks!

2024-01-30 16:10:46

by Frederic Weisbecker

[permalink] [raw]
Subject: Re: [PATCH 1/8] rcu/exp: Remove full barrier upon main thread wakeup

Le Tue, Jan 30, 2024 at 04:47:16PM +0100, Frederic Weisbecker a ?crit :
> Le Mon, Jan 29, 2024 at 03:23:39PM -0800, Boqun Feng a ?crit :
> > From: Frederic Weisbecker <[email protected]>
> >
> > When an expedited grace period is ending, care must be taken so that all
> > the quiescent states propagated up to the root are correctly ordered
> > against the wake up of the main expedited grace period workqueue.
> >
> > This ordering is already carried through the root rnp locking augmented
> > by an smp_mb__after_unlock_lock() barrier.
> >
> > Therefore the explicit smp_mb() placed before the wake up is not needed
> > and can be removed.
> >
> > Signed-off-by: Frederic Weisbecker <[email protected]>
> > Signed-off-by: Paul E. McKenney <[email protected]>
>
> [Offlist]

And yes that was not offlist, my fingers betrayed me!

>
> For further posting, don't forget to add your own SoB while posting patches :-)
>
> Thanks!
>

2024-01-30 18:43:29

by Boqun Feng

[permalink] [raw]
Subject: Re: [PATCH 1/8] rcu/exp: Remove full barrier upon main thread wakeup

On Tue, Jan 30, 2024 at 04:48:41PM +0100, Frederic Weisbecker wrote:
> Le Tue, Jan 30, 2024 at 04:47:16PM +0100, Frederic Weisbecker a ?crit :
> > Le Mon, Jan 29, 2024 at 03:23:39PM -0800, Boqun Feng a ?crit :
> > > From: Frederic Weisbecker <[email protected]>
> > >
> > > When an expedited grace period is ending, care must be taken so that all
> > > the quiescent states propagated up to the root are correctly ordered
> > > against the wake up of the main expedited grace period workqueue.
> > >
> > > This ordering is already carried through the root rnp locking augmented
> > > by an smp_mb__after_unlock_lock() barrier.
> > >
> > > Therefore the explicit smp_mb() placed before the wake up is not needed
> > > and can be removed.
> > >
> > > Signed-off-by: Frederic Weisbecker <[email protected]>
> > > Signed-off-by: Paul E. McKenney <[email protected]>
> >
> > [Offlist]
>
> And yes that was not offlist, my fingers betrayed me!
>

Thanks for the reminder anyway ;-)

Regards,
Boqun

> >
> > For further posting, don't forget to add your own SoB while posting patches :-)
> >
> > Thanks!
> >