[PATCH v3 17/22] thread_info: Mark the thread flag helpers notrace
From: Song Liu
Date: Mon Nov 30 2026 - 23:27:28 EST
set_ti_thread_flag(), clear_ti_thread_flag() and the other thread flag
helpers are plain inline functions. Some idle code uses them while RCU
is not watching: snooze_loop() on pseries is a cpuidle state without
CPUIDLE_FLAG_RCU_IDLE, so it runs after cpuidle_enter_state() has called
ct_cpuidle_enter(), and it sets and clears TIF_POLLING_NRFLAG. With
clang, a powerpc ppc64le_defconfig build has out-of-line copies of
set_ti_thread_flag() and clear_ti_thread_flag(), called from
snooze_loop(). The copies are untraced only because inline implies
notrace.
Mark the thread flag helpers notrace explicitly. No functional change.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Song Liu <song@xxxxxxxxxx>
---
include/linux/thread_info.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h
index 307b8390fc67..e62633233cad 100644
--- a/include/linux/thread_info.h
+++ b/include/linux/thread_info.h
@@ -99,17 +99,17 @@ static inline long set_restart_fn(struct restart_block *restart,
* - pass TIF_xxxx constants to these functions
*/
-static inline void set_ti_thread_flag(struct thread_info *ti, int flag)
+static inline notrace void set_ti_thread_flag(struct thread_info *ti, int flag)
{
set_bit(flag, (unsigned long *)&ti->flags);
}
-static inline void clear_ti_thread_flag(struct thread_info *ti, int flag)
+static inline notrace void clear_ti_thread_flag(struct thread_info *ti, int flag)
{
clear_bit(flag, (unsigned long *)&ti->flags);
}
-static inline void update_ti_thread_flag(struct thread_info *ti, int flag,
+static inline notrace void update_ti_thread_flag(struct thread_info *ti, int flag,
bool value)
{
if (value)
@@ -118,17 +118,17 @@ static inline void update_ti_thread_flag(struct thread_info *ti, int flag,
clear_ti_thread_flag(ti, flag);
}
-static inline int test_and_set_ti_thread_flag(struct thread_info *ti, int flag)
+static inline notrace int test_and_set_ti_thread_flag(struct thread_info *ti, int flag)
{
return test_and_set_bit(flag, (unsigned long *)&ti->flags);
}
-static inline int test_and_clear_ti_thread_flag(struct thread_info *ti, int flag)
+static inline notrace int test_and_clear_ti_thread_flag(struct thread_info *ti, int flag)
{
return test_and_clear_bit(flag, (unsigned long *)&ti->flags);
}
-static inline int test_ti_thread_flag(struct thread_info *ti, int flag)
+static inline notrace int test_ti_thread_flag(struct thread_info *ti, int flag)
{
return test_bit(flag, (unsigned long *)&ti->flags);
}
--
2.53.1-Meta