]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
refscale: Allow refscale without RCU Tasks Rude/Trace
authorPaul E. McKenney <paulmck@kernel.org>
Fri, 25 Mar 2022 22:21:07 +0000 (15:21 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Wed, 20 Apr 2022 23:53:19 +0000 (16:53 -0700)
Currently, a CONFIG_PREEMPT_NONE=y kernel substitutes normal RCU for
RCU Tasks Rude and RCU Tasks Trace.  Unless that kernel builds refscale,
whether built-in or as a module, in which case these RCU Tasks flavors are
(unnecessarily) built in.  This both increases kernel size and increases
the complexity of certain tracing operations.  This commit therefore
decouples the presence of refscale from the presence of RCU Tasks Rude
and RCU Tasks Trace.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/Kconfig.debug
kernel/rcu/refscale.c
tools/testing/selftests/rcutorture/configs/refscale/CFcommon

index 454924e03ef3818550cfa3674aa3c1aa0541391f..dceaa3e754e5f01cb4d2468f273500834bd7b3e1 100644 (file)
@@ -63,8 +63,6 @@ config RCU_REF_SCALE_TEST
        depends on DEBUG_KERNEL
        select TORTURE_TEST
        select SRCU
-       select TASKS_RUDE_RCU
-       select TASKS_TRACE_RCU
        default n
        help
          This option provides a kernel module that runs performance tests
index 5079e47b3d1899a708a32ff1e1320c3c14d09c8a..909644abee67fc72a47566c063e1f7493c0bbf95 100644 (file)
@@ -242,6 +242,8 @@ static struct ref_scale_ops rcu_tasks_ops = {
 
 #endif // #else // #ifdef CONFIG_TASKS_RCU
 
+#ifdef CONFIG_TASKS_TRACE_RCU
+
 // Definitions for RCU Tasks Trace ref scale testing.
 static void rcu_trace_ref_scale_read_section(const int nloops)
 {
@@ -271,6 +273,14 @@ static struct ref_scale_ops rcu_trace_ops = {
        .name           = "rcu-trace"
 };
 
+#define RCU_TRACE_OPS &rcu_trace_ops,
+
+#else // #ifdef CONFIG_TASKS_TRACE_RCU
+
+#define RCU_TRACE_OPS
+
+#endif // #else // #ifdef CONFIG_TASKS_TRACE_RCU
+
 // Definitions for reference count
 static atomic_t refcnt;
 
@@ -800,7 +810,7 @@ ref_scale_init(void)
        long i;
        int firsterr = 0;
        static struct ref_scale_ops *scale_ops[] = {
-               &rcu_ops, &srcu_ops, &rcu_trace_ops, RCU_TASKS_OPS &refcnt_ops, &rwlock_ops,
+               &rcu_ops, &srcu_ops, RCU_TRACE_OPS RCU_TASKS_OPS &refcnt_ops, &rwlock_ops,
                &rwsem_ops, &lock_ops, &lock_irq_ops, &acqrel_ops, &clock_ops,
        };
 
index 14fdafc576ce48dfec7d54f2698c18cd3250b5bf..fbea3b13baba414d11fbb4514cb20b397d42b523 100644 (file)
@@ -2,3 +2,5 @@ CONFIG_RCU_REF_SCALE_TEST=y
 CONFIG_PRINTK_TIME=y
 CONFIG_FORCE_TASKS_RCU=y
 #CHECK#CONFIG_TASKS_RCU=y
+CONFIG_FORCE_TASKS_TRACE_RCU=y
+#CHECK#CONFIG_TASKS_TRACE_RCU=y