rcu: per-cpu rcuc kthread are created only when rcutree.use_softirq=0
PATCH 1/1 rcu: per-cpu rcuc kthread are created only when rcutree.use_softirq=0
In non-RT kernel, if the RCU_BOOST is enabled, the per-cpu rcuc kthread will be created, however under the rcutree.use_softirq=1, the RCU core processing only in softirq context, the rcuc kthread doesn't do anything, so remove RCU_BOOST interference.
--- kernel/rcu/tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/rcu/tree.c +1 -1
@@ -2902,7 +2902,7 @@ static int __init rcu_spawn_core_kthreads(void)for_each_possible_cpu (cpu)per_cpu (rcu_data.rcu_cpu_has_work, cpu) =0 ; -if (!IS_ENABLED (CONFIG_RCU_BOOST ) && use_softirq) +if (use_softirq)return 0 ;WARN_ONCE (smpboot_register_percpu_thread (&rcu_cpu_thread_spec),"%s: Could not start rcuc kthread, OOM is now expected behavior\n" , __func__);
Signature · 1 line
2.25.1
Paul E. McKenney
maintainerQuoted 6 lines · Zqiang
In non-RT kernel, if the
RCU_BOOSTis enabled, the per-cpu rcuc kthread will be created, however under the rcutree.use_softirq=1, the RCU core processing only in softirq context, the rcuc kthread doesn't do anything, so removeRCU_BOOSTinterference.Signed-off-by Zqiang <[email protected]>
Looks sane to me, but adding Sebastian on CC for his thoughts.
Thanx, Paul
Quoted 20 lines
--- kernel/rcu/tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/rcu/tree.c +1
-1@@ -2902,7 +2902,7 @@ static int __init rcu_spawn_core_kthreads(void)for_each_possible_cpu (cpu)per_cpu (rcu_data.rcu_cpu_has_work, cpu) =0 ; -if (!IS_ENABLED (CONFIG_RCU_BOOST ) && use_softirq) +if (use_softirq)return 0 ;WARN_ONCE (smpboot_register_percpu_thread (&rcu_cpu_thread_spec),"%s: Could not start rcuc kthread, OOM is now expected behavior\n" , __func__);Signature · 1 line
2.25.1
Sebastian Andrzej Siewior
Acked-byQuoted 9 lines · Paul E. McKenney
Quoted 6 lines · Zqiang
In non-RT kernel, if the
RCU_BOOSTis enabled, the per-cpu rcuc kthread will be created, however under the rcutree.use_softirq=1, the RCU core processing only in softirq context, the rcuc kthread doesn't do anything, so removeRCU_BOOSTinterference.Signed-off-by Zqiang <[email protected]>Looks sane to me, but adding Sebastian on CC for his thoughts.
Yes, it makes sense. invoke_rcu_core_kthread() is only invoked for !use_softirq so it makes to create the threads based on this condition.
Quoted 1 line
Thanx, Paul
Sebastian
Quoted 7 lines · Sebastian Andrzej Siewior
Quoted 6 lines · Paul E. McKenney
Quoted 5 lines · Zqiang
In non-RT kernel, if the
RCU_BOOSTis enabled, the per-cpu rcuc kthread will be created, however under the rcutree.use_softirq=1, the RCU core processing only in softirq context, the rcuc kthread doesn't do anything, so removeRCU_BOOSTinterference.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Zqiang <[email protected]>Looks sane to me, but adding Sebastian on CC for his thoughts.
Yes, it makes sense.
invoke_rcu_core_kthread()is only invoked for !use_softirq so it makes to create the threads based on this condition.
Thank you both! As usual, I could not resist a bit of wordsmithing, please see below.
Thanx, Paul
------------------------------------------------------------------------
commit 6e68b781388cfaca95a07493a060c4a6e4ee5d0f
Author: Zqiang <[email protected]> Date: Wed Dec 29 00:05:10 2021 +0800
rcu: Create per-cpu rcuc kthreads only when rcutree.use_softirq=0
The per-CPU "rcuc" kthreads are used only by kernels booted with rcutree.use_softirq=0, but they are nevertheless unconditionally created by kernels built with CONFIG_RCU_BOOST=y. This results in "rcuc" kthreads being created that are never actually used. This commit therefore refrains from creating these kthreads unless the kernel is actually booted with rcutree.use_softirq=0.
kernel/rcu/tree.c +1 -1
@@ -2903,7 +2903,7 @@ static int __init rcu_spawn_core_kthreads(void)for_each_possible_cpu (cpu)per_cpu (rcu_data.rcu_cpu_has_work, cpu) =0 ; -if (!IS_ENABLED (CONFIG_RCU_BOOST ) && use_softirq) +if (use_softirq)return 0 ;WARN_ONCE (smpboot_register_percpu_thread (&rcu_cpu_thread_spec),"%s: Could not start rcuc kthread, OOM is now expected behavior\n" , __func__);
Quoted 7 lines · Sebastian Andrzej Siewior
Quoted 6 lines · Paul E. McKenney
Quoted 5 lines · Zqiang
In non-RT kernel, if the
RCU_BOOSTis enabled, the per-cpu rcuc kthread will be created, however under the rcutree.use_softirq=1, the RCU core processing only in softirq context, the rcuc kthread doesn't do anything, so removeRCU_BOOSTinterference.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Zqiang <[email protected]>Looks sane to me, but adding Sebastian on CC for his thoughts.
Yes, it makes sense.
invoke_rcu_core_kthread()is only invoked for !use_softirq so it makes to create the threads based on this condition.
Thanks Sebastian review.
Quoted 1 line
Thank you both! As usual, I could not resist a bit of wordsmithing, please see below.
Hi Paul , thank you for your modification, your description is clearer.
Thanks,
Zqiang
Quoted 34 lines
Thanx, Paul
------------------------------------------------------------------------
commit
6e68b781388cfaca95a07493a060c4a6e4ee5d0fAuthor: Zqiang <[email protected]> Date: Wed Dec 29 00:05:10 2021 +0800rcu: Create per-cpu rcuc kthreads only when rcutree.use_softirq=0
The per-CPU "rcuc" kthreads are used only by kernels booted with rcutree.use_softirq=0, but they are nevertheless unconditionally created by kernels built with
CONFIG_RCU_BOOST=y. This results in "rcuc" kthreads being created that are never actually used. This commit therefore refrains from creating these kthreads unless the kernel is actually booted with rcutree.use_softirq=0.Signed-off-by Zqiang <[email protected]>Signed-off-by Paul E. McKenney <[email protected]>kernel/rcu/tree.c +1
-1@@ -2903,7 +2903,7 @@ static int __init rcu_spawn_core_kthreads(void)for_each_possible_cpu (cpu)per_cpu (rcu_data.rcu_cpu_has_work, cpu) =0 ; -if (!IS_ENABLED (CONFIG_RCU_BOOST ) && use_softirq) +if (use_softirq)return 0 ;WARN_ONCE (smpboot_register_percpu_thread (&rcu_cpu_thread_spec),"%s: Could not start rcuc kthread, OOM is now expected behavior\n" , __func__);