rcu: Register rcu-lazy shrinker only CONFIG_RCU_LAZY is enabled
PATCH 1/1 rcu: Register rcu-lazy shrinker only CONFIG_RCU_LAZY is enabled
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.
--- kernel/rcu/tree_nocb.h | 4 ++++ 1 file changed, 4 insertions(+)
kernel/rcu/tree_nocb.h +4 -0
@@ -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" );
Signature · 1 line
2.25.1
Quoted 6 lines · Zqiang
The rcu-lazy shrinker is registered without
CONFIG_RCU_LAZYenabled is meaningless, this commit therefore make rcu-lazy shrinker is registered only whenCONFIG_RCU_LAZYis enabled.Signed-off-by Zqiang <[email protected]>
Thanks.
Quoted 38 lines
--- kernel/rcu/tree_nocb.h | 4 ++++ 1 file changed, 4 insertions(+)kernel/rcu/tree_nocb.h +4
-1@@ -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
Quoted 9 lines · Joel Fernandes
Quoted 6 lines · Zqiang
The rcu-lazy shrinker is registered without
CONFIG_RCU_LAZYenabled is meaningless, this commit therefore make rcu-lazy shrinker is registered only whenCONFIG_RCU_LAZYis enabled.Signed-off-by Zqiang <[email protected]>Reviewed-by Joel Fernandes (Google) <[email protected]>
Queued and pushed, thank you both!
Twice, actually. I missed Joel's reviewed-by the first time around, fixed now.
Thanx, Paul
Quoted 40 lines
Thanks.
Quoted 38 lines
--- kernel/rcu/tree_nocb.h | 4 ++++ 1 file changed, 4 insertions(+)kernel/rcu/tree_nocb.h +4
-1@@ -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