diff mbox series

[v4,17/30] sched/clock, x86: Mark __sched_clock_stable key as allowed in .noinstr

Message ID 20250114175143.81438-18-vschneid@redhat.com (mailing list archive)
State Handled Elsewhere
Headers show
Series context_tracking,x86: Defer some IPIs until a user->kernel transition | expand

Checks

Context Check Description
conchuod/vmtest-for-next-PR fail PR summary
conchuod/patch-17-test-1 success .github/scripts/patches/tests/build_rv32_defconfig.sh took 139.68s
conchuod/patch-17-test-2 fail .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh took 1007.10s
conchuod/patch-17-test-3 fail .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh took 1231.01s
conchuod/patch-17-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh took 21.17s
conchuod/patch-17-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh took 23.23s
conchuod/patch-17-test-6 success .github/scripts/patches/tests/checkpatch.sh took 0.47s
conchuod/patch-17-test-7 success .github/scripts/patches/tests/dtb_warn_rv64.sh took 44.52s
conchuod/patch-17-test-8 success .github/scripts/patches/tests/header_inline.sh took 0.01s
conchuod/patch-17-test-9 success .github/scripts/patches/tests/kdoc.sh took 0.54s
conchuod/patch-17-test-10 success .github/scripts/patches/tests/module_param.sh took 0.01s
conchuod/patch-17-test-11 success .github/scripts/patches/tests/verify_fixes.sh took 0.00s
conchuod/patch-17-test-12 success .github/scripts/patches/tests/verify_signedoff.sh took 0.04s

Commit Message

Valentin Schneider Jan. 14, 2025, 5:51 p.m. UTC
Later commits will cause objtool to warn about static keys being used in
.noinstr sections in order to safely defer instruction patching IPIs
targeted at NOHZ_FULL CPUs.

__sched_clock_stable is used in .noinstr code, and can be modified at
runtime (e.g. time_cpufreq_notifier()). Suppressing the text_poke_sync()
IPI has little benefits for this key, as NOHZ_FULL is incompatible with an
unstable TSC anyway.

Mark it to let objtool know not to warn about it.

Signed-off-by: Valentin Schneider <vschneid@redhat.com>
---
 kernel/sched/clock.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/kernel/sched/clock.c b/kernel/sched/clock.c
index 200e5568b9894..e59986bc14a43 100644
--- a/kernel/sched/clock.c
+++ b/kernel/sched/clock.c
@@ -75,8 +75,11 @@  static DEFINE_STATIC_KEY_FALSE_RO(sched_clock_running);
  *
  * Similarly we start with __sched_clock_stable_early, thereby assuming we
  * will become stable, such that there's only a single 1 -> 0 transition.
+ *
+ * Allowed in .noinstr as an unstable TLC is incompatible with NOHZ_FULL,
+ * thus the text patching IPI would be the least of our concerns.
  */
-static DEFINE_STATIC_KEY_FALSE(__sched_clock_stable);
+static DEFINE_STATIC_KEY_FALSE_NOINSTR(__sched_clock_stable);
 static int __sched_clock_stable_early = 1;
 
 /*