rcutorture: Create nocb tasks only for rcu testing and CONFIG_RCU_NOCB_CPU=y kernel
Subsystems (2)
PATCH v4 1/1 rcutorture: Create nocb tasks only for rcu testing and CONFIG_RCU_NOCB_CPU=y kernel
When setting nocbs_nthreads to start rcutorture test with a non-zero value, the nocb tasks will be created and invoke rcu_nocb_cpu_offload/deoffload() to toggle CPU's callback-offload state, but this is meaningless for non-rcu testing or CONFIG_RCU_NOCB_CPU=n kernel create nocb tasks to periodically toggle CPU's callback-offload state and adds unnecessary testing overhead.
This commit therefore add checks for cur_ops types and CONFIG_RCU_NOCB_CPU options when nocbs_nthreads is non-zero to avoid unnecessary nocb task creation.
--- kernel/rcu/rcutorture.c | 6 ++++++ 1 file changed, 6 insertions(+)
kernel/rcu/rcutorture.c +6 -0
@@ -3708,6 +3708,12 @@ rcu_torture_init(void)pr_alert ("rcu-torture: ->fqs NULL and non-zero fqs_duration, fqs disabled.\n" ); fqs_duration =0 ; } +if (nocbs_nthreads !=0 && (cur_ops != &rcu_ops || + !IS_ENABLED (CONFIG_RCU_NOCB_CPU ))) { +pr_alert ("rcu-torture types: %s and CONFIG_RCU_NOCB_CPU=%d, nocb toggle disabled.\n" , + cur_ops->name,IS_ENABLED (CONFIG_RCU_NOCB_CPU )); + nocbs_nthreads =0 ; + }if (cur_ops->init) cur_ops->init ();
Signature · 1 line
2.25.1
Quoted 7 lines · Zqiang
When setting
nocbs_nthreadsto start rcutorture test with a non-zero value, the nocb tasks will be created and invoke rcu_nocb_cpu_offload/deoffload() to toggle CPU's callback-offload state, but this is meaningless for non-rcu testing orCONFIG_RCU_NOCB_CPU=nkernel create nocb tasks to periodically toggle CPU's callback-offload state and adds unnecessary testing overhead.
Quoted 5 lines
This commit therefore add checks for
cur_opstypes andCONFIG_RCU_NOCB_CPUoptions whennocbs_nthreadsis non-zero to avoid unnecessary nocb task creation.Signed-off-by Zqiang <[email protected]>
thanks,
- Joel
Quoted 24 lines
--- kernel/rcu/rcutorture.c | 6 ++++++ 1 file changed, 6 insertions(+)kernel/rcu/rcutorture.c +6
-1@@ -3708,6 +3708,12 @@ rcu_torture_init(void)pr_alert ("rcu-torture: ->fqs NULL and non-zero fqs_duration, fqs disabled.\n" ); fqs_duration =0 ; } +if (nocbs_nthreads !=0 && (cur_ops != &rcu_ops || + !IS_ENABLED (CONFIG_RCU_NOCB_CPU ))) { +pr_alert ("rcu-torture types: %s and CONFIG_RCU_NOCB_CPU=%d, nocb toggle disabled.\n" , + cur_ops->name,IS_ENABLED (CONFIG_RCU_NOCB_CPU )); + nocbs_nthreads =0 ; + }if (cur_ops->init) cur_ops->init (); --2.25.1
Quoted 8 lines · Joel Fernandes
Quoted 7 lines · Zqiang
When setting
nocbs_nthreadsto start rcutorture test with a non-zero value, the nocb tasks will be created and invoke rcu_nocb_cpu_offload/deoffload() to toggle CPU's callback-offload state, but this is meaningless for non-rcu testing orCONFIG_RCU_NOCB_CPU=nkernel create nocb tasks to periodically toggle CPU's callback-offload state and adds unnecessary testing overhead.
Quoted 7 lines
Quoted 5 lines
This commit therefore add checks for
cur_opstypes andCONFIG_RCU_NOCB_CPUoptions whennocbs_nthreadsis non-zero to avoid unnecessary nocb task creation.Signed-off-by Zqiang <[email protected]>Reviewed-by Joel Fernandes (Google) <[email protected]>
Queued and pushed, thank you both!
Note that this loses testing of the offload/de-offload API when there is nothing to offload or de-offload, but that is not necessarily the job of rcutorture. Or if it is the job of rcutorture, perhaps it is a single pair of calls somewhere. And that can certainly be a separate patch.
But perhaps Frederic has an opinion on what testing is needed for this case, and if so where that testing should live.
Thanx, Paul
Quoted 29 lines
thanks,
- Joel
Quoted 24 lines
--- kernel/rcu/rcutorture.c | 6 ++++++ 1 file changed, 6 insertions(+)kernel/rcu/rcutorture.c +6
-1@@ -3708,6 +3708,12 @@ rcu_torture_init(void)pr_alert ("rcu-torture: ->fqs NULL and non-zero fqs_duration, fqs disabled.\n" ); fqs_duration =0 ; } +if (nocbs_nthreads !=0 && (cur_ops != &rcu_ops || + !IS_ENABLED (CONFIG_RCU_NOCB_CPU ))) { +pr_alert ("rcu-torture types: %s and CONFIG_RCU_NOCB_CPU=%d, nocb toggle disabled.\n" , + cur_ops->name,IS_ENABLED (CONFIG_RCU_NOCB_CPU )); + nocbs_nthreads =0 ; + }if (cur_ops->init) cur_ops->init (); --2.25.1