From: Peter Zijlstra <peterz@infradead.org>
To: peterz@infradead.org
Cc: juri.lelli@redhat.com, rafael@kernel.org,
catalin.marinas@arm.com, linus.walleij@linaro.org,
bsegall@google.com, guoren@kernel.org, pavel@ucw.cz,
agordeev@linux.ibm.com, linux-arch@vger.kernel.org,
vincent.guittot@linaro.org, mpe@ellerman.id.au,
chenhuacai@kernel.org, christophe.leroy@csgroup.eu,
linux-acpi@vger.kernel.org, agross@kernel.org,
geert@linux-m68k.org, linux-imx@nxp.com, vgupta@kernel.org,
mattst88@gmail.com, mturquette@baylibre.com, sammy@sammy.net,
pmladek@suse.com, linux-pm@vger.kernel.org,
Sascha Hauer <s.hauer@pengutronix.de>,
linux-um@lists.infradead.org, npiggin@gmail.com,
tglx@linutronix.de, linux-omap@vger.kernel.org,
dietmar.eggemann@arm.com, andreyknvl@gmail.com,
gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
linux-perf-users@vger.kernel.org, senozhatsky@chromium.org,
svens@linux.ibm.com, jolsa@kernel.org, tj@kernel.org,
Andrew Morton <a>
Subject: [PATCH v2 27/44] cpuidle, sched: Remove annotations from TIF_{POLLING_NRFLAG, NEED_RESCHED}
Date: Mon, 19 Sep 2022 12:00:06 +0200 [thread overview]
Message-ID: <20220919101522.156951075@infradead.org> (raw)
In-Reply-To: 20220919095939.761690562@infradead.org
vmlinux.o: warning: objtool: mwait_idle+0x5: call to current_set_polling_and_test() leaves .noinstr.text section
vmlinux.o: warning: objtool: acpi_processor_ffh_cstate_enter+0xc5: call to current_set_polling_and_test() leaves .noinstr.text section
vmlinux.o: warning: objtool: cpu_idle_poll.isra.0+0x73: call to test_ti_thread_flag() leaves .noinstr.text section
vmlinux.o: warning: objtool: intel_idle+0xbc: call to current_set_polling_and_test() leaves .noinstr.text section
vmlinux.o: warning: objtool: intel_idle_irq+0xea: call to current_set_polling_and_test() leaves .noinstr.text section
vmlinux.o: warning: objtool: intel_idle_s2idle+0xb4: call to current_set_polling_and_test() leaves .noinstr.text section
vmlinux.o: warning: objtool: intel_idle+0xa6: call to current_clr_polling() leaves .noinstr.text section
vmlinux.o: warning: objtool: intel_idle_irq+0xbf: call to current_clr_polling() leaves .noinstr.text section
vmlinux.o: warning: objtool: intel_idle_s2idle+0xa1: call to current_clr_polling() leaves .noinstr.text section
vmlinux.o: warning: objtool: mwait_idle+0xe: call to __current_set_polling() leaves .noinstr.text section
vmlinux.o: warning: objtool: acpi_processor_ffh_cstate_enter+0xc5: call to __current_set_polling() leaves .noinstr.text section
vmlinux.o: warning: objtool: cpu_idle_poll.isra.0+0x73: call to test_ti_thread_flag() leaves .noinstr.text section
vmlinux.o: warning: objtool: intel_idle+0xbc: call to __current_set_polling() leaves .noinstr.text section
vmlinux.o: warning: objtool: intel_idle_irq+0xea: call to __current_set_polling() leaves .noinstr.text section
vmlinux.o: warning: objtool: intel_idle_s2idle+0xb4: call to __current_set_polling() leaves .noinstr.text section
vmlinux.o: warning: objtool: cpu_idle_poll.isra.0+0x73: call to test_ti_thread_flag() leaves .noinstr.text section
vmlinux.o: warning: objtool: intel_idle_s2idle+0x73: call to test_ti_thread_flag.constprop.0() leaves .noinstr.text section
vmlinux.o: warning: objtool: intel_idle_irq+0x91: call to test_ti_thread_flag.constprop.0() leaves .noinstr.text section
vmlinux.o: warning: objtool: intel_idle+0x78: call to test_ti_thread_flag.constprop.0() leaves .noinstr.text section
vmlinux.o: warning: objtool: acpi_safe_halt+0xf: call to test_ti_thread_flag.constprop.0() leaves .noinstr.text section
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
include/linux/sched/idle.h | 40 ++++++++++++++++++++++++++++++----------
include/linux/thread_info.h | 18 +++++++++++++++++-
2 files changed, 47 insertions(+), 11 deletions(-)
--- a/include/linux/sched/idle.h
+++ b/include/linux/sched/idle.h
@@ -23,12 +23,37 @@ static inline void wake_up_if_idle(int c
*/
#ifdef TIF_POLLING_NRFLAG
-static inline void __current_set_polling(void)
+#ifdef _ASM_GENERIC_BITOPS_INSTRUMENTED_ATOMIC_H
+
+static __always_inline void __current_set_polling(void)
{
- set_thread_flag(TIF_POLLING_NRFLAG);
+ arch_set_bit(TIF_POLLING_NRFLAG,
+ (unsigned long *)(¤t_thread_info()->flags));
}
-static inline bool __must_check current_set_polling_and_test(void)
+static __always_inline void __current_clr_polling(void)
+{
+ arch_clear_bit(TIF_POLLING_NRFLAG,
+ (unsigned long *)(¤t_thread_info()->flags));
+}
+
+#else
+
+static __always_inline void __current_set_polling(void)
+{
+ set_bit(TIF_POLLING_NRFLAG,
+ (unsigned long *)(¤t_thread_info()->flags));
+}
+
+static __always_inline void __current_clr_polling(void)
+{
+ clear_bit(TIF_POLLING_NRFLAG,
+ (unsigned long *)(¤t_thread_info()->flags));
+}
+
+#endif /* _ASM_GENERIC_BITOPS_INSTRUMENTED_ATOMIC_H */
+
+static __always_inline bool __must_check current_set_polling_and_test(void)
{
__current_set_polling();
@@ -41,12 +66,7 @@ static inline bool __must_check current_
return unlikely(tif_need_resched());
}
-static inline void __current_clr_polling(void)
-{
- clear_thread_flag(TIF_POLLING_NRFLAG);
-}
-
-static inline bool __must_check current_clr_polling_and_test(void)
+static __always_inline bool __must_check current_clr_polling_and_test(void)
{
__current_clr_polling();
@@ -73,7 +93,7 @@ static inline bool __must_check current_
}
#endif
-static inline void current_clr_polling(void)
+static __always_inline void current_clr_polling(void)
{
__current_clr_polling();
--- a/include/linux/thread_info.h
+++ b/include/linux/thread_info.h
@@ -177,7 +177,23 @@ static __always_inline unsigned long rea
clear_ti_thread_flag(task_thread_info(t), TIF_##fl)
#endif /* !CONFIG_GENERIC_ENTRY */
-#define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED)
+#ifdef _ASM_GENERIC_BITOPS_INSTRUMENTED_NON_ATOMIC_H
+
+static __always_inline bool tif_need_resched(void)
+{
+ return arch_test_bit(TIF_NEED_RESCHED,
+ (unsigned long *)(¤t_thread_info()->flags));
+}
+
+#else
+
+static __always_inline bool tif_need_resched(void)
+{
+ return test_bit(TIF_NEED_RESCHED,
+ (unsigned long *)(¤t_thread_info()->flags));
+}
+
+#endif /* _ASM_GENERIC_BITOPS_INSTRUMENTED_NON_ATOMIC_H */
#ifndef CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES
static inline int arch_within_stack_frames(const void * const stack,
next prev parent reply other threads:[~2022-09-19 10:00 UTC|newest]
Thread overview: 88+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-19 9:59 [PATCH v2 00/44] cpuidle,rcu: Clean up the mess Peter Zijlstra
2022-09-19 9:59 ` [PATCH v2 01/44] x86/perf/amd: Remove tracing from perf_lopwr_cb() Peter Zijlstra
2022-09-19 9:59 ` [PATCH v2 02/44] x86/idle: Replace x86_idle with a static_call Peter Zijlstra
2022-09-19 9:59 ` [PATCH v2 03/44] cpuidle/poll: Ensure IRQ state is invariant Peter Zijlstra
2022-09-19 13:19 ` Frederic Weisbecker
2022-09-20 8:57 ` Peter Zijlstra
2022-09-20 10:43 ` Frederic Weisbecker
2022-09-19 9:59 ` [PATCH v2 04/44] cpuidle: Move IRQ state validation Peter Zijlstra
2022-09-19 9:59 ` [PATCH v2 05/44] cpuidle,riscv: Push RCU-idle into driver Peter Zijlstra
2022-09-19 11:54 ` Anup Patel
2022-09-19 13:46 ` Frederic Weisbecker
2022-09-19 9:59 ` [PATCH v2 06/44] cpuidle,tegra: " Peter Zijlstra
2022-09-19 14:05 ` Frederic Weisbecker
2022-09-19 9:59 ` [PATCH v2 07/44] cpuidle,psci: " Peter Zijlstra
[not found] ` <20220919101520.802976773-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2022-09-19 14:11 ` Frederic Weisbecker
2022-09-21 21:51 ` Kajetan Puchalski
2022-09-22 0:45 ` Guo Ren
2022-09-19 9:59 ` [PATCH v2 08/44] cpuidle,imx6: " Peter Zijlstra
2022-09-19 14:21 ` Frederic Weisbecker
2022-09-19 15:00 ` Peter Zijlstra
2022-09-20 8:58 ` Peter Zijlstra
2022-09-20 9:01 ` Frederic Weisbecker
2022-09-19 14:49 ` Frederic Weisbecker
2022-09-19 15:01 ` Peter Zijlstra
2022-09-19 15:03 ` Peter Zijlstra
2022-09-19 15:17 ` Frederic Weisbecker
2022-09-19 9:59 ` [PATCH v2 09/44] cpuidle,omap3: " Peter Zijlstra
2022-09-19 14:31 ` Frederic Weisbecker
2022-09-19 15:19 ` Peter Zijlstra
2022-09-20 8:39 ` Frederic Weisbecker
2022-09-19 14:43 ` Frederic Weisbecker
2022-09-19 9:59 ` [PATCH v2 10/44] cpuidle,armada: " Peter Zijlstra
2022-09-19 14:39 ` Frederic Weisbecker
2022-09-19 9:59 ` [PATCH v2 11/44] cpuidle,omap4: " Peter Zijlstra
2022-09-20 10:53 ` Frederic Weisbecker
2022-09-19 9:59 ` [PATCH v2 12/44] cpuidle,dt: " Peter Zijlstra
2022-10-04 11:03 ` Ulf Hansson
2022-10-04 11:43 ` Ulf Hansson
2022-11-16 15:29 ` Peter Zijlstra
[not found] ` <Y3UBwYNY15ETUKy9-Nxj+rRp3nVydTX5a5knrm8zTDFooKrT+cvkQGrU6aU0@public.gmane.org>
2022-11-22 16:04 ` Ulf Hansson
2022-09-19 9:59 ` [PATCH v2 13/44] cpuidle: Fix ct_idle_*() usage Peter Zijlstra
2022-09-19 9:59 ` [PATCH v2 14/44] cpuidle,cpu_pm: Remove RCU fiddling from cpu_pm_{enter,exit}() Peter Zijlstra
2022-10-04 11:04 ` [PATCH v2 14/44] cpuidle, cpu_pm: Remove RCU fiddling from cpu_pm_{enter, exit}() Ulf Hansson
2022-09-19 9:59 ` [PATCH v2 15/44] acpi_idle: Remove tracing Peter Zijlstra
2022-09-19 9:59 ` [PATCH v2 16/44] cpuidle: Annotate poll_idle() Peter Zijlstra
2022-09-19 9:59 ` [PATCH v2 17/44] objtool/idle: Validate __cpuidle code as noinstr Peter Zijlstra
2022-09-19 9:59 ` [PATCH v2 18/44] cpuidle, intel_idle: Fix CPUIDLE_FLAG_IRQ_ENABLE *again* Peter Zijlstra
2022-09-19 9:59 ` [PATCH v2 19/44] cpuidle,intel_idle: Fix CPUIDLE_FLAG_INIT_XSTATE Peter Zijlstra
2022-09-19 9:59 ` [PATCH v2 20/44] cpuidle,intel_idle: Fix CPUIDLE_FLAG_IBRS Peter Zijlstra
2022-09-19 10:00 ` [PATCH v2 21/44] arch/idle: Change arch_cpu_idle() IRQ behaviour Peter Zijlstra
2022-09-20 5:08 ` Guo Ren
2022-09-19 10:00 ` [PATCH v2 22/44] x86/tdx: Remove TDX_HCALL_ISSUE_STI Peter Zijlstra
2022-09-19 10:00 ` [PATCH v2 23/44] arm,smp: Remove trace_.*_rcuidle() usage Peter Zijlstra
2022-10-04 11:08 ` Ulf Hansson
2022-09-19 10:00 ` [PATCH v2 24/44] arm64,smp: " Peter Zijlstra
2022-09-19 10:00 ` [PATCH v2 25/44] printk: " Peter Zijlstra
2022-09-20 2:49 ` Sergey Senozhatsky
2022-09-19 10:00 ` [PATCH v2 26/44] time/tick-broadcast: Remove RCU_NONIDLE usage Peter Zijlstra
2022-09-19 10:00 ` Peter Zijlstra [this message]
2022-09-19 10:00 ` [PATCH v2 28/44] cpuidle,mwait: Make noinstr clean Peter Zijlstra
2022-09-19 10:00 ` [PATCH v2 29/44] cpuidle,tdx: Make tdx " Peter Zijlstra
2022-09-19 10:00 ` [PATCH v2 30/44] cpuidle,xenpv: Make more PARAVIRT_XXL " Peter Zijlstra
2022-09-19 10:45 ` Juergen Gross via Virtualization
2022-09-19 10:00 ` [PATCH v2 31/44] cpuidle,nospec: Make " Peter Zijlstra
2022-09-19 10:00 ` [PATCH v2 32/44] cpuidle,acpi: " Peter Zijlstra
2022-09-19 10:00 ` [PATCH v2 33/44] ftrace: WARN on rcuidle Peter Zijlstra
2022-09-26 18:41 ` Steven Rostedt
2022-10-04 17:19 ` Mark Rutland
2022-09-19 10:00 ` [PATCH v2 34/44] cpuidle,omap3: Use WFI for omap3_pm_idle() Peter Zijlstra
2022-09-19 10:00 ` [PATCH v2 35/44] cpuidle,omap3: Push RCU-idle into omap_sram_idle() Peter Zijlstra
2022-09-19 10:00 ` [PATCH v2 36/44] cpuidle, omap4: Push RCU-idle into omap4_enter_lowpower() Peter Zijlstra
2022-09-19 10:00 ` [PATCH v2 37/44] arm,omap2: Use WFI for omap2_pm_idle() Peter Zijlstra
2022-09-27 6:21 ` Tony Lindgren
2022-09-19 10:00 ` [PATCH v2 38/44] cpuidle,powerdomain: Remove trace_.*_rcuidle() Peter Zijlstra
2022-10-04 11:12 ` Ulf Hansson
2022-09-19 10:00 ` [PATCH v2 39/44] cpuidle,clk: " Peter Zijlstra
2022-09-28 18:01 ` Stephen Boyd
2022-10-04 11:09 ` Ulf Hansson
2022-09-19 10:00 ` [PATCH v2 40/44] ubsan: Fix objtool UACCESS warns Peter Zijlstra
2022-09-19 10:00 ` [PATCH v2 41/44] intel_idle: Add force_irq_on module param Peter Zijlstra
2022-09-19 10:00 ` [PATCH v2 42/44] entry, kasan, x86: Disallow overriding mem*() functions Peter Zijlstra
2022-09-19 10:00 ` [PATCH v2 43/44] sched: Always inline __this_cpu_preempt_check() Peter Zijlstra
2022-09-19 10:00 ` [PATCH v2 44/44] arm64,riscv,perf: Remove RCU_NONIDLE() usage Peter Zijlstra
2022-09-19 15:21 ` [PATCH v2 00/44] cpuidle,rcu: Clean up the mess Rafael J. Wysocki
2022-09-20 12:31 ` Frederic Weisbecker
2022-09-20 14:04 ` Peter Zijlstra
2022-09-27 6:31 ` Tony Lindgren
[not found] ` <20220919095939.761690562-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2022-10-04 15:15 ` Ulf Hansson
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=20220919101522.156951075@infradead.org \
--to=peterz@infradead.org \
--cc=agordeev@linux.ibm.com \
--cc=agross@kernel.org \
--cc=andreyknvl@gmail.com \
--cc=bsegall@google.com \
--cc=catalin.marinas@arm.com \
--cc=chenhuacai@kernel.org \
--cc=christophe.leroy@csgroup.eu \
--cc=dietmar.eggemann@arm.com \
--cc=geert@linux-m68k.org \
--cc=gregkh@linuxfoundation.org \
--cc=guoren@kernel.org \
--cc=jolsa@kernel.org \
--cc=juri.lelli@redhat.com \
--cc=linus.walleij@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-um@lists.infradead.org \
--cc=mattst88@gmail.com \
--cc=mpe@ellerman.id.au \
--cc=mturquette@baylibre.com \
--cc=npiggin@gmail.com \
--cc=pavel@ucw.cz \
--cc=pmladek@suse.com \
--cc=rafael@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=sammy@sammy.net \
--cc=senozhatsky@chromium.org \
--cc=svens@linux.ibm.com \
--cc=tglx@linutronix.de \
--cc=tj@kernel.org \
--cc=vgupta@kernel.org \
--cc=vincent.guittot@linaro.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).