diff mbox series

[V2,03/11] rcu: Reorder tree_exp.h after tree_plugin.h

Message ID 20240407090558.3395-4-jiangshanlai@gmail.com (mailing list archive)
State New
Headers show
Series rcu/x86: Use per-cpu rcu preempt count | expand

Commit Message

Lai Jiangshan April 7, 2024, 9:05 a.m. UTC
From: Lai Jiangshan <jiangshan.ljs@antgroup.com>

Enable tree_exp.h using some rcu preempt macros introduced in
the next patch. The new macros touch core rcu-preempt fields
and are better to be implemented in tree_plugin.h.

Cc: "Paul E. McKenney" <paulmck@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com>
---
 kernel/rcu/tree.c        | 2 +-
 kernel/rcu/tree_plugin.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

Comments

Joel Fernandes April 23, 2024, 5:58 p.m. UTC | #1
On Sun, Apr 7, 2024 at 5:03 AM Lai Jiangshan <jiangshanlai@gmail.com> wrote:
>
> From: Lai Jiangshan <jiangshan.ljs@antgroup.com>
>
> Enable tree_exp.h using some rcu preempt macros introduced in
> the next patch. The new macros touch core rcu-preempt fields
> and are better to be implemented in tree_plugin.h.
>
> Cc: "Paul E. McKenney" <paulmck@kernel.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Frederic Weisbecker <frederic@kernel.org>
> Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com>
> ---
>  kernel/rcu/tree.c        | 2 +-
>  kernel/rcu/tree_plugin.h | 1 +
>  2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index d9642dd06c25..57d1ae26861f 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -5245,6 +5245,6 @@ void __init rcu_init(void)
>  }
>
>  #include "tree_stall.h"
> -#include "tree_exp.h"
>  #include "tree_nocb.h"
>  #include "tree_plugin.h"
> +#include "tree_exp.h"
> diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
> index b1264096d03a..d899b4afc21c 100644
> --- a/kernel/rcu/tree_plugin.h
> +++ b/kernel/rcu/tree_plugin.h
> @@ -103,6 +103,7 @@ static void __init rcu_bootup_announce_oddness(void)
>  #ifdef CONFIG_PREEMPT_RCU
>
>  static void rcu_report_exp_rnp(struct rcu_node *rnp, bool wake);
> +static bool sync_rcu_exp_done(struct rcu_node *rnp);
>  static void rcu_read_unlock_special(struct task_struct *t);

OK with me, but not sure if the reordering of header inclusion is
needed? You could get the same results by just adding declarations of
the new helpers to tree_exp.h.

Not sure if tree_plugin.h needs to be included last, I for some reason
thought it needed to be - but looks like not. I found a thread that
shed some light into the header file including C code thing as well,
which may or may not help:
https://lore.kernel.org/all/8ab3ca72-e20c-4b18-803f-bf6937c2cd70@paulmck-laptop/#t

Thanks.
Lai Jiangshan April 24, 2024, 2:47 a.m. UTC | #2
On Wed, Apr 24, 2024 at 1:58 AM Joel Fernandes <joel@joelfernandes.org> wrote:
>
> On Sun, Apr 7, 2024 at 5:03 AM Lai Jiangshan <jiangshanlai@gmail.com> wrote:
> >
> > From: Lai Jiangshan <jiangshan.ljs@antgroup.com>
> >
> > Enable tree_exp.h using some rcu preempt macros introduced in
> > the next patch. The new macros touch core rcu-preempt fields
> > and are better to be implemented in tree_plugin.h.
> >
> > Cc: "Paul E. McKenney" <paulmck@kernel.org>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Frederic Weisbecker <frederic@kernel.org>
> > Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com>
> > ---
> >  kernel/rcu/tree.c        | 2 +-
> >  kernel/rcu/tree_plugin.h | 1 +
> >  2 files changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> > index d9642dd06c25..57d1ae26861f 100644
> > --- a/kernel/rcu/tree.c
> > +++ b/kernel/rcu/tree.c
> > @@ -5245,6 +5245,6 @@ void __init rcu_init(void)
> >  }
> >
> >  #include "tree_stall.h"
> > -#include "tree_exp.h"
> >  #include "tree_nocb.h"
> >  #include "tree_plugin.h"
> > +#include "tree_exp.h"
> > diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
> > index b1264096d03a..d899b4afc21c 100644
> > --- a/kernel/rcu/tree_plugin.h
> > +++ b/kernel/rcu/tree_plugin.h
> > @@ -103,6 +103,7 @@ static void __init rcu_bootup_announce_oddness(void)
> >  #ifdef CONFIG_PREEMPT_RCU
> >
> >  static void rcu_report_exp_rnp(struct rcu_node *rnp, bool wake);
> > +static bool sync_rcu_exp_done(struct rcu_node *rnp);
> >  static void rcu_read_unlock_special(struct task_struct *t);
>
> OK with me, but not sure if the reordering of header inclusion is
> needed? You could get the same results by just adding declarations of
> the new helpers to tree_exp.h.

The new macros (in later patch) touch core rcu-preempt fields
and are better to be implemented in tree_plugin.h.

>
> Not sure if tree_plugin.h needs to be included last, I for some reason
> thought it needed to be - but looks like not. I found a thread that
> shed some light into the header file including C code thing as well,
> which may or may not help:
> https://lore.kernel.org/all/8ab3ca72-e20c-4b18-803f-bf6937c2cd70@paulmck-laptop/#t
>
> Thanks.
diff mbox series

Patch

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index d9642dd06c25..57d1ae26861f 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -5245,6 +5245,6 @@  void __init rcu_init(void)
 }
 
 #include "tree_stall.h"
-#include "tree_exp.h"
 #include "tree_nocb.h"
 #include "tree_plugin.h"
+#include "tree_exp.h"
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index b1264096d03a..d899b4afc21c 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -103,6 +103,7 @@  static void __init rcu_bootup_announce_oddness(void)
 #ifdef CONFIG_PREEMPT_RCU
 
 static void rcu_report_exp_rnp(struct rcu_node *rnp, bool wake);
+static bool sync_rcu_exp_done(struct rcu_node *rnp);
 static void rcu_read_unlock_special(struct task_struct *t);
 
 /*