All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rcu: Register rcu-lazy shrinker only CONFIG_RCU_LAZY is enabled
@ 2023-01-30  7:17 Zqiang
  2023-01-30 15:00 ` Joel Fernandes
  0 siblings, 1 reply; 3+ messages in thread
From: Zqiang @ 2023-01-30  7:17 UTC (permalink / raw)
  To: paulmck, frederic, quic_neeraju, joel; +Cc: rcu, linux-kernel

The rcu-lazy shrinker is registered without CONFIG_RCU_LAZY enabled
is meaningless, this commit therefore make rcu-lazy shrinker is
registered only when CONFIG_RCU_LAZY is enabled.

Signed-off-by: Zqiang <qiang1.zhang@intel.com>
---
 kernel/rcu/tree_nocb.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h
index 9e1c8caec5ce..28c1c092817b 100644
--- a/kernel/rcu/tree_nocb.h
+++ b/kernel/rcu/tree_nocb.h
@@ -1312,6 +1312,7 @@ int rcu_nocb_cpu_offload(int cpu)
 }
 EXPORT_SYMBOL_GPL(rcu_nocb_cpu_offload);
 
+#ifdef CONFIG_RCU_LAZY
 static unsigned long
 lazy_rcu_shrink_count(struct shrinker *shrink, struct shrink_control *sc)
 {
@@ -1360,6 +1361,7 @@ static struct shrinker lazy_rcu_shrinker = {
 	.batch = 0,
 	.seeks = DEFAULT_SEEKS,
 };
+#endif
 
 void __init rcu_init_nohz(void)
 {
@@ -1391,8 +1393,10 @@ void __init rcu_init_nohz(void)
 	if (!rcu_state.nocb_is_setup)
 		return;
 
+#ifdef CONFIG_RCU_LAZY
 	if (register_shrinker(&lazy_rcu_shrinker, "rcu-lazy"))
 		pr_err("Failed to register lazy_rcu shrinker!\n");
+#endif
 
 	if (!cpumask_subset(rcu_nocb_mask, cpu_possible_mask)) {
 		pr_info("\tNote: kernel parameter 'rcu_nocbs=', 'nohz_full', or 'isolcpus=' contains nonexistent CPUs.\n");
-- 
2.25.1


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

* Re: [PATCH] rcu: Register rcu-lazy shrinker only CONFIG_RCU_LAZY is enabled
  2023-01-30  7:17 [PATCH] rcu: Register rcu-lazy shrinker only CONFIG_RCU_LAZY is enabled Zqiang
@ 2023-01-30 15:00 ` Joel Fernandes
  2023-01-30 17:27   ` Paul E. McKenney
  0 siblings, 1 reply; 3+ messages in thread
From: Joel Fernandes @ 2023-01-30 15:00 UTC (permalink / raw)
  To: Zqiang; +Cc: paulmck, frederic, quic_neeraju, rcu, linux-kernel

On Mon, Jan 30, 2023 at 2:12 AM Zqiang <qiang1.zhang@intel.com> wrote:
>
> The rcu-lazy shrinker is registered without CONFIG_RCU_LAZY enabled
> is meaningless, this commit therefore make rcu-lazy shrinker is
> registered only when CONFIG_RCU_LAZY is enabled.
>
> Signed-off-by: Zqiang <qiang1.zhang@intel.com>

Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>

Thanks.

> ---
>  kernel/rcu/tree_nocb.h | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h
> index 9e1c8caec5ce..28c1c092817b 100644
> --- a/kernel/rcu/tree_nocb.h
> +++ b/kernel/rcu/tree_nocb.h
> @@ -1312,6 +1312,7 @@ int rcu_nocb_cpu_offload(int cpu)
>  }
>  EXPORT_SYMBOL_GPL(rcu_nocb_cpu_offload);
>
> +#ifdef CONFIG_RCU_LAZY
>  static unsigned long
>  lazy_rcu_shrink_count(struct shrinker *shrink, struct shrink_control *sc)
>  {
> @@ -1360,6 +1361,7 @@ static struct shrinker lazy_rcu_shrinker = {
>         .batch = 0,
>         .seeks = DEFAULT_SEEKS,
>  };
> +#endif
>
>  void __init rcu_init_nohz(void)
>  {
> @@ -1391,8 +1393,10 @@ void __init rcu_init_nohz(void)
>         if (!rcu_state.nocb_is_setup)
>                 return;
>
> +#ifdef CONFIG_RCU_LAZY
>         if (register_shrinker(&lazy_rcu_shrinker, "rcu-lazy"))
>                 pr_err("Failed to register lazy_rcu shrinker!\n");
> +#endif
>
>         if (!cpumask_subset(rcu_nocb_mask, cpu_possible_mask)) {
>                 pr_info("\tNote: kernel parameter 'rcu_nocbs=', 'nohz_full', or 'isolcpus=' contains nonexistent CPUs.\n");
> --
> 2.25.1
>

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

* Re: [PATCH] rcu: Register rcu-lazy shrinker only CONFIG_RCU_LAZY is enabled
  2023-01-30 15:00 ` Joel Fernandes
