From: "tip-bot2 for Peter Zijlstra" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>, Tony Lindgren <tony@atomide.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Frederic Weisbecker <frederic@kernel.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: sched/core] tracing: WARN on rcuidle
Date: Fri, 13 Jan 2023 12:31:08 -0000 [thread overview]
Message-ID: <167361306830.4906.9126654515923168078.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20230112195541.416110581@infradead.org>
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 408b961146be4c1a776ce285c3c289afab15298a
Gitweb: https://git.kernel.org/tip/408b961146be4c1a776ce285c3c289afab15298a
Author: Peter Zijlstra <peterz@infradead.org>
AuthorDate: Thu, 12 Jan 2023 20:43:48 +01:00
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Fri, 13 Jan 2023 11:48:16 +01:00
tracing: WARN on rcuidle
ARCH_WANTS_NO_INSTR (a superset of CONFIG_GENERIC_ENTRY) disallows any
and all tracing when RCU isn't enabled.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lore.kernel.org/r/20230112195541.416110581@infradead.org
---
include/linux/tracepoint.h | 15 +++++++++++++--
kernel/trace/trace.c | 3 +++
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index 4b33b95..552f80b 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -178,6 +178,17 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
#endif /* CONFIG_HAVE_STATIC_CALL */
/*
+ * ARCH_WANTS_NO_INSTR archs are expected to have sanitized entry and idle
+ * code that disallow any/all tracing/instrumentation when RCU isn't watching.
+ */
+#ifdef CONFIG_ARCH_WANTS_NO_INSTR
+#define RCUIDLE_COND(rcuidle) (rcuidle)
+#else
+/* srcu can't be used from NMI */
+#define RCUIDLE_COND(rcuidle) (rcuidle && in_nmi())
+#endif
+
+/*
* it_func[0] is never NULL because there is at least one element in the array
* when the array itself is non NULL.
*/
@@ -188,8 +199,8 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
if (!(cond)) \
return; \
\
- /* srcu can't be used from NMI */ \
- WARN_ON_ONCE(rcuidle && in_nmi()); \
+ if (WARN_ON_ONCE(RCUIDLE_COND(rcuidle))) \
+ return; \
\
/* keep srcu and sched-rcu usage consistent */ \
preempt_disable_notrace(); \
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index a555a86..54ec159 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -3128,6 +3128,9 @@ void __trace_stack(struct trace_array *tr, unsigned int trace_ctx,
return;
}
+ if (WARN_ON_ONCE(IS_ENABLED(CONFIG_GENERIC_ENTRY)))
+ return;
+
/*
* When an NMI triggers, RCU is enabled via ct_nmi_enter(),
* but if the above rcu_is_watching() failed, then the NMI
next prev parent reply other threads:[~2023-01-13 12:34 UTC|newest]
Thread overview: 117+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-12 19:43 [PATCH v3 00/51] cpuidle,rcu: Clean up the mess Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 01/51] x86/perf/amd: Remove tracing from perf_lopwr_cb() Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 02/51] x86/idle: Replace x86_idle with a static_call Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] x86/idle: Replace 'x86_idle' function pointer " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 03/51] cpuidle/poll: Ensure IRQ state is invariant Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle/poll: Ensure IRQs stay disabled after cpuidle_state::enter() calls tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 04/51] cpuidle: Move IRQ state validation Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 05/51] cpuidle,riscv: Push RCU-idle into driver Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle, riscv: " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 06/51] cpuidle,tegra: " Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle, tegra: " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 07/51] cpuidle,psci: " Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle, psci: " tip-bot2 for Peter Zijlstra
2023-03-07 16:40 ` [PATCH v3 07/51] cpuidle,psci: " Geert Uytterhoeven
2023-03-20 14:56 ` Mark Rutland
2023-01-12 19:43 ` [PATCH v3 08/51] cpuidle,imx6: " Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle, ARM/imx6: " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 09/51] cpuidle,omap3: " Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle, OMAP3: " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 10/51] cpuidle,armada: " Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle, armada: " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 11/51] cpuidle,omap4: " Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle, OMAP4: " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 12/51] cpuidle,dt: " Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle, dt: " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 13/51] cpuidle: Fix ct_idle_*() usage Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 14/51] cpuidle,cpu_pm: Remove RCU fiddling from cpu_pm_{enter,exit}() Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle, cpu_pm: " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 15/51] acpi_idle: Remove tracing Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 16/51] cpuidle: Annotate poll_idle() Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] " tip-bot2 for Peter Zijlstra
2023-01-20 9:56 ` [PATCH v3 16/51] " Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 17/51] objtool/idle: Validate __cpuidle code as noinstr Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 18/51] cpuidle,intel_idle: Fix CPUIDLE_FLAG_IRQ_ENABLE *again* Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle, intel_idle: " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 19/51] cpuidle,intel_idle: Fix CPUIDLE_FLAG_INIT_XSTATE Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle, intel_idle: " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 20/51] cpuidle,intel_idle: Fix CPUIDLE_FLAG_IBRS Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle, intel_idle: " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 21/51] arch/idle: Change arch_cpu_idle() IRQ behaviour Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] arch/idle: Change arch_cpu_idle() behavior: always exit with IRQs disabled tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 22/51] x86/tdx: Remove TDX_HCALL_ISSUE_STI Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 23/51] arm,smp: Remove trace_.*_rcuidle() usage Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] arm, smp: " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 24/51] arm64,smp: " Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] arm64, smp: " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 25/51] printk: " Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 26/51] time/tick-broadcast: Remove RCU_NONIDLE usage Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] time/tick-broadcast: Remove RCU_NONIDLE() usage tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 27/51] cpuidle,sched: Remove annotations from TIF_{POLLING_NRFLAG,NEED_RESCHED} Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle, sched: Remove instrumentation " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 28/51] cpuidle,mwait: Make noinstr clean Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle, mwait: Make the mwait code " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 29/51] cpuidle,tdx: Make tdx " Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle, tdx: Make TDX code " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 30/51] cpuidle,xenpv: Make more PARAVIRT_XXL " Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle, xenpv: " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 31/51] cpuidle,nospec: Make " Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle, nospec: Make mds_idle_clear_cpu_buffers() " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 32/51] cpuidle,acpi: Make " Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle, ACPI: " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 33/51] trace: Remove trace_hardirqs_{on,off}_caller() Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] tracing: " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 34/51] trace: WARN on rcuidle Peter Zijlstra
2023-01-13 12:31 ` tip-bot2 for Peter Zijlstra [this message]
2023-01-12 19:43 ` [PATCH v3 35/51] trace,hardirq: No moar _rcuidle() tracing Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] tracing, hardirq: " tip-bot2 for Peter Zijlstra
2023-01-17 4:24 ` [PATCH v3 35/51] trace,hardirq: " Masami Hiramatsu
2023-01-17 8:53 ` Peter Zijlstra
2023-01-17 9:17 ` [PATCH v4] " Ingo Molnar
2023-01-17 14:31 ` Masami Hiramatsu
2023-01-12 19:43 ` [PATCH v3 36/51] cpuidle,omap3: Use WFI for omap3_pm_idle() Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle, OMAP3: " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 37/51] cpuidle,omap3: Push RCU-idle into omap_sram_idle() Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle, OMAP3: " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 38/51] cpuidle,omap4: Push RCU-idle into omap4_enter_lowpower() Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 39/51] arm,omap2: Use WFI for omap2_pm_idle() Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] arm, OMAP2: " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 40/51] cpuidle,powerdomain: Remove trace_.*_rcuidle() Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle, ARM: OMAP2+: powerdomain: " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 41/51] cpuidle,clk: " Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle, clk: " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 42/51] ubsan: Fix objtool UACCESS warns Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 43/51] intel_idle: Add force_irq_on module param Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 44/51] entry,kasan,x86: Disallow overriding mem*() functions Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] entry, kasan, x86: " tip-bot2 for Peter Zijlstra
2023-01-12 19:43 ` [PATCH v3 45/51] sched: Always inline __this_cpu_preempt_check() Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] sched/core: " tip-bot2 for Peter Zijlstra
2023-01-12 19:44 ` [PATCH v3 46/51] arm64,riscv,perf: Remove RCU_NONIDLE() usage Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] arm64, riscv, perf: " tip-bot2 for Peter Zijlstra
2023-01-12 19:44 ` [PATCH v3 47/51] cpuidle: Ensure ct_cpuidle_enter() is always called from noinstr/__cpuidle Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] " tip-bot2 for Peter Zijlstra
2023-01-12 19:44 ` [PATCH v3 48/51] cpuidle,arch: Mark all ct_cpuidle_enter() callers __cpuidle Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle, arch: " tip-bot2 for Peter Zijlstra
2023-01-12 19:44 ` [PATCH v3 49/51] cpuidle,arch: Mark all regular cpuidle_state::enter methods __cpuidle Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle,arch: Mark all regular cpuidle_state:: Enter " tip-bot2 for Peter Zijlstra
2023-01-12 19:44 ` [PATCH v3 50/51] cpuidle: Comments about noinstr/__cpuidle Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] cpuidle: Add comments about noinstr/__cpuidle usage tip-bot2 for Peter Zijlstra
2023-01-12 19:44 ` [PATCH v3 51/51] context_tracking: Fix noinstr vs KASAN Peter Zijlstra
2023-01-13 12:31 ` [tip: sched/core] " tip-bot2 for Peter Zijlstra
2023-01-13 18:06 ` [PATCH v3 00/51] cpuidle,rcu: Clean up the mess Paul E. McKenney
2023-01-16 16:59 ` Mark Rutland
2023-01-17 10:26 ` Peter Zijlstra
2023-01-17 12:39 ` Sudeep Holla
2023-01-17 13:16 ` Mark Rutland
2023-01-17 14:21 ` Sudeep Holla
2023-01-17 15:35 ` Mark Rutland
2023-01-18 11:38 ` [tip: sched/core] cpuidle, arm64: Fix the ARM64 cpuidle logic tip-bot2 for Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=167361306830.4906.9126654515923168078.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=frederic@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rafael.j.wysocki@intel.com \
--cc=tony@atomide.com \
--cc=ulf.hansson@linaro.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).