lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEXW_YRUV_P7oEbtkRdKyRGcrWjkr9331SD4ymw_7q-54Ggx7A@mail.gmail.com>
Date:   Mon, 30 Jan 2023 10:00:42 -0500
From:   Joel Fernandes <joel@...lfernandes.org>
To:     Zqiang <qiang1.zhang@...el.com>
Cc:     paulmck@...nel.org, frederic@...nel.org, quic_neeraju@...cinc.com,
        rcu@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rcu: Register rcu-lazy shrinker only CONFIG_RCU_LAZY is enabled

On Mon, Jan 30, 2023 at 2:12 AM Zqiang <qiang1.zhang@...el.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@...el.com>

Reviewed-by: Joel Fernandes (Google) <joel@...lfernandes.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
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