From nobody Mon May 11 02:06:51 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 145E6C433EF for ; Tue, 19 Apr 2022 00:13:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239233AbiDSAPl (ORCPT ); Mon, 18 Apr 2022 20:15:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238582AbiDSAPS (ORCPT ); Mon, 18 Apr 2022 20:15:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46D37635C; Mon, 18 Apr 2022 17:12:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E14AFB81136; Tue, 19 Apr 2022 00:12:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D918C385A1; Tue, 19 Apr 2022 00:12:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650327154; bh=N/2wcv4fSS59b1Qr2OkYx77ELrRFwx2AKbsAhPyTtJI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ESbh2uzKIEpFPSlMhKsElSAlfSZAW1bC23Lvt6RiAN/qgGoWMYj8QVEytkZDhDo7y PQnqdryc30nGXahz6jY/MVqCAP5LVpxugxAljmTWYWmNgDWjVQO9MMaAm+cl3BjJCw VOBVwJux6f+0XvqVkiN1gmR2jYGWvB1TqdAHQvfv30SaQgadGsQpKRy/sh6jpWqtdk +QphEYmYN3OUXOkGrX+Ddfx/UMSoNuXvYySoyCFRyVO4gzkNZowWr1+EtVrO8lEuW2 0wXwx934+E5QAinTDm3V15dfb2G+XxPVLYnZq9zKga8+KfcncfiMoSz/l0S/4OKMW+ ymlMeDhzlRQaQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 3DC085C04BD; Mon, 18 Apr 2022 17:12:34 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, "Paul E. McKenney" , Hyeonggon Yoo <42.hyeyoo@gmail.com> Subject: [PATCH rcu 01/12] rcu: Make TASKS_RUDE_RCU select IRQ_WORK Date: Mon, 18 Apr 2022 17:12:22 -0700 Message-Id: <20220419001233.3950188-1-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20220419001123.GA3949851@paulmck-ThinkPad-P17-Gen-1> References: <20220419001123.GA3949851@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The TASKS_RUDE_RCU does not select IRQ_WORK, which can result in build failures for kernels that do not otherwise select IRQ_WORK. This commit therefore causes the TASKS_RUDE_RCU Kconfig option to select IRQ_WORK. Reported-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Paul E. McKenney --- kernel/rcu/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig index bf8e341e75b4..f559870fbf8b 100644 --- a/kernel/rcu/Kconfig +++ b/kernel/rcu/Kconfig @@ -86,6 +86,7 @@ config TASKS_RCU =20 config TASKS_RUDE_RCU def_bool 0 + select IRQ_WORK help This option enables a task-based RCU implementation that uses only context switch (including preemption) and user-mode --=20 2.31.1.189.g2e36527f23 From nobody Mon May 11 02:06:51 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 372F1C433F5 for ; Tue, 19 Apr 2022 00:13:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239396AbiDSAPp (ORCPT ); Mon, 18 Apr 2022 20:15:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238721AbiDSAPS (ORCPT ); Mon, 18 Apr 2022 20:15:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 451916311; Mon, 18 Apr 2022 17:12:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 01536B81123; Tue, 19 Apr 2022 00:12:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8AC5CC385A8; Tue, 19 Apr 2022 00:12:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650327154; bh=ekqEEHkIZKPJH+WeMu+2eIAZrk4ZMTg5yBKQBCNK+yQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ihCPdbN3zo0cP8d3WEi8YefeEUDMZxLEo9I3SY7xDI112BGXxwNDYgWZezawexwQW cWtOX8xKuMQ/uZYNoiNfMl8QI0S5uirC+YALJxznLOhzf9wNfbZ+WZRssgnrGi9FAU zXggP660QOKKSHvWGfleilR+3OsnproDS7TtJGY5PJJyLVmly0UlGX8lOTiMam0dr8 6AqWr8DfL5qkfNPSlrSYfVV1fAY9e6nPiUsvgfjRMPHMh1/IqGE31CAUCiwrZVg9E3 mAwd0+irKnhl2DugPMe7H1DIHYKo7iE1vLPbnoUJ65LcGfnjHkrJ+2ne+Ce7efkF+Y wgJ6kYoxCL9Rg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 4103D5C04C6; Mon, 18 Apr 2022 17:12:34 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, "Paul E. McKenney" , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Zhouyi Zhou , Andrii Nakryiko , Alexei Starovoitov , Mathieu Desnoyers , Masami Hiramatsu Subject: [PATCH rcu 02/12] rcu: Make the TASKS_RCU Kconfig option be selected Date: Mon, 18 Apr 2022 17:12:23 -0700 Message-Id: <20220419001233.3950188-2-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20220419001123.GA3949851@paulmck-ThinkPad-P17-Gen-1> References: <20220419001123.GA3949851@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Currently, any kernel built with CONFIG_PREEMPTION=3Dy also gets CONFIG_TASKS_RCU=3Dy, which is not helpful to people trying to build preemptible kernels of minimal size. Because CONFIG_TASKS_RCU=3Dy is needed only in kernels doing tracing of one form or another, this commit moves from TASKS_RCU deciding when it should be enabled to the tracing Kconfig options explicitly selecting it. This allows building preemptible kernels without TASKS_RCU, if desired. This commit also updates the SRCU-N and TREE09 rcutorture scenarios in order to avoid Kconfig errors that would otherwise result from CONFIG_TASKS_RCU being selected without its CONFIG_RCU_EXPERT dependency being met. [ paulmck: Apply BPF_SYSCALL feedback from Andrii Nakryiko. ] Reported-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Tested-by: Zhouyi Zhou Cc: Andrii Nakryiko Cc: Alexei Starovoitov Cc: Steven Rostedt Cc: Mathieu Desnoyers Cc: Masami Hiramatsu Signed-off-by: Paul E. McKenney Acked-by: Masami Hiramatsu --- Update SRCU-N and TREE09 to avoid Kconfig errors. Signed-off-by: Paul E. McKenney --- arch/Kconfig | 1 + kernel/bpf/Kconfig | 1 + kernel/rcu/Kconfig | 3 ++- kernel/trace/Kconfig | 1 + tools/testing/selftests/rcutorture/configs/rcu/SRCU-N | 2 ++ tools/testing/selftests/rcutorture/configs/rcu/TREE09 | 2 ++ 6 files changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/Kconfig b/arch/Kconfig index 29b0167c088b..1bf29ce754af 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -35,6 +35,7 @@ config KPROBES depends on MODULES depends on HAVE_KPROBES select KALLSYMS + select TASKS_RCU if PREEMPTION help Kprobes allows you to trap at almost any kernel address and execute a callback function. register_kprobe() establishes diff --git a/kernel/bpf/Kconfig b/kernel/bpf/Kconfig index d56ee177d5f8..2dfe1079f772 100644 --- a/kernel/bpf/Kconfig +++ b/kernel/bpf/Kconfig @@ -27,6 +27,7 @@ config BPF_SYSCALL bool "Enable bpf() system call" select BPF select IRQ_WORK + select TASKS_RCU if PREEMPTION select TASKS_TRACE_RCU select BINARY_PRINTF select NET_SOCK_MSG if NET diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig index f559870fbf8b..4f665ae0cf55 100644 --- a/kernel/rcu/Kconfig +++ b/kernel/rcu/Kconfig @@ -78,7 +78,8 @@ config TASKS_RCU_GENERIC task-based RCU implementations. Not for manual selection. =20 config TASKS_RCU - def_bool PREEMPTION + def_bool 0 + select IRQ_WORK help This option enables a task-based RCU implementation that uses only voluntary context switch (not preemption!), idle, and diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index 2c43e327a619..bf5da6c4e999 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig @@ -144,6 +144,7 @@ config TRACING select BINARY_PRINTF select EVENT_TRACING select TRACE_CLOCK + select TASKS_RCU if PREEMPTION =20 config GENERIC_TRACER bool diff --git a/tools/testing/selftests/rcutorture/configs/rcu/SRCU-N b/tools/= testing/selftests/rcutorture/configs/rcu/SRCU-N index 2da8b49589a0..07f5e0a70ae7 100644 --- a/tools/testing/selftests/rcutorture/configs/rcu/SRCU-N +++ b/tools/testing/selftests/rcutorture/configs/rcu/SRCU-N @@ -6,3 +6,5 @@ CONFIG_PREEMPT_NONE=3Dy CONFIG_PREEMPT_VOLUNTARY=3Dn CONFIG_PREEMPT=3Dn #CHECK#CONFIG_RCU_EXPERT=3Dn +CONFIG_KPROBES=3Dn +CONFIG_FTRACE=3Dn diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TREE09 b/tools/= testing/selftests/rcutorture/configs/rcu/TREE09 index 8523a7515cbf..fc45645bb5f4 100644 --- a/tools/testing/selftests/rcutorture/configs/rcu/TREE09 +++ b/tools/testing/selftests/rcutorture/configs/rcu/TREE09 @@ -13,3 +13,5 @@ CONFIG_DEBUG_LOCK_ALLOC=3Dn CONFIG_RCU_BOOST=3Dn CONFIG_DEBUG_OBJECTS_RCU_HEAD=3Dn #CHECK#CONFIG_RCU_EXPERT=3Dn +CONFIG_KPROBES=3Dn +CONFIG_FTRACE=3Dn --=20 2.31.1.189.g2e36527f23 From nobody Mon May 11 02:06:51 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5954EC4332F for ; Tue, 19 Apr 2022 00:12:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238990AbiDSAPW (ORCPT ); Mon, 18 Apr 2022 20:15:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232748AbiDSAPQ (ORCPT ); Mon, 18 Apr 2022 20:15:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98AD66270; Mon, 18 Apr 2022 17:12:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 236D8612F5; Tue, 19 Apr 2022 00:12:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86F23C385A7; Tue, 19 Apr 2022 00:12:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650327154; bh=/KGm3woPMKoUdRNINf1MyDA2HggsH7OrZ0tAV7uCwSw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XT/2vqa2VhPaXIhKkKkNsaCXxlvLktxWH+gNA7Ymrr7vto8Q2g98KAP+9UMInYX3N ivxIm8b+uuyd8hG8wAdOltHhzWZxymRKEC3DA7RpsSrWOBhjqXJkeCZ81XFocNtXIO UlFxq6ORJk/tJDjC796nRYmmmj9nvSeXwPOcfHNb2GVRLrP8D16B7/ulVXZzb2ZKxY 3BxLnj7X8MyotFF3oQvRu4nB0O26l8CwwD/9kvMXXyCf9B1PKOC+QCpsTbwBXf2ppG b5SjXjcG/hw0rGl6lSWWlH3f1lDHCWCwJbXs2RPvy7iV5oTsD91K1+ujBAMZEB6d5b lFFhEjeZJEWhw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 434FE5C0848; Mon, 18 Apr 2022 17:12:34 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, "Paul E. McKenney" Subject: [PATCH rcu 03/12] rcutorture: Allow rcutorture without RCU Tasks Trace Date: Mon, 18 Apr 2022 17:12:24 -0700 Message-Id: <20220419001233.3950188-3-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20220419001123.GA3949851@paulmck-ThinkPad-P17-Gen-1> References: <20220419001123.GA3949851@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Unless a kernel builds rcutorture, whether built-in or as a module, that kernel is also built with CONFIG_TASKS_TRACE_RCU, whether anything else needs Tasks Trace RCU or not. This unnecessarily increases kernel size. This commit therefore decouples the presence of rcutorture from the presence of RCU Tasks Trace. However, there is a need to select CONFIG_TASKS_TRACE_RCU for testing purposes. Except that casual users must not be bothered with questions -- for them, this needs to be fully automated. There is thus a CONFIG_FORCE_TASKS_TRACE_RCU that selects CONFIG_TASKS_TRACE_RCU, is user-selectable, but which depends on CONFIG_RCU_EXPERT. [ paulmck: Apply kernel test robot feedback. ] Signed-off-by: Paul E. McKenney --- kernel/rcu/Kconfig | 22 ++-- kernel/rcu/Kconfig.debug | 1 - kernel/rcu/rcutorture.c | 101 ++++++++++-------- .../selftests/rcutorture/configs/rcu/TRACE01 | 2 + .../selftests/rcutorture/configs/rcu/TRACE02 | 2 + 5 files changed, 75 insertions(+), 53 deletions(-) diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig index 4f665ae0cf55..2befd328e6a0 100644 --- a/kernel/rcu/Kconfig +++ b/kernel/rcu/Kconfig @@ -95,15 +95,23 @@ config TASKS_RUDE_RCU switches on all online CPUs, including idle ones, so use with caution. =20 -config TASKS_TRACE_RCU - def_bool 0 - select IRQ_WORK +config FORCE_TASKS_TRACE_RCU + bool "Force selection of Tasks Trace RCU" + depends on RCU_EXPERT + select TASKS_TRACE_RCU + default n help This option enables a task-based RCU implementation that uses explicit rcu_read_lock_trace() read-side markers, and allows - these readers to appear in the idle loop as well as on the CPU - hotplug code paths. It can force IPIs on online CPUs, including - idle ones, so use with caution. + these readers to appear in the idle loop as well as on the + CPU hotplug code paths. It can force IPIs on online CPUs, + including idle ones, so use with caution. Not for manual + selection in most cases. + +config TASKS_TRACE_RCU + bool + default n + select IRQ_WORK =20 config RCU_STALL_COMMON def_bool TREE_RCU @@ -227,7 +235,7 @@ config RCU_NOCB_CPU =20 config TASKS_TRACE_RCU_READ_MB bool "Tasks Trace RCU readers use memory barriers in user and idle" - depends on RCU_EXPERT + depends on RCU_EXPERT && TASKS_TRACE_RCU default PREEMPT_RT || NR_CPUS < 8 help Use this option to further reduce the number of IPIs sent diff --git a/kernel/rcu/Kconfig.debug b/kernel/rcu/Kconfig.debug index 4fd64999300f..d7f4bb1c4979 100644 --- a/kernel/rcu/Kconfig.debug +++ b/kernel/rcu/Kconfig.debug @@ -49,7 +49,6 @@ config RCU_TORTURE_TEST select SRCU select TASKS_RCU select TASKS_RUDE_RCU - select TASKS_TRACE_RCU default n help This option provides a kernel module that runs torture tests diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 55d049c39608..7dd3e14ec907 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -737,6 +737,48 @@ static struct rcu_torture_ops busted_srcud_ops =3D { .name =3D "busted_srcud" }; =20 +/* + * Definitions for trivial CONFIG_PREEMPT=3Dn-only torture testing. + * This implementation does not necessarily work well with CPU hotplug. + */ + +static void synchronize_rcu_trivial(void) +{ + int cpu; + + for_each_online_cpu(cpu) { + rcutorture_sched_setaffinity(current->pid, cpumask_of(cpu)); + WARN_ON_ONCE(raw_smp_processor_id() !=3D cpu); + } +} + +static int rcu_torture_read_lock_trivial(void) __acquires(RCU) +{ + preempt_disable(); + return 0; +} + +static void rcu_torture_read_unlock_trivial(int idx) __releases(RCU) +{ + preempt_enable(); +} + +static struct rcu_torture_ops trivial_ops =3D { + .ttype =3D RCU_TRIVIAL_FLAVOR, + .init =3D rcu_sync_torture_init, + .readlock =3D rcu_torture_read_lock_trivial, + .read_delay =3D rcu_read_delay, /* just reuse rcu's version. */ + .readunlock =3D rcu_torture_read_unlock_trivial, + .readlock_held =3D torture_readlock_not_held, + .get_gp_seq =3D rcu_no_completed, + .sync =3D synchronize_rcu_trivial, + .exp_sync =3D synchronize_rcu_trivial, + .fqs =3D NULL, + .stats =3D NULL, + .irq_capable =3D 1, + .name =3D "trivial" +}; + /* * Definitions for RCU-tasks torture testing. */ @@ -780,48 +822,6 @@ static struct rcu_torture_ops tasks_ops =3D { .name =3D "tasks" }; =20 -/* - * Definitions for trivial CONFIG_PREEMPT=3Dn-only torture testing. - * This implementation does not necessarily work well with CPU hotplug. - */ - -static void synchronize_rcu_trivial(void) -{ - int cpu; - - for_each_online_cpu(cpu) { - rcutorture_sched_setaffinity(current->pid, cpumask_of(cpu)); - WARN_ON_ONCE(raw_smp_processor_id() !=3D cpu); - } -} - -static int rcu_torture_read_lock_trivial(void) __acquires(RCU) -{ - preempt_disable(); - return 0; -} - -static void rcu_torture_read_unlock_trivial(int idx) __releases(RCU) -{ - preempt_enable(); -} - -static struct rcu_torture_ops trivial_ops =3D { - .ttype =3D RCU_TRIVIAL_FLAVOR, - .init =3D rcu_sync_torture_init, - .readlock =3D rcu_torture_read_lock_trivial, - .read_delay =3D rcu_read_delay, /* just reuse rcu's version. */ - .readunlock =3D rcu_torture_read_unlock_trivial, - .readlock_held =3D torture_readlock_not_held, - .get_gp_seq =3D rcu_no_completed, - .sync =3D synchronize_rcu_trivial, - .exp_sync =3D synchronize_rcu_trivial, - .fqs =3D NULL, - .stats =3D NULL, - .irq_capable =3D 1, - .name =3D "trivial" -}; - /* * Definitions for rude RCU-tasks torture testing. */ @@ -851,6 +851,8 @@ static struct rcu_torture_ops tasks_rude_ops =3D { .name =3D "tasks-rude" }; =20 +#ifdef CONFIG_TASKS_TRACE_RCU + /* * Definitions for tracing RCU-tasks torture testing. */ @@ -893,6 +895,15 @@ static struct rcu_torture_ops tasks_tracing_ops =3D { .name =3D "tasks-tracing" }; =20 +#define TASKS_TRACING_OPS &tasks_tracing_ops, + +#else // #ifdef CONFIG_TASKS_TRACE_RCU + +#define TASKS_TRACING_OPS + +#endif // #else #ifdef CONFIG_TASKS_TRACE_RCU + + static unsigned long rcutorture_seq_diff(unsigned long new, unsigned long = old) { if (!cur_ops->gp_diff) @@ -3096,9 +3107,9 @@ rcu_torture_init(void) int flags =3D 0; unsigned long gp_seq =3D 0; static struct rcu_torture_ops *torture_ops[] =3D { - &rcu_ops, &rcu_busted_ops, &srcu_ops, &srcud_ops, - &busted_srcud_ops, &tasks_ops, &tasks_rude_ops, - &tasks_tracing_ops, &trivial_ops, + &rcu_ops, &rcu_busted_ops, &srcu_ops, &srcud_ops, &busted_srcud_ops, + &tasks_ops, &tasks_rude_ops, TASKS_TRACING_OPS + &trivial_ops, }; =20 if (!torture_init_begin(torture_type, verbose)) diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TRACE01 b/tools= /testing/selftests/rcutorture/configs/rcu/TRACE01 index e4d74e5fc1d0..0f5605ed1e48 100644 --- a/tools/testing/selftests/rcutorture/configs/rcu/TRACE01 +++ b/tools/testing/selftests/rcutorture/configs/rcu/TRACE01 @@ -7,5 +7,7 @@ CONFIG_PREEMPT=3Dn CONFIG_DEBUG_LOCK_ALLOC=3Dn CONFIG_PROVE_LOCKING=3Dn #CHECK#CONFIG_PROVE_RCU=3Dn +CONFIG_FORCE_TASKS_TRACE_RCU=3Dy +#CHECK#CONFIG_TASKS_TRACE_RCU=3Dy CONFIG_TASKS_TRACE_RCU_READ_MB=3Dy CONFIG_RCU_EXPERT=3Dy diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TRACE02 b/tools= /testing/selftests/rcutorture/configs/rcu/TRACE02 index 77541eeb4e9f..093ea6e8e65c 100644 --- a/tools/testing/selftests/rcutorture/configs/rcu/TRACE02 +++ b/tools/testing/selftests/rcutorture/configs/rcu/TRACE02 @@ -7,5 +7,7 @@ CONFIG_PREEMPT=3Dy CONFIG_DEBUG_LOCK_ALLOC=3Dy CONFIG_PROVE_LOCKING=3Dy #CHECK#CONFIG_PROVE_RCU=3Dy +CONFIG_FORCE_TASKS_TRACE_RCU=3Dy +#CHECK#CONFIG_TASKS_TRACE_RCU=3Dy CONFIG_TASKS_TRACE_RCU_READ_MB=3Dn CONFIG_RCU_EXPERT=3Dy --=20 2.31.1.189.g2e36527f23 From nobody Mon May 11 02:06:51 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0D18C4332F for ; Tue, 19 Apr 2022 00:12:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238842AbiDSAPT (ORCPT ); Mon, 18 Apr 2022 20:15:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236448AbiDSAPQ (ORCPT ); Mon, 18 Apr 2022 20:15:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAF9562C8; Mon, 18 Apr 2022 17:12:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4A61561324; Tue, 19 Apr 2022 00:12:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90780C385AB; Tue, 19 Apr 2022 00:12:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650327154; bh=zt6bmVLyKYLFyGb7VqvGpBkVhR2fKUoDb3crLDBSYcg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fYkUPc5JXAxaIFRHAO7ssBTiQLCZvcYOyjqMt/a+XpNoceZps5boOIqugKQQHGHUe ZLuU3MGquMFXxHjsemSDB5xOju/y4Xek0sKR46hGiVGahJlXnySSJhQVZxm7fa+ggf XxDhQBHRdnWl4eN8w65xtc8khlPILpwiBB9l3BiBV2chbiZGdl3ZkwEsuH7DNQcECb PmO2M/VhLJw6yYDV3dA675g8yW+UBC7pwy8jrtqrIcNNzNumrXt7n2KnzoKheJZaQ+ eY5pUk96AXsnuzgDWKnMQi3a4g55dFDHpy6LRYUi2Q+kdXMwxq4LyxCb42Sb3yUraS aFXDFhJSbKufA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 455645C0A0D; Mon, 18 Apr 2022 17:12:34 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, "Paul E. McKenney" Subject: [PATCH rcu 04/12] rcutorture: Allow rcutorture without RCU Tasks Date: Mon, 18 Apr 2022 17:12:25 -0700 Message-Id: <20220419001233.3950188-4-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20220419001123.GA3949851@paulmck-ThinkPad-P17-Gen-1> References: <20220419001123.GA3949851@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Currently, a CONFIG_PREEMPT_NONE=3Dy kernel substitutes normal RCU for RCU Tasks. Unless that kernel builds rcutorture, whether built-in or as a module, in which case RCU Tasks is (unnecessarily) used. This both increases kernel size and increases the complexity of certain tracing operations. This commit therefore decouples the presence of rcutorture from the presence of RCU Tasks. However, there is a need to select CONFIG_TASKS_RCU for testing purposes. Except that casual users must not be bothered with questions -- for them, this needs to be fully automated. There is thus a CONFIG_FORCE_TASKS_RCU that selects CONFIG_TASKS_RCU, is user-selectable, but which depends on CONFIG_RCU_EXPERT. [ paulmck: Apply kernel test robot feedback. ] Signed-off-by: Paul E. McKenney --- kernel/rcu/Kconfig | 18 +++++++++++++----- kernel/rcu/Kconfig.debug | 1 - kernel/rcu/rcutorture.c | 13 ++++++++++++- .../selftests/rcutorture/configs/rcu/TASKS01 | 1 + .../selftests/rcutorture/configs/rcu/TASKS02 | 3 +++ .../selftests/rcutorture/configs/rcu/TASKS03 | 2 ++ 6 files changed, 31 insertions(+), 7 deletions(-) diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig index 2befd328e6a0..8eac165db09f 100644 --- a/kernel/rcu/Kconfig +++ b/kernel/rcu/Kconfig @@ -77,13 +77,21 @@ config TASKS_RCU_GENERIC This option enables generic infrastructure code supporting task-based RCU implementations. Not for manual selection. =20 +config FORCE_TASKS_RCU + bool "Force selection of TASKS_RCU" + depends on RCU_EXPERT + select TASKS_RCU + default n + help + This option force-enables a task-based RCU implementation + that uses only voluntary context switch (not preemption!), + idle, and user-mode execution as quiescent states. Not for + manual selection in most cases. + config TASKS_RCU - def_bool 0 + bool + default n select IRQ_WORK - help - This option enables a task-based RCU implementation that uses - only voluntary context switch (not preemption!), idle, and - user-mode execution as quiescent states. Not for manual selection. =20 config TASKS_RUDE_RCU def_bool 0 diff --git a/kernel/rcu/Kconfig.debug b/kernel/rcu/Kconfig.debug index d7f4bb1c4979..c217a5e655a4 100644 --- a/kernel/rcu/Kconfig.debug +++ b/kernel/rcu/Kconfig.debug @@ -47,7 +47,6 @@ config RCU_TORTURE_TEST depends on DEBUG_KERNEL select TORTURE_TEST select SRCU - select TASKS_RCU select TASKS_RUDE_RCU default n help diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 7dd3e14ec907..65d045ff9766 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -779,6 +779,8 @@ static struct rcu_torture_ops trivial_ops =3D { .name =3D "trivial" }; =20 +#ifdef CONFIG_TASKS_RCU + /* * Definitions for RCU-tasks torture testing. */ @@ -822,6 +824,15 @@ static struct rcu_torture_ops tasks_ops =3D { .name =3D "tasks" }; =20 +#define TASKS_OPS &tasks_ops, + +#else // #ifdef CONFIG_TASKS_RCU + +#define TASKS_OPS + +#endif // #else #ifdef CONFIG_TASKS_RCU + + /* * Definitions for rude RCU-tasks torture testing. */ @@ -3108,7 +3119,7 @@ rcu_torture_init(void) unsigned long gp_seq =3D 0; static struct rcu_torture_ops *torture_ops[] =3D { &rcu_ops, &rcu_busted_ops, &srcu_ops, &srcud_ops, &busted_srcud_ops, - &tasks_ops, &tasks_rude_ops, TASKS_TRACING_OPS + TASKS_OPS &tasks_rude_ops, TASKS_TRACING_OPS &trivial_ops, }; =20 diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TASKS01 b/tools= /testing/selftests/rcutorture/configs/rcu/TASKS01 index 3ca112444ce7..d84801b9a7ae 100644 --- a/tools/testing/selftests/rcutorture/configs/rcu/TASKS01 +++ b/tools/testing/selftests/rcutorture/configs/rcu/TASKS01 @@ -7,4 +7,5 @@ CONFIG_PREEMPT=3Dy CONFIG_DEBUG_LOCK_ALLOC=3Dy CONFIG_PROVE_LOCKING=3Dy #CHECK#CONFIG_PROVE_RCU=3Dy +CONFIG_TASKS_RCU=3Dy CONFIG_RCU_EXPERT=3Dy diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TASKS02 b/tools= /testing/selftests/rcutorture/configs/rcu/TASKS02 index ad2be91e5ee7..d333b69bc831 100644 --- a/tools/testing/selftests/rcutorture/configs/rcu/TASKS02 +++ b/tools/testing/selftests/rcutorture/configs/rcu/TASKS02 @@ -2,3 +2,6 @@ CONFIG_SMP=3Dn CONFIG_PREEMPT_NONE=3Dy CONFIG_PREEMPT_VOLUNTARY=3Dn CONFIG_PREEMPT=3Dn +#CHECK#CONFIG_TASKS_RCU=3Dy +CONFIG_FORCE_TASKS_RCU=3Dy +CONFIG_RCU_EXPERT=3Dy diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TASKS03 b/tools= /testing/selftests/rcutorture/configs/rcu/TASKS03 index dc02083803ce..dea26c568678 100644 --- a/tools/testing/selftests/rcutorture/configs/rcu/TASKS03 +++ b/tools/testing/selftests/rcutorture/configs/rcu/TASKS03 @@ -7,3 +7,5 @@ CONFIG_HZ_PERIODIC=3Dn CONFIG_NO_HZ_IDLE=3Dn CONFIG_NO_HZ_FULL=3Dy #CHECK#CONFIG_RCU_EXPERT=3Dn +CONFIG_TASKS_RCU=3Dy +CONFIG_RCU_EXPERT=3Dy --=20 2.31.1.189.g2e36527f23 From nobody Mon May 11 02:06:51 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0475C433EF for ; Tue, 19 Apr 2022 00:13:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239300AbiDSAPy (ORCPT ); Mon, 18 Apr 2022 20:15:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238583AbiDSAPS (ORCPT ); Mon, 18 Apr 2022 20:15:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2857C62FC; Mon, 18 Apr 2022 17:12:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DED64B81135; Tue, 19 Apr 2022 00:12:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92B6FC385A9; Tue, 19 Apr 2022 00:12:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650327154; bh=WZmVN7GeHqfeQOk38ep5RPyTvpafwXCMcALoe+PH4zo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WH9H+jMVUBE1sq5R7EFXfqt0MN+i0B7aU1rCCnw3zeOaHI9QRSzeV9EQd14S0Owhd Xw9mtumwT18d7e5FKvlQw9w3aGkQE1f4G6FSyv723yCGMb2ELdsIXBglFvUt7jwj/B qdwV1YqaGkeey7wSEkpkJ1EHbYQH9z4pNIiGd0AnroEPYQVN4WKKOZQAGxwhf+sqQe YZuCjKfScrkRpj2hGMDinjSkstfbmTLvJDDpoE5VM0XSG5Pv471HjisFl5xVVMnhE0 AFV1MsHxKb8JV1xS8ygbyVODlW3Kf/dCTrQeeToCW+Z69Wl4JykvvCroUQ3AWfr9io I+o/T3zDAoKYA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 477625C0A23; Mon, 18 Apr 2022 17:12:34 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, "Paul E. McKenney" Subject: [PATCH rcu 05/12] rcutorture: Allow rcutorture without RCU Tasks Rude Date: Mon, 18 Apr 2022 17:12:26 -0700 Message-Id: <20220419001233.3950188-5-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20220419001123.GA3949851@paulmck-ThinkPad-P17-Gen-1> References: <20220419001123.GA3949851@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Unless a kernel builds rcutorture, whether built-in or as a module, that kernel is also built with CONFIG_TASKS_RUDE_RCU, whether anything else needs Tasks Rude RCU or not. This unnecessarily increases kernel size. This commit therefore decouples the presence of rcutorture from the presence of RCU Tasks Rude. However, there is a need to select CONFIG_TASKS_RUDE_RCU for testing purposes. Except that casual users must not be bothered with questions -- for them, this needs to be fully automated. There is thus a CONFIG_FORCE_TASKS_RUDE_RCU that selects CONFIG_TASKS_RUDE_RCU, is user-selectable, but which depends on CONFIG_RCU_EXPERT. [ paulmck: Apply kernel test robot feedback. ] Signed-off-by: Paul E. McKenney --- kernel/rcu/Kconfig | 21 ++++++++++++------- kernel/rcu/Kconfig.debug | 1 - kernel/rcu/rcutorture.c | 13 +++++++++++- .../selftests/rcutorture/configs/rcu/RUDE01 | 2 ++ 4 files changed, 28 insertions(+), 9 deletions(-) diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig index 8eac165db09f..65d45c00fd1b 100644 --- a/kernel/rcu/Kconfig +++ b/kernel/rcu/Kconfig @@ -93,15 +93,22 @@ config TASKS_RCU default n select IRQ_WORK =20 +config FORCE_TASKS_RUDE_RCU + bool "Force selection of Tasks Rude RCU" + depends on RCU_EXPERT + select TASKS_RUDE_RCU + default n + help + This option force-enables a task-based RCU implementation + that uses only context switch (including preemption) and + user-mode execution as quiescent states. It forces IPIs and + context switches on all online CPUs, including idle ones, + so use with caution. Not for manual selection in most cases. + config TASKS_RUDE_RCU - def_bool 0 + bool + default n select IRQ_WORK - help - This option enables a task-based RCU implementation that uses - only context switch (including preemption) and user-mode - execution as quiescent states. It forces IPIs and context - switches on all online CPUs, including idle ones, so use - with caution. =20 config FORCE_TASKS_TRACE_RCU bool "Force selection of Tasks Trace RCU" diff --git a/kernel/rcu/Kconfig.debug b/kernel/rcu/Kconfig.debug index c217a5e655a4..f4a4468cbf03 100644 --- a/kernel/rcu/Kconfig.debug +++ b/kernel/rcu/Kconfig.debug @@ -47,7 +47,6 @@ config RCU_TORTURE_TEST depends on DEBUG_KERNEL select TORTURE_TEST select SRCU - select TASKS_RUDE_RCU default n help This option provides a kernel module that runs torture tests diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 65d045ff9766..d528245108c2 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -833,6 +833,8 @@ static struct rcu_torture_ops tasks_ops =3D { #endif // #else #ifdef CONFIG_TASKS_RCU =20 =20 +#ifdef CONFIG_TASKS_RUDE_RCU + /* * Definitions for rude RCU-tasks torture testing. */ @@ -862,6 +864,15 @@ static struct rcu_torture_ops tasks_rude_ops =3D { .name =3D "tasks-rude" }; =20 +#define TASKS_RUDE_OPS &tasks_rude_ops, + +#else // #ifdef CONFIG_TASKS_RUDE_RCU + +#define TASKS_RUDE_OPS + +#endif // #else #ifdef CONFIG_TASKS_RUDE_RCU + + #ifdef CONFIG_TASKS_TRACE_RCU =20 /* @@ -3119,7 +3130,7 @@ rcu_torture_init(void) unsigned long gp_seq =3D 0; static struct rcu_torture_ops *torture_ops[] =3D { &rcu_ops, &rcu_busted_ops, &srcu_ops, &srcud_ops, &busted_srcud_ops, - TASKS_OPS &tasks_rude_ops, TASKS_TRACING_OPS + TASKS_OPS TASKS_RUDE_OPS TASKS_TRACING_OPS &trivial_ops, }; =20 diff --git a/tools/testing/selftests/rcutorture/configs/rcu/RUDE01 b/tools/= testing/selftests/rcutorture/configs/rcu/RUDE01 index 7093422050f6..6fd6acb94518 100644 --- a/tools/testing/selftests/rcutorture/configs/rcu/RUDE01 +++ b/tools/testing/selftests/rcutorture/configs/rcu/RUDE01 @@ -8,3 +8,5 @@ CONFIG_DEBUG_LOCK_ALLOC=3Dy CONFIG_PROVE_LOCKING=3Dy #CHECK#CONFIG_PROVE_RCU=3Dy CONFIG_RCU_EXPERT=3Dy +CONFIG_FORCE_TASKS_RUDE_RCU=3Dy +#CHECK#CONFIG_TASKS_RUDE_RCU=3Dy --=20 2.31.1.189.g2e36527f23 From nobody Mon May 11 02:06:51 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F11EAC4332F for ; Tue, 19 Apr 2022 00:12:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239093AbiDSAP0 (ORCPT ); Mon, 18 Apr 2022 20:15:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236839AbiDSAPQ (ORCPT ); Mon, 18 Apr 2022 20:15:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F4AD62DE; Mon, 18 Apr 2022 17:12:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DD9C96130F; Tue, 19 Apr 2022 00:12:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3E7EC385B7; Tue, 19 Apr 2022 00:12:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650327154; bh=ktl3d0UVrZ+mKyl/NcSpjBwlrHyMaeCpOwxysFPt6PE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j5YMTSKszHkU+WOs2SMIJk4/qrH06EoGWpI3QwuTCKPznJdasSqe9mebOKeEbjbvA ePruW3K8aCBF0A4C+cQRZT/XA0z6dm3KuJxVlTWXnKxqwmFcf3lROzUvWLy7nEUZb2 k1CYsnhdoYoNPzMqf14STLkH04d/G1acDMEI8J064jpQUNiz3AZf+eTjLD8pp2kX0a cxPkmSeNkCdT2t/tOrfaBHOBXXrWXXyjIhG2jFsShi5xAprFiXgwHqom/2LeJVK1P7 Y2nk3MtpGLR47H+okgZ2xEPHo6PWOkzuWFYrxckurgSA8MJe2AM9dLYaTjJ6RrexnY j+PREThy00N7A== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 493E65C0B86; Mon, 18 Apr 2022 17:12:34 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, "Paul E. McKenney" Subject: [PATCH rcu 06/12] rcutorture: Add CONFIG_PREEMPT_DYNAMIC=n to TASKS02 scenario Date: Mon, 18 Apr 2022 17:12:27 -0700 Message-Id: <20220419001233.3950188-6-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20220419001123.GA3949851@paulmck-ThinkPad-P17-Gen-1> References: <20220419001123.GA3949851@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Now that CONFIG_PREEMPT_DYNAMIC=3Dy is the default, TASKS02 no longer builds a pure non-preemptible kernel that uses Tiny RCU. This commit therefore fixes this new hole in rcutorture testing by adding CONFIG_PREEMPT_DYNAMIC=3Dn to the TASKS02 rcutorture scenario. Signed-off-by: Paul E. McKenney --- tools/testing/selftests/rcutorture/configs/rcu/TASKS02 | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TASKS02 b/tools= /testing/selftests/rcutorture/configs/rcu/TASKS02 index d333b69bc831..2f9fcffff5ae 100644 --- a/tools/testing/selftests/rcutorture/configs/rcu/TASKS02 +++ b/tools/testing/selftests/rcutorture/configs/rcu/TASKS02 @@ -2,6 +2,7 @@ CONFIG_SMP=3Dn CONFIG_PREEMPT_NONE=3Dy CONFIG_PREEMPT_VOLUNTARY=3Dn CONFIG_PREEMPT=3Dn +CONFIG_PREEMPT_DYNAMIC=3Dn #CHECK#CONFIG_TASKS_RCU=3Dy CONFIG_FORCE_TASKS_RCU=3Dy CONFIG_RCU_EXPERT=3Dy --=20 2.31.1.189.g2e36527f23 From nobody Mon May 11 02:06:51 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F004AC433EF for ; Tue, 19 Apr 2022 00:13:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231394AbiDSAPu (ORCPT ); Mon, 18 Apr 2022 20:15:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238678AbiDSAPS (ORCPT ); Mon, 18 Apr 2022 20:15:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C217562C8; Mon, 18 Apr 2022 17:12:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 833F7B8113A; Tue, 19 Apr 2022 00:12:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E67C1C385B8; Tue, 19 Apr 2022 00:12:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650327155; bh=a/jgEw201k/x9500vftbHutjfS0iPgA2hRuL31Qcr/I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AWqxWA7A2WFAhxXQAa2sHNk+3D9Qj2VauHXePaDYXlq9mqQRH8Cq0ESkr0U+MKupM Zy7mBy8Kt3EcSNAqiM1QKR5wrbjCtHlH+Xh8YXvNy+ipe2/f53YtBHf2LXLdhRK+yr 5DYkA0wXcq6sT/k+FGHScSuAQWqzSkz6dyS5v0oHbVnXmoRIIDTm0a7OSQswP4DTFN Ygziixwb8e/p3DPos4pKHB3+FsdF9cNypKrMiRFR3LFeTqDPTBom2rvNdjCLYUC5rv OkiEFrnKpPZ3xHz8Zd2JMYMGk/Ihv9R1sQAMhpKJJAWTB1DvQDqCRYtAUiJYzXvy/8 goFEQJP6nYONw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 4B3C75C0DFD; Mon, 18 Apr 2022 17:12:34 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, "Paul E. McKenney" Subject: [PATCH rcu 07/12] rcutorture: Allow specifying per-scenario stat_interval Date: Mon, 18 Apr 2022 17:12:28 -0700 Message-Id: <20220419001233.3950188-7-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20220419001123.GA3949851@paulmck-ThinkPad-P17-Gen-1> References: <20220419001123.GA3949851@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The rcutorture test suite makes double use of the rcutorture.stat_interval module parameter. As its name suggests, it controls the frequency of statistics printing, but it also controls the rcu_torture_writer() stall timeout. The current setting of 15 seconds works surprisingly well. However, given that the RCU tasks stall-warning timeout is ten -minutes-, 15 seconds is too short for TASKS02, which runs a non-preemptible kernel on a single CPU. This commit therefore adds checks for per-scenario specification of the rcutorture.stat_interval module parameter. Signed-off-by: Paul E. McKenney --- .../rcutorture/configs/rcu/TASKS02.boot | 1 + .../rcutorture/configs/rcu/ver_functions.sh | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TASKS02.boot b/= tools/testing/selftests/rcutorture/configs/rcu/TASKS02.boot index cd2a188eeb6d..b9b6d67cbc5f 100644 --- a/tools/testing/selftests/rcutorture/configs/rcu/TASKS02.boot +++ b/tools/testing/selftests/rcutorture/configs/rcu/TASKS02.boot @@ -1 +1,2 @@ rcutorture.torture_type=3Dtasks +rcutorture.stat_interval=3D60 diff --git a/tools/testing/selftests/rcutorture/configs/rcu/ver_functions.s= h b/tools/testing/selftests/rcutorture/configs/rcu/ver_functions.sh index effa415f9b92..e2bc99c785e7 100644 --- a/tools/testing/selftests/rcutorture/configs/rcu/ver_functions.sh +++ b/tools/testing/selftests/rcutorture/configs/rcu/ver_functions.sh @@ -9,7 +9,7 @@ =20 # rcutorture_param_n_barrier_cbs bootparam-string # -# Adds n_barrier_cbs rcutorture module parameter to kernels having it. +# Adds n_barrier_cbs rcutorture module parameter if not already specified. rcutorture_param_n_barrier_cbs () { if echo $1 | grep -q "rcutorture\.n_barrier_cbs" then @@ -30,13 +30,25 @@ rcutorture_param_onoff () { fi } =20 +# rcutorture_param_stat_interval bootparam-string +# +# Adds stat_interval rcutorture module parameter if not already specified. +rcutorture_param_stat_interval () { + if echo $1 | grep -q "rcutorture\.stat_interval" + then + : + else + echo rcutorture.stat_interval=3D15 + fi +} + # per_version_boot_params bootparam-string config-file seconds # # Adds per-version torture-module parameters to kernels supporting them. per_version_boot_params () { echo $1 `rcutorture_param_onoff "$1" "$2"` \ `rcutorture_param_n_barrier_cbs "$1"` \ - rcutorture.stat_interval=3D15 \ + `rcutorture_param_stat_interval "$1"` \ rcutorture.shutdown_secs=3D$3 \ rcutorture.test_no_idle_hz=3D1 \ rcutorture.verbose=3D1 --=20 2.31.1.189.g2e36527f23 From nobody Mon May 11 02:06:51 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 989DBC433F5 for ; Tue, 19 Apr 2022 00:13:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239497AbiDSAQB (ORCPT ); Mon, 18 Apr 2022 20:16:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238737AbiDSAPS (ORCPT ); Mon, 18 Apr 2022 20:15:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCB8D635E; Mon, 18 Apr 2022 17:12:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 83A3BB81141; Tue, 19 Apr 2022 00:12:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E211AC385B6; Tue, 19 Apr 2022 00:12:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650327154; bh=qC/8biKRDyHkszmI/BmXVyaSO1zhCekOg4OHImxLUkg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PEquUf0TxJHlL9AY5plQdOlJJAeY1K/0EVhkwLxoYfvL91gP5e2AespyAdSO016Ox 6k2YTbDd7hSmoNIGuB18MIaFyEdy37mbxLrN0+CI56SDv0p3Vtd0extH9gFiLxW+z5 wNavYmx0rqQwX5ybtLzkmiL/rQZq9CLFU4qMQOK8gjs+fZ7yTUBelcR8+Lf/y+xw/4 oODjkRtnIRIKxUCSEmUe5gAADnswhhWv0lwElLwooNcH2LV9QDDU8wQcQgp7Zg83o9 cxwSu0WE9d/uucY3lPJt4DDr8rK9cX0wpjof3vZqZ7ABXvVsY3Mp0R8k8s1HQP0YRW bXJDPsxDzOJrA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 4D15D5C121E; Mon, 18 Apr 2022 17:12:34 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, "Paul E. McKenney" Subject: [PATCH rcu 08/12] refscale: Allow refscale without RCU Tasks Date: Mon, 18 Apr 2022 17:12:29 -0700 Message-Id: <20220419001233.3950188-8-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20220419001123.GA3949851@paulmck-ThinkPad-P17-Gen-1> References: <20220419001123.GA3949851@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Currently, a CONFIG_PREEMPT_NONE=3Dy kernel substitutes normal RCU for RCU Tasks. Unless that kernel builds refscale, whether built-in or as a module, in which case RCU Tasks is (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. Signed-off-by: Paul E. McKenney --- kernel/rcu/Kconfig.debug | 1 - kernel/rcu/refscale.c | 12 +++++++++++- .../selftests/rcutorture/configs/refscale/CFcommon | 2 ++ .../selftests/rcutorture/configs/refscale/NOPREEMPT | 2 ++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/kernel/rcu/Kconfig.debug b/kernel/rcu/Kconfig.debug index f4a4468cbf03..454924e03ef3 100644 --- a/kernel/rcu/Kconfig.debug +++ b/kernel/rcu/Kconfig.debug @@ -63,7 +63,6 @@ config RCU_REF_SCALE_TEST depends on DEBUG_KERNEL select TORTURE_TEST select SRCU - select TASKS_RCU select TASKS_RUDE_RCU select TASKS_TRACE_RCU default n diff --git a/kernel/rcu/refscale.c b/kernel/rcu/refscale.c index 5489ff7f478e..5079e47b3d18 100644 --- a/kernel/rcu/refscale.c +++ b/kernel/rcu/refscale.c @@ -207,6 +207,8 @@ static struct ref_scale_ops srcu_ops =3D { .name =3D "srcu" }; =20 +#ifdef CONFIG_TASKS_RCU + // Definitions for RCU Tasks ref scale testing: Empty read markers. // These definitions also work for RCU Rude readers. static void rcu_tasks_ref_scale_read_section(const int nloops) @@ -232,6 +234,14 @@ static struct ref_scale_ops rcu_tasks_ops =3D { .name =3D "rcu-tasks" }; =20 +#define RCU_TASKS_OPS &rcu_tasks_ops, + +#else // #ifdef CONFIG_TASKS_RCU + +#define RCU_TASKS_OPS + +#endif // #else // #ifdef CONFIG_TASKS_RCU + // Definitions for RCU Tasks Trace ref scale testing. static void rcu_trace_ref_scale_read_section(const int nloops) { @@ -790,7 +800,7 @@ ref_scale_init(void) long i; int firsterr =3D 0; static struct ref_scale_ops *scale_ops[] =3D { - &rcu_ops, &srcu_ops, &rcu_trace_ops, &rcu_tasks_ops, &refcnt_ops, &rwloc= k_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, }; =20 diff --git a/tools/testing/selftests/rcutorture/configs/refscale/CFcommon b= /tools/testing/selftests/rcutorture/configs/refscale/CFcommon index a98b58b54bb1..14fdafc576ce 100644 --- a/tools/testing/selftests/rcutorture/configs/refscale/CFcommon +++ b/tools/testing/selftests/rcutorture/configs/refscale/CFcommon @@ -1,2 +1,4 @@ CONFIG_RCU_REF_SCALE_TEST=3Dy CONFIG_PRINTK_TIME=3Dy +CONFIG_FORCE_TASKS_RCU=3Dy +#CHECK#CONFIG_TASKS_RCU=3Dy diff --git a/tools/testing/selftests/rcutorture/configs/refscale/NOPREEMPT = b/tools/testing/selftests/rcutorture/configs/refscale/NOPREEMPT index 7f06838a91e6..ef2b501a6971 100644 --- a/tools/testing/selftests/rcutorture/configs/refscale/NOPREEMPT +++ b/tools/testing/selftests/rcutorture/configs/refscale/NOPREEMPT @@ -15,3 +15,5 @@ CONFIG_PROVE_LOCKING=3Dn CONFIG_RCU_BOOST=3Dn CONFIG_DEBUG_OBJECTS_RCU_HEAD=3Dn CONFIG_RCU_EXPERT=3Dy +CONFIG_KPROBES=3Dn +CONFIG_FTRACE=3Dn --=20 2.31.1.189.g2e36527f23 From nobody Mon May 11 02:06:51 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3C6AC433EF for ; Tue, 19 Apr 2022 00:12:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239194AbiDSAPe (ORCPT ); Mon, 18 Apr 2022 20:15:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237263AbiDSAPQ (ORCPT ); Mon, 18 Apr 2022 20:15:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8803E62E3; Mon, 18 Apr 2022 17:12:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 19D766132D; Tue, 19 Apr 2022 00:12:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB1E4C385B9; Tue, 19 Apr 2022 00:12:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650327155; bh=VklMWT+mv88bfnM3UygqdURL8zzoO8a57bNgatVnHuI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NbDzbYh7z1qGvyBcXZNWHiOAO+xw+fL9AUgOH+4UpRRNDrIUs7O95mmpf/H/Ims94 xie35a5QAcMv9af1HEyjoMLJXhVcZyB3t5O88fat1+gpEh/Gx2fp3pUuec0rqRY6j1 6GntmkL+XNPYJNIkFfS/TbGVbSdloUhdowpFQ3XJibHh+b/CSyx9suaCvJr3cqI/mI ZQBZRAXXrhjj6aJo3rsD0iYlokeq+jY91U4/b/xpR1Ca5Pij+dwabk1TqNa9vFFvSn Z+Aprd+8TLP7xCg7uUNlAhK4+A2uW1+GqWjNKz1Ct/RKQmShYBFHEslO54mevtN+wZ Sg26LnwcWObpg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 4ECFD5C12AB; Mon, 18 Apr 2022 17:12:34 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, "Paul E. McKenney" Subject: [PATCH rcu 09/12] refscale: Allow refscale without RCU Tasks Rude/Trace Date: Mon, 18 Apr 2022 17:12:30 -0700 Message-Id: <20220419001233.3950188-9-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20220419001123.GA3949851@paulmck-ThinkPad-P17-Gen-1> References: <20220419001123.GA3949851@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Currently, a CONFIG_PREEMPT_NONE=3Dy 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 --- kernel/rcu/Kconfig.debug | 2 -- kernel/rcu/refscale.c | 12 +++++++++++- .../selftests/rcutorture/configs/refscale/CFcommon | 2 ++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/kernel/rcu/Kconfig.debug b/kernel/rcu/Kconfig.debug index 454924e03ef3..dceaa3e754e5 100644 --- a/kernel/rcu/Kconfig.debug +++ b/kernel/rcu/Kconfig.debug @@ -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 diff --git a/kernel/rcu/refscale.c b/kernel/rcu/refscale.c index 5079e47b3d18..909644abee67 100644 --- a/kernel/rcu/refscale.c +++ b/kernel/rcu/refscale.c @@ -242,6 +242,8 @@ static struct ref_scale_ops rcu_tasks_ops =3D { =20 #endif // #else // #ifdef CONFIG_TASKS_RCU =20 +#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 =3D { .name =3D "rcu-trace" }; =20 +#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; =20 @@ -800,7 +810,7 @@ ref_scale_init(void) long i; int firsterr =3D 0; static struct ref_scale_ops *scale_ops[] =3D { - &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_op= s, &rwsem_ops, &lock_ops, &lock_irq_ops, &acqrel_ops, &clock_ops, }; =20 diff --git a/tools/testing/selftests/rcutorture/configs/refscale/CFcommon b= /tools/testing/selftests/rcutorture/configs/refscale/CFcommon index 14fdafc576ce..fbea3b13baba 100644 --- a/tools/testing/selftests/rcutorture/configs/refscale/CFcommon +++ b/tools/testing/selftests/rcutorture/configs/refscale/CFcommon @@ -2,3 +2,5 @@ CONFIG_RCU_REF_SCALE_TEST=3Dy CONFIG_PRINTK_TIME=3Dy CONFIG_FORCE_TASKS_RCU=3Dy #CHECK#CONFIG_TASKS_RCU=3Dy +CONFIG_FORCE_TASKS_TRACE_RCU=3Dy +#CHECK#CONFIG_TASKS_TRACE_RCU=3Dy --=20 2.31.1.189.g2e36527f23 From nobody Mon May 11 02:06:51 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3053C433F5 for ; Tue, 19 Apr 2022 00:13:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239504AbiDSAQO (ORCPT ); Mon, 18 Apr 2022 20:16:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238866AbiDSAPU (ORCPT ); Mon, 18 Apr 2022 20:15:20 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78EA56270; Mon, 18 Apr 2022 17:12:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 231B1B81147; Tue, 19 Apr 2022 00:12:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE153C385BA; Tue, 19 Apr 2022 00:12:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650327155; bh=pqVBJLArsUCu6jcB2vZXpYu39RA6AAzwyfONBnpqGeM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K+a6FyelgvXm4XSTSvvsKNEAISI/hvpvpf6fqb9Ja1vESpQBTNe57Ka4BBsAWm6zp W7Wc6T30VL04QpyZCI0r2v4INuk75Cuvuj5U61/qWlDG69TWsrO/06UDdFXUKchsPz ttKG07hCGQw4mCfJRvBv/ZDNzER30Hr7ohTNu7BqLAflcITW3+ogiyczXV+cAWZKKR z+N+xONAdN2b5o2BOqREltQMxPmU88b8TqhPuIzKRXKLxf8jCXoeZROUof3W5YE7xE 749KjlDzTPB/rxtGJltU7ZlUfJyU39o0OvKW5h2meRvvOQWROQLQN2cLr7BX3lrs2y 8Oul2JHF+wEmg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 508635C1308; Mon, 18 Apr 2022 17:12:34 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, "Paul E. McKenney" Subject: [PATCH rcu 10/12] rcuscale: Allow rcuscale without RCU Tasks Date: Mon, 18 Apr 2022 17:12:31 -0700 Message-Id: <20220419001233.3950188-10-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20220419001123.GA3949851@paulmck-ThinkPad-P17-Gen-1> References: <20220419001123.GA3949851@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Currently, a CONFIG_PREEMPT_NONE=3Dy kernel substitutes normal RCU for RCU Tasks. Unless that kernel builds rcuscale, whether built-in or as a module, in which case RCU Tasks is (unnecessarily) built. This both increases kernel size and increases the complexity of certain tracing operations. This commit therefore decouples the presence of rcuscale from the presence of RCU Tasks. Signed-off-by: Paul E. McKenney --- kernel/rcu/Kconfig.debug | 1 - kernel/rcu/rcuscale.c | 12 +++++++++++- .../selftests/rcutorture/configs/rcuscale/CFcommon | 4 ++-- .../selftests/rcutorture/configs/rcuscale/TREE | 2 ++ 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/kernel/rcu/Kconfig.debug b/kernel/rcu/Kconfig.debug index dceaa3e754e5..71e73fceff87 100644 --- a/kernel/rcu/Kconfig.debug +++ b/kernel/rcu/Kconfig.debug @@ -28,7 +28,6 @@ config RCU_SCALE_TEST depends on DEBUG_KERNEL select TORTURE_TEST select SRCU - select TASKS_RCU select TASKS_RUDE_RCU select TASKS_TRACE_RCU default n diff --git a/kernel/rcu/rcuscale.c b/kernel/rcu/rcuscale.c index 5e4f1f83d38e..311dbcb064ed 100644 --- a/kernel/rcu/rcuscale.c +++ b/kernel/rcu/rcuscale.c @@ -268,6 +268,8 @@ static struct rcu_scale_ops srcud_ops =3D { .name =3D "srcud" }; =20 +#ifdef CONFIG_TASKS_RCU + /* * Definitions for RCU-tasks scalability testing. */ @@ -295,6 +297,14 @@ static struct rcu_scale_ops tasks_ops =3D { .name =3D "tasks" }; =20 +#define TASKS_OPS &tasks_ops, + +#else // #ifdef CONFIG_TASKS_RCU + +#define TASKS_OPS + +#endif // #else // #ifdef CONFIG_TASKS_RCU + /* * Definitions for RCU-tasks-trace scalability testing. */ @@ -797,7 +807,7 @@ rcu_scale_init(void) long i; int firsterr =3D 0; static struct rcu_scale_ops *scale_ops[] =3D { - &rcu_ops, &srcu_ops, &srcud_ops, &tasks_ops, &tasks_tracing_ops + &rcu_ops, &srcu_ops, &srcud_ops, TASKS_OPS &tasks_tracing_ops }; =20 if (!torture_init_begin(scale_type, verbose)) diff --git a/tools/testing/selftests/rcutorture/configs/rcuscale/CFcommon b= /tools/testing/selftests/rcutorture/configs/rcuscale/CFcommon index 90942bb5bebc..2ed3b46a9c37 100644 --- a/tools/testing/selftests/rcutorture/configs/rcuscale/CFcommon +++ b/tools/testing/selftests/rcutorture/configs/rcuscale/CFcommon @@ -1,5 +1,5 @@ CONFIG_RCU_SCALE_TEST=3Dy CONFIG_PRINTK_TIME=3Dy CONFIG_TASKS_RCU_GENERIC=3Dy -CONFIG_TASKS_RCU=3Dy -CONFIG_TASKS_TRACE_RCU=3Dy +CONFIG_FORCE_TASKS_RCU=3Dy +#CHECK#CONFIG_TASKS_RCU=3Dy diff --git a/tools/testing/selftests/rcutorture/configs/rcuscale/TREE b/too= ls/testing/selftests/rcutorture/configs/rcuscale/TREE index f110d9ffbe4c..b10706fd03a4 100644 --- a/tools/testing/selftests/rcutorture/configs/rcuscale/TREE +++ b/tools/testing/selftests/rcutorture/configs/rcuscale/TREE @@ -16,3 +16,5 @@ CONFIG_RCU_BOOST=3Dn CONFIG_DEBUG_OBJECTS_RCU_HEAD=3Dn CONFIG_RCU_EXPERT=3Dy CONFIG_RCU_TRACE=3Dy +CONFIG_KPROBES=3Dn +CONFIG_FTRACE=3Dn --=20 2.31.1.189.g2e36527f23 From nobody Mon May 11 02:06:51 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A5C2C433F5 for ; Tue, 19 Apr 2022 00:13:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239238AbiDSAQJ (ORCPT ); Mon, 18 Apr 2022 20:16:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238867AbiDSAPU (ORCPT ); Mon, 18 Apr 2022 20:15:20 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8364162C8; Mon, 18 Apr 2022 17:12:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 84F42B81142; Tue, 19 Apr 2022 00:12:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2413C385B5; Tue, 19 Apr 2022 00:12:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650327154; bh=rOmY886vFXfAoWPa5wrvJiC006w6SDIbYNHbDT8v048=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R2ocCyTUlhnNb9mhjZVeIueQTwPdrg+Z5+PDPlF85MWbNwIPRbsZttHYWBDjKpVC5 Bqj7Ele6s1bBKxxvoi8Yq9v2WIs5JfYSEHPhvtq5v0TWLGqcIkRIHGvwlwAVBRvuMg CnOVuYYpvR8uLBqJa9qCAC+gTXg7Yfru8yeP5+ALn1owdtIsGsCrk+rLX7ImIO7+AZ DmSWG1GrnV+t39W3tWknF2eiVuq5wqSJPQwz7W3arNII5OKpEh4gICItqXpe8Nglm7 aZC+Z67AfJY9gS6JdGR9H/b/7bNH/rR6119kq8CnJu1OWi2uVS3TBXslBfIGy+AlfK HaCK8pXlUj8Pg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 524B85C1355; Mon, 18 Apr 2022 17:12:34 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, "Paul E. McKenney" Subject: [PATCH rcu 11/12] rcuscale: Allow rcuscale without RCU Tasks Rude/Trace Date: Mon, 18 Apr 2022 17:12:32 -0700 Message-Id: <20220419001233.3950188-11-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20220419001123.GA3949851@paulmck-ThinkPad-P17-Gen-1> References: <20220419001123.GA3949851@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Currently, a CONFIG_PREEMPT_NONE=3Dy kernel substitutes normal RCU for RCU Tasks Rude and RCU Tasks Trace. Unless that kernel builds rcuscale, 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 rcuscale from the presence of RCU Tasks Rude and RCU Tasks Trace. Signed-off-by: Paul E. McKenney --- kernel/rcu/Kconfig.debug | 2 -- kernel/rcu/rcuscale.c | 12 +++++++++++- .../selftests/rcutorture/configs/rcuscale/CFcommon | 3 ++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/kernel/rcu/Kconfig.debug b/kernel/rcu/Kconfig.debug index 71e73fceff87..68092e1db64b 100644 --- a/kernel/rcu/Kconfig.debug +++ b/kernel/rcu/Kconfig.debug @@ -28,8 +28,6 @@ config RCU_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 diff --git a/kernel/rcu/rcuscale.c b/kernel/rcu/rcuscale.c index 311dbcb064ed..277a5bfb37d4 100644 --- a/kernel/rcu/rcuscale.c +++ b/kernel/rcu/rcuscale.c @@ -305,6 +305,8 @@ static struct rcu_scale_ops tasks_ops =3D { =20 #endif // #else // #ifdef CONFIG_TASKS_RCU =20 +#ifdef CONFIG_TASKS_TRACE_RCU + /* * Definitions for RCU-tasks-trace scalability testing. */ @@ -334,6 +336,14 @@ static struct rcu_scale_ops tasks_tracing_ops =3D { .name =3D "tasks-tracing" }; =20 +#define TASKS_TRACING_OPS &tasks_tracing_ops, + +#else // #ifdef CONFIG_TASKS_TRACE_RCU + +#define TASKS_TRACING_OPS + +#endif // #else // #ifdef CONFIG_TASKS_TRACE_RCU + static unsigned long rcuscale_seq_diff(unsigned long new, unsigned long ol= d) { if (!cur_ops->gp_diff) @@ -807,7 +817,7 @@ rcu_scale_init(void) long i; int firsterr =3D 0; static struct rcu_scale_ops *scale_ops[] =3D { - &rcu_ops, &srcu_ops, &srcud_ops, TASKS_OPS &tasks_tracing_ops + &rcu_ops, &srcu_ops, &srcud_ops, TASKS_OPS TASKS_TRACING_OPS }; =20 if (!torture_init_begin(scale_type, verbose)) diff --git a/tools/testing/selftests/rcutorture/configs/rcuscale/CFcommon b= /tools/testing/selftests/rcutorture/configs/rcuscale/CFcommon index 2ed3b46a9c37..6a00157bee5b 100644 --- a/tools/testing/selftests/rcutorture/configs/rcuscale/CFcommon +++ b/tools/testing/selftests/rcutorture/configs/rcuscale/CFcommon @@ -1,5 +1,6 @@ CONFIG_RCU_SCALE_TEST=3Dy CONFIG_PRINTK_TIME=3Dy -CONFIG_TASKS_RCU_GENERIC=3Dy CONFIG_FORCE_TASKS_RCU=3Dy #CHECK#CONFIG_TASKS_RCU=3Dy +CONFIG_FORCE_TASKS_TRACE_RCU=3Dy +#CHECK#CONFIG_TASKS_TRACE_RCU=3Dy --=20 2.31.1.189.g2e36527f23 From nobody Mon May 11 02:06:51 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 212ACC433EF for ; Tue, 19 Apr 2022 00:12:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239215AbiDSAPh (ORCPT ); Mon, 18 Apr 2022 20:15:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238490AbiDSAPR (ORCPT ); Mon, 18 Apr 2022 20:15:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C8B262F2; Mon, 18 Apr 2022 17:12:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 96DD7612F5; Tue, 19 Apr 2022 00:12:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01F71C385BC; Tue, 19 Apr 2022 00:12:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650327155; bh=2rsmoyYg8DaXulWvIo0cGGWC9KNJr2PKGgQmzDpNBpk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gtYjcVnNCmyGf7RM3Wm4fBNIMDVHl5msm1uPyP8Kmw1V4ewhO0ZWTIhCLokbOhTF/ xTx9XIC0+05wozytWwQ6zjd3r1gImZlkUooylnGwYZfdTB01Qt9U0qOVrXifeVMw32 lCaR2EFOpNHmgFR/jXLfOJHaXa00bWWSZyJSNkmuvAzIJAyD6a9xJdZL7xry5ssa/M BsHsFOqFsS4qMEec0okPfbWYKprPnBS3L7rqZHP+9S67jnmGmxJiqUBx64ytErn5ZW gY+UMV+cs6RLEeblVATVD7H8zysgvaZiH5gHc5z5kbK3jrzvhzbvCvzL3ELuT2ySBK 5Bh+ox66UJP6Q== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 540C95C1369; Mon, 18 Apr 2022 17:12:34 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, "Paul E. McKenney" Subject: [PATCH rcu 12/12] scftorture: Adjust for TASKS_RCU Kconfig option being selected Date: Mon, 18 Apr 2022 17:12:33 -0700 Message-Id: <20220419001233.3950188-12-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20220419001123.GA3949851@paulmck-ThinkPad-P17-Gen-1> References: <20220419001123.GA3949851@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This commit adjusts the scftorture PREEMPT and NOPREEMPT scenarios to account for the TASKS_RCU Kconfig option being explicitly selected rather than computed in isolation. Signed-off-by: Paul E. McKenney --- tools/testing/selftests/rcutorture/configs/scf/NOPREEMPT | 2 ++ tools/testing/selftests/rcutorture/configs/scf/PREEMPT | 1 + 2 files changed, 3 insertions(+) diff --git a/tools/testing/selftests/rcutorture/configs/scf/NOPREEMPT b/too= ls/testing/selftests/rcutorture/configs/scf/NOPREEMPT index b8429d6c6ebc..3a59346b3de7 100644 --- a/tools/testing/selftests/rcutorture/configs/scf/NOPREEMPT +++ b/tools/testing/selftests/rcutorture/configs/scf/NOPREEMPT @@ -7,3 +7,5 @@ CONFIG_NO_HZ_IDLE=3Dn CONFIG_NO_HZ_FULL=3Dy CONFIG_DEBUG_LOCK_ALLOC=3Dn CONFIG_PROVE_LOCKING=3Dn +CONFIG_KPROBES=3Dn +CONFIG_FTRACE=3Dn diff --git a/tools/testing/selftests/rcutorture/configs/scf/PREEMPT b/tools= /testing/selftests/rcutorture/configs/scf/PREEMPT index ae4992b141b0..cb37e08037d6 100644 --- a/tools/testing/selftests/rcutorture/configs/scf/PREEMPT +++ b/tools/testing/selftests/rcutorture/configs/scf/PREEMPT @@ -7,3 +7,4 @@ CONFIG_NO_HZ_IDLE=3Dy CONFIG_NO_HZ_FULL=3Dn CONFIG_DEBUG_LOCK_ALLOC=3Dy CONFIG_PROVE_LOCKING=3Dy +CONFIG_RCU_EXPERT=3Dy --=20 2.31.1.189.g2e36527f23