rcuscale: Add RCU Tasks Trace
authorPaul E. McKenney <paulmck@kernel.org>
Wed, 9 Sep 2020 19:27:03 +0000 (12:27 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Sat, 7 Nov 2020 01:13:50 +0000 (17:13 -0800)
This commit adds the ability to test performance and scalability of RCU
Tasks Trace updaters.

Reported-by: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/rcuscale.c
tools/testing/selftests/rcutorture/configs/rcuscale/CFcommon
tools/testing/selftests/rcutorture/configs/rcuscale/TRACE01 [new file with mode: 0644]
tools/testing/selftests/rcutorture/configs/rcuscale/TRACE01.boot [new file with mode: 0644]

index 2819b95479af92b45c94072dc8f46369f8add38d..c42f2401c37455b6984adbb20b034a356f7f1495 100644 (file)
@@ -38,6 +38,7 @@
 #include <asm/byteorder.h>
 #include <linux/torture.h>
 #include <linux/vmalloc.h>
+#include <linux/rcupdate_trace.h>
 
 #include "rcu.h"
 
@@ -294,6 +295,35 @@ static struct rcu_scale_ops tasks_ops = {
        .name           = "tasks"
 };
 
+/*
+ * Definitions for RCU-tasks-trace scalability testing.
+ */
+
+static int tasks_trace_scale_read_lock(void)
+{
+       rcu_read_lock_trace();
+       return 0;
+}
+
+static void tasks_trace_scale_read_unlock(int idx)
+{
+       rcu_read_unlock_trace();
+}
+
+static struct rcu_scale_ops tasks_tracing_ops = {
+       .ptype          = RCU_TASKS_FLAVOR,
+       .init           = rcu_sync_scale_init,
+       .readlock       = tasks_trace_scale_read_lock,
+       .readunlock     = tasks_trace_scale_read_unlock,
+       .get_gp_seq     = rcu_no_completed,
+       .gp_diff        = rcu_seq_diff,
+       .async          = call_rcu_tasks_trace,
+       .gp_barrier     = rcu_barrier_tasks_trace,
+       .sync           = synchronize_rcu_tasks_trace,
+       .exp_sync       = synchronize_rcu_tasks_trace,
+       .name           = "tasks-tracing"
+};
+
 static unsigned long rcuscale_seq_diff(unsigned long new, unsigned long old)
 {
        if (!cur_ops->gp_diff)
@@ -754,7 +784,7 @@ rcu_scale_init(void)
        long i;
        int firsterr = 0;
        static struct rcu_scale_ops *scale_ops[] = {
-               &rcu_ops, &srcu_ops, &srcud_ops, &tasks_ops,
+               &rcu_ops, &srcu_ops, &srcud_ops, &tasks_ops, &tasks_tracing_ops
        };
 
        if (!torture_init_begin(scale_type, verbose))
index 87caa0e932c746ef7026e3f0ad2f4e983c1b5d73..90942bb5bebc505940461a38e32cfdb0122c295f 100644 (file)
@@ -1,2 +1,5 @@
 CONFIG_RCU_SCALE_TEST=y
 CONFIG_PRINTK_TIME=y
+CONFIG_TASKS_RCU_GENERIC=y
+CONFIG_TASKS_RCU=y
+CONFIG_TASKS_TRACE_RCU=y
diff --git a/tools/testing/selftests/rcutorture/configs/rcuscale/TRACE01 b/tools/testing/selftests/rcutorture/configs/rcuscale/TRACE01
new file mode 100644 (file)
index 0000000..e6baa2f
--- /dev/null
@@ -0,0 +1,15 @@
+CONFIG_SMP=y
+CONFIG_PREEMPT_NONE=y
+CONFIG_PREEMPT_VOLUNTARY=n
+CONFIG_PREEMPT=n
+CONFIG_HZ_PERIODIC=n
+CONFIG_NO_HZ_IDLE=y
+CONFIG_NO_HZ_FULL=n
+CONFIG_RCU_FAST_NO_HZ=n
+CONFIG_RCU_NOCB_CPU=n
+CONFIG_DEBUG_LOCK_ALLOC=n
+CONFIG_PROVE_LOCKING=n
+CONFIG_RCU_BOOST=n
+CONFIG_DEBUG_OBJECTS_RCU_HEAD=n
+CONFIG_RCU_EXPERT=y
+CONFIG_RCU_TRACE=y
diff --git a/tools/testing/selftests/rcutorture/configs/rcuscale/TRACE01.boot b/tools/testing/selftests/rcutorture/configs/rcuscale/TRACE01.boot
new file mode 100644 (file)
index 0000000..af0aff1
--- /dev/null
@@ -0,0 +1 @@
+rcuscale.scale_type=tasks-tracing