Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rseq: Provide static branch for time slice extensions

Guard the time slice extension functionality with a static key, which can
be disabled on the kernel command line.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20251215155708.733429292@linutronix.de

authored by

Thomas Gleixner and committed by
Peter Zijlstra
f8380f97 d7a5da7a

+33
+5
Documentation/admin-guide/kernel-parameters.txt
··· 6600 6600 6601 6601 rootflags= [KNL] Set root filesystem mount option string 6602 6602 6603 + rseq_slice_ext= [KNL] RSEQ based time slice extension 6604 + Format: boolean 6605 + Control enablement of RSEQ based time slice extension. 6606 + Default is 'on'. 6607 + 6603 6608 initramfs_options= [KNL] 6604 6609 Specify mount options for for the initramfs mount. 6605 6610
+11
include/linux/rseq_entry.h
··· 75 75 #define rseq_inline __always_inline 76 76 #endif 77 77 78 + #ifdef CONFIG_RSEQ_SLICE_EXTENSION 79 + DECLARE_STATIC_KEY_TRUE(rseq_slice_extension_key); 80 + 81 + static __always_inline bool rseq_slice_extension_enabled(void) 82 + { 83 + return static_branch_likely(&rseq_slice_extension_key); 84 + } 85 + #else /* CONFIG_RSEQ_SLICE_EXTENSION */ 86 + static inline bool rseq_slice_extension_enabled(void) { return false; } 87 + #endif /* !CONFIG_RSEQ_SLICE_EXTENSION */ 88 + 78 89 bool rseq_debug_update_user_cs(struct task_struct *t, struct pt_regs *regs, unsigned long csaddr); 79 90 bool rseq_debug_validate_ids(struct task_struct *t); 80 91
+17
kernel/rseq.c
··· 483 483 efault: 484 484 return -EFAULT; 485 485 } 486 + 487 + #ifdef CONFIG_RSEQ_SLICE_EXTENSION 488 + DEFINE_STATIC_KEY_TRUE(rseq_slice_extension_key); 489 + 490 + static int __init rseq_slice_cmdline(char *str) 491 + { 492 + bool on; 493 + 494 + if (kstrtobool(str, &on)) 495 + return 0; 496 + 497 + if (!on) 498 + static_branch_disable(&rseq_slice_extension_key); 499 + return 1; 500 + } 501 + __setup("rseq_slice_ext=", rseq_slice_cmdline); 502 + #endif /* CONFIG_RSEQ_SLICE_EXTENSION */