@ 2023-01-30 17:27   ` Paul E. McKenney
  0 siblings, 0 replies; 3+ messages in thread
From: Paul E. McKenney @ 2023-01-30 17:27 UTC (permalink / raw)
  To: Joel Fernandes; +Cc: Zqiang, frederic, quic_neeraju, rcu, linux-kernel

On Mon, Jan 30, 2023 at 10:00:42AM -0500, Joel Fernandes wrote:
> On Mon, Jan 30, 2023 at 2:12 AM Zqiang <qiang1.zhang@intel.com> wrote:
> >
> > The rcu-lazy shrinker is registered without CONFIG_RCU_LAZY enabled
> > is meaningless, this commit therefore make rcu-lazy shrinker is
> > registered only when CONFIG_RCU_LAZY is enabled.
> >
> > Signed-off-by: Zqiang <qiang1.zhang@intel.com>
> 
> Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>

Queued and pushed, thank you both!

Twice, actually.  I missed Joel's reviewed-by the first time around,
fixed now.

							Thanx, Paul

> Thanks.
> 
> > ---
> >  kernel/rcu/tree_nocb.h | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h
> > index 9e1c8caec5ce..28c1c092817b 100644
> > --- a/kernel/rcu/tree_nocb.h
> > +++ b/kernel/rcu/tree_nocb.h
> > @@ -1312,6 +1312,7 @@ int rcu_nocb_cpu_offload(int cpu)
> >  }
> >  EXPORT_SYMBOL_GPL(rcu_nocb_cpu_offload);
> >
> > +#ifdef CONFIG_RCU_LAZY
> >  static unsigned long
> >  lazy_rcu_shrink_count(struct shrinker *shrink, struct shrink_control *sc)
> >  {
> > @@ -1360,6 +1361,7 @@ static struct shrinker lazy_rcu_shrinker = {
> >         .batch = 0,
> >         .seeks = DEFAULT_SEEKS,
> >  };
> > +#endif
> >
> >  void __init rcu_init_nohz(void)
> >  {
> > @@ -1391,8 +1393,10 @@ void __init rcu_init_nohz(void)
> >         if (!rcu_state.nocb_is_setup)
> >                 return;
> >
> > +#ifdef CONFIG_RCU_LAZY
> >         if (register_shrinker(&lazy_rcu_shrinker, "rcu-lazy"))
> >                 pr_err("Failed to register lazy_rcu shrinker!\n");
> > +#endif
> >
> >         if (!cpumask_subset(rcu_nocb_mask, cpu_possible_mask)) {
> >                 pr_info("\tNote: kernel parameter 'rcu_nocbs=', 'nohz_full', or 'isolcpus=' contains nonexistent CPUs.\n");
> > --
> > 2.25.1
> >

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

end of thread, other threads:[~2023-01-30 17:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-30  7:17 [PATCH] rcu: Register rcu-lazy shrinker only CONFIG_RCU_LAZY is enabled Zqiang
2023-01-30 15:00 ` Joel Fernandes
2023-01-30 17:27   ` Paul E. McKenney

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.