core, x86: Preparatory steps for RT
Subsystems (12)
cover core, x86: Preparatory steps for RT
CONFIG_PREEMPTION is selected by CONFIG_PREEMPT and by CONFIG_PREEMPT_RT. Both PREEMPT and PREEMPT_RT require the same functionality which today depends on CONFIG_PREEMPT.
The following series adjusts the core and x86 code to use CONFIG_PREEMPTION where appropriate and extends the x86 dumpstack implementation to display PREEMPT_RT instead of PREEMPT on a RT enabled kernel.
Thanks,
tglx
PATCH 1/8 preempt: Use CONFIG_PREEMPTION where appropriate
CONFIG_PREEMPTION is selected by CONFIG_PREEMPT and by CONFIG_PREEMPT_RT. Both PREEMPT and PREEMPT_RT require the same functionality which today depends on CONFIG_PREEMPT.
Switch the preemption code, scheduler and init task over to use CONFIG_PREEMPTION.
That's the first step towards RT in that area. The more complex changes are coming separately.
--- include/asm-generic/preempt.h | 4 ++-- include/linux/preempt.h | 6 +++--- include/linux/sched.h | 6 +++--- init/init_task.c | 2 +- init/main.c | 2 +- kernel/sched/core.c | 14 +++++++------- kernel/sched/fair.c | 2 +- kernel/sched/sched.h | 4 ++-- 8 files changed, 20 insertions(+), 20 deletions(-)
include/asm-generic/preempt.h +2 -2
@@ -78,11 +78,11 @@ static __always_inline bool should_resch tif_need_resched()); } -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION extern asmlinkage void preempt_schedule(void);#define __preempt_schedule () preempt_schedule() extern asmlinkage void preempt_schedule_notrace(void);#define __preempt_schedule_notrace () preempt_schedule_notrace() -#endif /* CONFIG_PREEMPT */ +#endif /* CONFIG_PREEMPTION */ #endif /* __ASM_PREEMPT_H */
include/linux/preempt.h +3 -3
@@ -182,7 +182,7 @@ do { \#define preemptible () (preempt_count() == 0 && !irqs_disabled()) -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION #define preempt_enable () \ do { \ barrier(); \
@@ -203,7 +203,7 @@ do { \__preempt_schedule (); \ } while (0) -#else /* !CONFIG_PREEMPT */ +#else /* !CONFIG_PREEMPTION */ #define preempt_enable () \ do { \ barrier(); \
@@ -217,7 +217,7 @@ do { \ } while (0)#define preempt_check_resched () do { } while (0) -#endif /* CONFIG_PREEMPT */ +#endif /* CONFIG_PREEMPTION */ #define preempt_disable_notrace () \ do { \
include/linux/sched.h +3 -3
@@ -1759,7 +1759,7 @@ static inline int test_tsk_need_resched(* value indicates whether a reschedule was done in fact. * cond_resched_lock() will drop the spinlock before scheduling, */ -#ifndef CONFIG_PREEMPT +#ifndef CONFIG_PREEMPTION extern int _cond_resched (void );#else static inline int _cond_resched (void ) {return 0 ; }
@@ -1788,12 +1788,12 @@ static inline void cond_resched_rcu(void/* * Does a critical section need to be broken due to another -* task waiting?: (technically does not depend on CONFIG_PREEMPT, +* task waiting?: (technically does not depend on CONFIG_PREEMPTION, * but a general need for low latency) */ static inline int spin_needbreak (spinlock_t *lock) { -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION return spin_is_contended (lock);#else return 0 ;
init/init_task.c +1 -1
@@ -174,7 +174,7 @@ struct task_struct init_task#ifdef CONFIG_FUNCTION_GRAPH_TRACER .ret_stack = NULL,#endif -#if defined(CONFIG_TRACING ) && defined(CONFIG_PREEMPT ) +#if defined(CONFIG_TRACING ) && defined(CONFIG_PREEMPTION ) .trace_recursion = 0,#endif #ifdef CONFIG_LIVEPATCH
init/main.c +1 -1
@@ -433,7 +433,7 @@ noinline void __ref rest_init(void)/* * Enable might_sleep() and smp_processor_id() checks. -* They cannot be enabled earlier because with CONFIG_PREEMPT=y +* They cannot be enabled earlier because with CONFIG_PREEMPTION=y * kernel_thread() would trigger might_sleep() splats. With * CONFIG_PREEMPT_VOLUNTARY=y the init task might have scheduled * already, but it's stuck on the kthreadd_done completion.
kernel/sched/core.c +7 -7
@@ -3581,7 +3581,7 @@ static inline void sched_tick_start(intstatic inline void sched_tick_stop (int cpu) { }#endif -#if defined(CONFIG_PREEMPT ) && (defined(CONFIG_DEBUG_PREEMPT ) || \ +#if defined(CONFIG_PREEMPTION ) && (defined(CONFIG_DEBUG_PREEMPT ) || \ defined(CONFIG_TRACE_PREEMPT_TOGGLE ))/* * If the value passed in is equal to the current preempt count
@@ -3782,7 +3782,7 @@ pick_next_task(struct rq *rq, struct tas* task, then the wakeup sets TIF_NEED_RESCHED and schedule() gets * called on the nearest possible occasion: * -* - If the kernel is preemptible (CONFIG_PREEMPT=y): +* - If the kernel is preemptible (CONFIG_PREEMPTION=y): * * - in syscall or exception context, at the next outmost * preempt_enable(). (this might be as soon as the wake_up()'s
@@ -3791,7 +3791,7 @@ pick_next_task(struct rq *rq, struct tas* - in IRQ context, return from interrupt-handler to * preemptible context * -* - If the kernel is not preemptible (CONFIG_PREEMPT is not set) +* - If the kernel is not preemptible (CONFIG_PREEMPTION is not set) * then at the next: * * - cond_resched() call
@@ -4033,7 +4033,7 @@ static void __sched notrace preempt_sche }while (need_resched ()); } -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION /* * this is the entry point to schedule() from in-kernel preemption * off of preempt_enable. Kernel preemptions off return from interrupt
@@ -4105,7 +4105,7 @@ asmlinkage __visible void __sched notrac }EXPORT_SYMBOL_GPL (preempt_schedule_notrace); -#endif /* CONFIG_PREEMPT */ +#endif /* CONFIG_PREEMPTION */ /* * this is the entry point to schedule() from kernel preemption
@@ -5416,7 +5416,7 @@ SYSCALL_DEFINE0(sched_yield)return 0 ; } -#ifndef CONFIG_PREEMPT +#ifndef CONFIG_PREEMPTION int __sched _cond_resched(void) {if (should_resched (0 )) {
@@ -5433,7 +5433,7 @@ EXPORT_SYMBOL(_cond_resched);* __cond_resched_lock() - if a reschedule is pending, drop the given lock, * call schedule, and on return reacquire the lock. * -* This works OK both with and without CONFIG_PREEMPT. We do strange low-level +* This works OK both with and without CONFIG_PREEMPTION. We do strange low-level * operations here to prevent schedule() from being called twice (once via * spin_unlock(), once by hand). */
kernel/sched/fair.c +1 -1
@@ -7376,7 +7376,7 @@ static int detach_tasks(struct lb_env *e detached++; env->imbalance -= load; -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION /* * NEWIDLE balancing is a source of latency, so preemptible * kernels will stop after the first task is detached to minimize
kernel/sched/sched.h +2 -2
@@ -1943,7 +1943,7 @@ unsigned long arch_scale_freq_capacity(i#endif #ifdef CONFIG_SMP -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION static inline void double_rq_lock (struct rq *rq1,struct rq *rq2);
@@ -1995,7 +1995,7 @@ static inline int _double_lock_balance(s return ret; } -#endif /* CONFIG_PREEMPT */ +#endif /* CONFIG_PREEMPTION */ /* * double_lock_balance - lock the busiest runqueue, this_rq is locked already.
tip-bot for Thomas Gleixner
merge bot[tip:sched/rt] sched/preempt: Use CONFIG_PREEMPTION where appropriate
sched/preempt: Use CONFIG_PREEMPTION where appropriate
Commit-ID: c1a280b68d4e6b6db4a65aa7865c22d8789ddf09 Gitweb: https://git.kernel.org/tip/c1a280b68d4e6b6db4a65aa7865c22d8789ddf09 Author: Thomas Gleixner <[email protected]> AuthorDate: Fri, 26 Jul 2019 23:19:37 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Wed, 31 Jul 2019 19:03:34 +0200
sched/preempt: Use CONFIG_PREEMPTION where appropriate
CONFIG_PREEMPTION is selected by CONFIG_PREEMPT and by CONFIG_PREEMPT_RT. Both PREEMPT and PREEMPT_RT require the same functionality which today depends on CONFIG_PREEMPT.
Switch the preemption code, scheduler and init task over to use CONFIG_PREEMPTION.
That's the first step towards RT in that area. The more complex changes are coming separately.
--- include/asm-generic/preempt.h | 4 ++-- include/linux/preempt.h | 6 +++--- include/linux/sched.h | 6 +++--- init/init_task.c | 2 +- init/main.c | 2 +- kernel/sched/core.c | 14 +++++++------- kernel/sched/fair.c | 2 +- kernel/sched/sched.h | 4 ++-- 8 files changed, 20 insertions(+), 20 deletions(-)
include/asm-generic/preempt.h +2 -2
@@ -78,11 +78,11 @@ static __always_inline bool should_resched(int preempt_offset) tif_need_resched()); } -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION extern asmlinkage void preempt_schedule(void);#define __preempt_schedule () preempt_schedule() extern asmlinkage void preempt_schedule_notrace(void);#define __preempt_schedule_notrace () preempt_schedule_notrace() -#endif /* CONFIG_PREEMPT */ +#endif /* CONFIG_PREEMPTION */ #endif /* __ASM_PREEMPT_H */
include/linux/preempt.h +3 -3
@@ -182,7 +182,7 @@ do { \#define preemptible () (preempt_count() == 0 && !irqs_disabled()) -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION #define preempt_enable () \ do { \ barrier(); \
@@ -203,7 +203,7 @@ do { \__preempt_schedule (); \ } while (0) -#else /* !CONFIG_PREEMPT */ +#else /* !CONFIG_PREEMPTION */ #define preempt_enable () \ do { \ barrier(); \
@@ -217,7 +217,7 @@ do { \ } while (0)#define preempt_check_resched () do { } while (0) -#endif /* CONFIG_PREEMPT */ +#endif /* CONFIG_PREEMPTION */ #define preempt_disable_notrace () \ do { \
include/linux/sched.h +3 -3
@@ -1767,7 +1767,7 @@ static inline int test_tsk_need_resched(struct task_struct *tsk)* value indicates whether a reschedule was done in fact. * cond_resched_lock() will drop the spinlock before scheduling, */ -#ifndef CONFIG_PREEMPT +#ifndef CONFIG_PREEMPTION extern int _cond_resched (void );#else static inline int _cond_resched (void ) {return 0 ; }
@@ -1796,12 +1796,12 @@ static inline void cond_resched_rcu(void)/* * Does a critical section need to be broken due to another -* task waiting?: (technically does not depend on CONFIG_PREEMPT, +* task waiting?: (technically does not depend on CONFIG_PREEMPTION, * but a general need for low latency) */ static inline int spin_needbreak (spinlock_t *lock) { -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION return spin_is_contended (lock);#else return 0 ;
init/init_task.c +1 -1
@@ -174,7 +174,7 @@ struct task_struct init_task#ifdef CONFIG_FUNCTION_GRAPH_TRACER .ret_stack = NULL,#endif -#if defined(CONFIG_TRACING ) && defined(CONFIG_PREEMPT ) +#if defined(CONFIG_TRACING ) && defined(CONFIG_PREEMPTION ) .trace_recursion = 0,#endif #ifdef CONFIG_LIVEPATCH
init/main.c +1 -1
@@ -433,7 +433,7 @@ noinline void __ref rest_init(void)/* * Enable might_sleep() and smp_processor_id() checks. -* They cannot be enabled earlier because with CONFIG_PREEMPT=y +* They cannot be enabled earlier because with CONFIG_PREEMPTION=y * kernel_thread() would trigger might_sleep() splats. With * CONFIG_PREEMPT_VOLUNTARY=y the init task might have scheduled * already, but it's stuck on the kthreadd_done completion.
kernel/sched/core.c +7 -7
@@ -3581,7 +3581,7 @@ static inline void sched_tick_start(int cpu) { }static inline void sched_tick_stop (int cpu) { }#endif -#if defined(CONFIG_PREEMPT ) && (defined(CONFIG_DEBUG_PREEMPT ) || \ +#if defined(CONFIG_PREEMPTION ) && (defined(CONFIG_DEBUG_PREEMPT ) || \ defined(CONFIG_TRACE_PREEMPT_TOGGLE ))/* * If the value passed in is equal to the current preempt count
@@ -3782,7 +3782,7 @@ again:* task, then the wakeup sets TIF_NEED_RESCHED and schedule() gets * called on the nearest possible occasion: * -* - If the kernel is preemptible (CONFIG_PREEMPT=y): +* - If the kernel is preemptible (CONFIG_PREEMPTION=y): * * - in syscall or exception context, at the next outmost * preempt_enable(). (this might be as soon as the wake_up()'s
@@ -3791,7 +3791,7 @@ again:* - in IRQ context, return from interrupt-handler to * preemptible context * -* - If the kernel is not preemptible (CONFIG_PREEMPT is not set) +* - If the kernel is not preemptible (CONFIG_PREEMPTION is not set) * then at the next: * * - cond_resched() call
@@ -4033,7 +4033,7 @@ static void __sched notrace preempt_schedule_common(void) }while (need_resched ()); } -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION /* * this is the entry point to schedule() from in-kernel preemption * off of preempt_enable. Kernel preemptions off return from interrupt
@@ -4105,7 +4105,7 @@ asmlinkage __visible void __sched notrace preempt_schedule_notrace(void) }EXPORT_SYMBOL_GPL (preempt_schedule_notrace); -#endif /* CONFIG_PREEMPT */ +#endif /* CONFIG_PREEMPTION */ /* * this is the entry point to schedule() from kernel preemption
@@ -5416,7 +5416,7 @@ SYSCALL_DEFINE0(sched_yield)return 0 ; } -#ifndef CONFIG_PREEMPT +#ifndef CONFIG_PREEMPTION int __sched _cond_resched(void) {if (should_resched (0 )) {
@@ -5433,7 +5433,7 @@ EXPORT_SYMBOL(_cond_resched);* __cond_resched_lock() - if a reschedule is pending, drop the given lock, * call schedule, and on return reacquire the lock. * -* This works OK both with and without CONFIG_PREEMPT. We do strange low-level +* This works OK both with and without CONFIG_PREEMPTION. We do strange low-level * operations here to prevent schedule() from being called twice (once via * spin_unlock(), once by hand). */
kernel/sched/fair.c +1 -1
@@ -7430,7 +7430,7 @@ static int detach_tasks(struct lb_env *env) detached++; env->imbalance -= load; -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION /* * NEWIDLE balancing is a source of latency, so preemptible * kernels will stop after the first task is detached to minimize
kernel/sched/sched.h +2 -2
@@ -1943,7 +1943,7 @@ unsigned long arch_scale_freq_capacity(int cpu)#endif #ifdef CONFIG_SMP -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION static inline void double_rq_lock (struct rq *rq1,struct rq *rq2);
@@ -1995,7 +1995,7 @@ static inline int _double_lock_balance(struct rq *this_rq, struct rq *busiest) return ret; } -#endif /* CONFIG_PREEMPT */ +#endif /* CONFIG_PREEMPTION */ /* * double_lock_balance - lock the busiest runqueue, this_rq is locked already.
PATCH 2/8 rcu: Use CONFIG_PREEMPTION
In reply to Thomas GleixnerCONFIG_PREEMPTION is selected by CONFIG_PREEMPT and by CONFIG_PREEMPT_RT. Both PREEMPT and PREEMPT_RT require the same functionality which today depends on CONFIG_PREEMPT.
Switch the conditionals in RCU to use CONFIG_PREEMPTION.
That's the first step towards RCU on RT. The further tweaks are work in progress. This neither touches the selftest bits which need a closer look by Paul.
--- arch/Kconfig | 2 +- include/linux/rcupdate.h | 2 +- include/linux/rcutree.h | 2 +- include/linux/torture.h | 2 +- kernel/rcu/Kconfig | 8 ++++---- kernel/rcu/tree.c | 6 +++--- kernel/rcu/tree_stall.h | 6 +++--- kernel/trace/Kconfig | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-)
arch/Kconfig +1 -1
@@ -103,7 +103,7 @@ config STATIC_KEYS_SELFTEST config OPTPROBES def_bool y depends on KPROBES && HAVE_OPTPROBES - select TASKS_RCU if PREEMPT + select TASKS_RCU if PREEMPTION config KPROBES_ON_FTRACE def_bool y
include/linux/rcupdate.h +1 -1
@@ -578,7 +578,7 @@ do { \* * In non-preemptible RCU implementations (TREE_RCU and TINY_RCU), * it is illegal to block while in an RCU read-side critical section. -* In preemptible RCU implementations (PREEMPT_RCU) in CONFIG_PREEMPT +* In preemptible RCU implementations (PREEMPT_RCU) in CONFIG_PREEMPTION * kernel builds, RCU read-side critical sections may be preempted, * but explicit blocking is illegal. Finally, in preemptible RCU * implementations in real-time (with -rt patchset) kernel builds, RCU
include/linux/rcutree.h +1 -1
@@ -53,7 +53,7 @@ void rcu_scheduler_starting(void);extern int rcu_scheduler_active__read_mostly ;void rcu_end_inkernel_boot (void );bool rcu_is_watching (void ); -#ifndef CONFIG_PREEMPT +#ifndef CONFIG_PREEMPTION void rcu_all_qs (void );#endif
include/linux/torture.h +1 -1
@@ -86,7 +86,7 @@ void _torture_stop_kthread(char *m, stru#define torture_stop_kthread (n, tp) \ _torture_stop_kthread("Stopping " #n " task", &(tp)) -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION #define torture_preempt_schedule () preempt_schedule()#else #define torture_preempt_schedule ()
kernel/rcu/Kconfig +4 -4
@@ -7,7 +7,7 @@ menu "RCU Subsystem" config TREE_RCU bool - default y if !PREEMPT && SMP + default y if !PREEMPTION && SMP help This option selects the RCU implementation that is designed for very large SMP system with hundreds or
@@ -16,7 +16,7 @@ config TREE_RCU config PREEMPT_RCU bool - default y if PREEMPT + default y if PREEMPTION help This option selects the RCU implementation that is designed for very large SMP systems with hundreds or
@@ -28,7 +28,7 @@ config PREEMPT_RCU config TINY_RCU bool - default y if !PREEMPT && !SMP + default y if !PREEMPTION && !SMP help This option selects the RCU implementation that is designed for UP systems from which real-time response
@@ -70,7 +70,7 @@ config TREE_SRCU This option selects the full-fledged version of SRCU. config TASKS_RCU - def_bool PREEMPT + def_bool PREEMPTION select SRCU help This option enables a task-based RCU implementation that uses
kernel/rcu/tree.c +3 -3
@@ -1881,7 +1881,7 @@ rcu_report_unblock_qs_rnp(struct rcu_nodstruct rcu_node *rnp_p;raw_lockdep_assert_held_rcu_node (rnp); -if (WARN_ON_ONCE (!IS_ENABLED (CONFIG_PREEMPT )) || +if (WARN_ON_ONCE (!IS_ENABLED (CONFIG_PREEMPTION )) ||WARN_ON_ONCE (rcu_preempt_blocked_readers_cgp (rnp)) || rnp->qsmask !=0 ) {raw_spin_unlock_irqrestore_rcu_node (rnp, flags);
@@ -2205,7 +2205,7 @@ static void force_qs_rnp(int (*f)(struct mask =0 ;raw_spin_lock_irqsave_rcu_node (rnp, flags);if (rnp->qsmask ==0 ) { -if (!IS_ENABLED (CONFIG_PREEMPT ) || +if (!IS_ENABLED (CONFIG_PREEMPTION ) ||rcu_preempt_blocked_readers_cgp (rnp)) {/* * No point in scanning bits because they
@@ -2622,7 +2622,7 @@ static int rcu_blocking_is_gp(void) {int ret; -if (IS_ENABLED (CONFIG_PREEMPT )) +if (IS_ENABLED (CONFIG_PREEMPTION ))return rcu_scheduler_active ==RCU_SCHEDULER_INACTIVE ;might_sleep ();/* Check for RCU read-side critical section. */ preempt_disable ();
kernel/rcu/tree_stall.h +3 -3
@@ -163,7 +163,7 @@ static void rcu_iw_handler(struct irq_wo// // Printing RCU CPU stall warnings -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION /* * Dump detailed information for all tasks blocking the current RCU
@@ -215,7 +215,7 @@ static int rcu_print_task_stall(struct r return ndetected; } -#else /* #ifdef CONFIG_PREEMPT */ +#else /* #ifdef CONFIG_PREEMPTION */ /* * Because preemptible RCU does not exist, we never have to check for
@@ -233,7 +233,7 @@ static int rcu_print_task_stall(struct r {return 0 ; } -#endif /* #else #ifdef CONFIG_PREEMPT */ +#endif /* #else #ifdef CONFIG_PREEMPTION */ /* * Dump stacks of all tasks running on stalled CPUs. First try using
kernel/trace/Kconfig +1 -1
@@ -146,7 +146,7 @@ config FUNCTION_TRACER select GENERIC_TRACER select CONTEXT_SWITCH_TRACER select GLOB - select TASKS_RCU if PREEMPT + select TASKS_RCU if PREEMPTION help Enable the kernel to trace every kernel function. This is done by using a compiler feature to insert a small, 5-byte No-Operation
tip-bot for Thomas Gleixner
merge bot[tip:sched/rt] rcu: Use CONFIG_PREEMPTION
rcu: Use CONFIG_PREEMPTION
Commit-ID: 01b1d88b09824bea1a75b0bac04dcf50d9893875 Gitweb: https://git.kernel.org/tip/01b1d88b09824bea1a75b0bac04dcf50d9893875 Author: Thomas Gleixner <[email protected]> AuthorDate: Fri, 26 Jul 2019 23:19:38 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Wed, 31 Jul 2019 19:03:35 +0200
rcu: Use CONFIG_PREEMPTION
CONFIG_PREEMPTION is selected by CONFIG_PREEMPT and by CONFIG_PREEMPT_RT. Both PREEMPT and PREEMPT_RT require the same functionality which today depends on CONFIG_PREEMPT.
Switch the conditionals in RCU to use CONFIG_PREEMPTION.
That's the first step towards RCU on RT. The further tweaks are work in progress. This neither touches the selftest bits which need a closer look by Paul.
--- arch/Kconfig | 2 +- include/linux/rcupdate.h | 2 +- include/linux/rcutree.h | 2 +- include/linux/torture.h | 2 +- kernel/rcu/Kconfig | 8 ++++---- kernel/rcu/tree.c | 6 +++--- kernel/rcu/tree_stall.h | 6 +++--- kernel/trace/Kconfig | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-)
arch/Kconfig +1 -1
@@ -103,7 +103,7 @@ config STATIC_KEYS_SELFTEST config OPTPROBES def_bool y depends on KPROBES && HAVE_OPTPROBES - select TASKS_RCU if PREEMPT + select TASKS_RCU if PREEMPTION config KPROBES_ON_FTRACE def_bool y
include/linux/rcupdate.h +1 -1
@@ -578,7 +578,7 @@ do { \* * In non-preemptible RCU implementations (TREE_RCU and TINY_RCU), * it is illegal to block while in an RCU read-side critical section. -* In preemptible RCU implementations (PREEMPT_RCU) in CONFIG_PREEMPT +* In preemptible RCU implementations (PREEMPT_RCU) in CONFIG_PREEMPTION * kernel builds, RCU read-side critical sections may be preempted, * but explicit blocking is illegal. Finally, in preemptible RCU * implementations in real-time (with -rt patchset) kernel builds, RCU
include/linux/rcutree.h +1 -1
@@ -53,7 +53,7 @@ void rcu_scheduler_starting(void);extern int rcu_scheduler_active__read_mostly ;void rcu_end_inkernel_boot (void );bool rcu_is_watching (void ); -#ifndef CONFIG_PREEMPT +#ifndef CONFIG_PREEMPTION void rcu_all_qs (void );#endif
include/linux/torture.h +1 -1
@@ -86,7 +86,7 @@ void _torture_stop_kthread(char *m, struct task_struct **tp);#define torture_stop_kthread (n, tp) \ _torture_stop_kthread("Stopping " #n " task", &(tp)) -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION #define torture_preempt_schedule () preempt_schedule()#else #define torture_preempt_schedule ()
kernel/rcu/Kconfig +4 -4
@@ -7,7 +7,7 @@ menu "RCU Subsystem" config TREE_RCU bool - default y if !PREEMPT && SMP + default y if !PREEMPTION && SMP help This option selects the RCU implementation that is designed for very large SMP system with hundreds or
@@ -16,7 +16,7 @@ config TREE_RCU config PREEMPT_RCU bool - default y if PREEMPT + default y if PREEMPTION help This option selects the RCU implementation that is designed for very large SMP systems with hundreds or
@@ -28,7 +28,7 @@ config PREEMPT_RCU config TINY_RCU bool - default y if !PREEMPT && !SMP + default y if !PREEMPTION && !SMP help This option selects the RCU implementation that is designed for UP systems from which real-time response
@@ -70,7 +70,7 @@ config TREE_SRCU This option selects the full-fledged version of SRCU. config TASKS_RCU - def_bool PREEMPT + def_bool PREEMPTION select SRCU help This option enables a task-based RCU implementation that uses
kernel/rcu/tree.c +3 -3
@@ -1881,7 +1881,7 @@ rcu_report_unblock_qs_rnp(struct rcu_node *rnp, unsigned long flags)struct rcu_node *rnp_p;raw_lockdep_assert_held_rcu_node (rnp); -if (WARN_ON_ONCE (!IS_ENABLED (CONFIG_PREEMPT )) || +if (WARN_ON_ONCE (!IS_ENABLED (CONFIG_PREEMPTION )) ||WARN_ON_ONCE (rcu_preempt_blocked_readers_cgp (rnp)) || rnp->qsmask !=0 ) {raw_spin_unlock_irqrestore_rcu_node (rnp, flags);
@@ -2205,7 +2205,7 @@ static void force_qs_rnp(int (*f)(struct rcu_data *rdp)) mask =0 ;raw_spin_lock_irqsave_rcu_node (rnp, flags);if (rnp->qsmask ==0 ) { -if (!IS_ENABLED (CONFIG_PREEMPT ) || +if (!IS_ENABLED (CONFIG_PREEMPTION ) ||rcu_preempt_blocked_readers_cgp (rnp)) {/* * No point in scanning bits because they
@@ -2622,7 +2622,7 @@ static int rcu_blocking_is_gp(void) {int ret; -if (IS_ENABLED (CONFIG_PREEMPT )) +if (IS_ENABLED (CONFIG_PREEMPTION ))return rcu_scheduler_active ==RCU_SCHEDULER_INACTIVE ;might_sleep ();/* Check for RCU read-side critical section. */ preempt_disable ();
kernel/rcu/tree_stall.h +3 -3
@@ -163,7 +163,7 @@ static void rcu_iw_handler(struct irq_work *iwp)// // Printing RCU CPU stall warnings -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION /* * Dump detailed information for all tasks blocking the current RCU
@@ -215,7 +215,7 @@ static int rcu_print_task_stall(struct rcu_node *rnp) return ndetected; } -#else /* #ifdef CONFIG_PREEMPT */ +#else /* #ifdef CONFIG_PREEMPTION */ /* * Because preemptible RCU does not exist, we never have to check for
@@ -233,7 +233,7 @@ static int rcu_print_task_stall(struct rcu_node *rnp) {return 0 ; } -#endif /* #else #ifdef CONFIG_PREEMPT */ +#endif /* #else #ifdef CONFIG_PREEMPTION */ /* * Dump stacks of all tasks running on stalled CPUs. First try using
kernel/trace/Kconfig +1 -1
@@ -146,7 +146,7 @@ config FUNCTION_TRACER select GENERIC_TRACER select CONTEXT_SWITCH_TRACER select GLOB - select TASKS_RCU if PREEMPT + select TASKS_RCU if PREEMPTION help Enable the kernel to trace every kernel function. This is done by using a compiler feature to insert a small, 5-byte No-Operation
PATCH 3/8 locking: Use CONFIG_PREEMPTION
In reply to Thomas GleixnerCONFIG_PREEMPTION is selected by CONFIG_PREEMPT and by CONFIG_PREEMPT_RT. Both PREEMPT and PREEMPT_RT require the same functionality which today depends on CONFIG_PREEMPT.
Adjust the comments in the locking code.
--- include/linux/spinlock.h | 2 +- include/linux/spinlock_api_smp.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
include/linux/spinlock.h +1 -1
@@ -214,7 +214,7 @@ static inline void do_raw_spin_unlock(ra/* * Define the various spin_lock methods. Note we define these -* regardless of whether CONFIG_SMP or CONFIG_PREEMPT are set. The +* regardless of whether CONFIG_SMP or CONFIG_PREEMPTION are set. The * various methods are defined as nops in the case they are not * required. */
include/linux/spinlock_api_smp.h +1 -1
@@ -96,7 +96,7 @@ static inline int __raw_spin_trylock(raw/* * If lockdep is enabled then we use the non-preemption spin-ops -* even on CONFIG_PREEMPT, because lockdep assumes that interrupts are +* even on CONFIG_PREEMPTION, because lockdep assumes that interrupts are * not re-enabled during lock-acquire (which the preempt-spin-ops do): */ #if !defined(CONFIG_GENERIC_LOCKBREAK ) || defined(CONFIG_DEBUG_LOCK_ALLOC )
tip-bot for Thomas Gleixner
merge bot[tip:sched/rt] locking/spinlocks: Use CONFIG_PREEMPTION
locking/spinlocks: Use CONFIG_PREEMPTION
Commit-ID: 27972765bd0410fc2ef5e86a41de17c71440a2dd Gitweb: https://git.kernel.org/tip/27972765bd0410fc2ef5e86a41de17c71440a2dd Author: Thomas Gleixner <[email protected]> AuthorDate: Fri, 26 Jul 2019 23:19:39 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Wed, 31 Jul 2019 19:03:35 +0200
locking/spinlocks: Use CONFIG_PREEMPTION
CONFIG_PREEMPTION is selected by CONFIG_PREEMPT and by CONFIG_PREEMPT_RT. Both PREEMPT and PREEMPT_RT require the same functionality which today depends on CONFIG_PREEMPT.
Adjust the comments in the locking code.
--- include/linux/spinlock.h | 2 +- include/linux/spinlock_api_smp.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
include/linux/spinlock.h +1 -1
@@ -214,7 +214,7 @@ static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock)/* * Define the various spin_lock methods. Note we define these -* regardless of whether CONFIG_SMP or CONFIG_PREEMPT are set. The +* regardless of whether CONFIG_SMP or CONFIG_PREEMPTION are set. The * various methods are defined as nops in the case they are not * required. */
include/linux/spinlock_api_smp.h +1 -1
@@ -96,7 +96,7 @@ static inline int __raw_spin_trylock(raw_spinlock_t *lock)/* * If lockdep is enabled then we use the non-preemption spin-ops -* even on CONFIG_PREEMPT, because lockdep assumes that interrupts are +* even on CONFIG_PREEMPTION, because lockdep assumes that interrupts are * not re-enabled during lock-acquire (which the preempt-spin-ops do): */ #if !defined(CONFIG_GENERIC_LOCKBREAK ) || defined(CONFIG_DEBUG_LOCK_ALLOC )
PATCH 4/8 tracing: Use CONFIG_PREEMPTION
In reply to Thomas GleixnerCONFIG_PREEMPTION is selected by CONFIG_PREEMPT and by CONFIG_PREEMPT_RT. Both PREEMPT and PREEMPT_RT require the same functionality which today depends on CONFIG_PREEMPT.
Switch the conditionals in the tracer over to CONFIG_PREEMPTION.
This is the first step to make the tracer work on RT. The other small tweaks are submitted separately.
--- kernel/trace/Kconfig | 4 ++-- kernel/trace/ftrace.c | 2 +- kernel/trace/ring_buffer_benchmark.c | 2 +- kernel/trace/trace_events.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-)
kernel/trace/Kconfig +2 -2
@@ -179,7 +179,7 @@ config TRACE_PREEMPT_TOGGLE config PREEMPTIRQ_EVENTS bool "Enable trace events for preempt and irq disable/enable" select TRACE_IRQFLAGS - select TRACE_PREEMPT_TOGGLE if PREEMPT + select TRACE_PREEMPT_TOGGLE if PREEMPTION select GENERIC_TRACER default n help
@@ -214,7 +214,7 @@ config PREEMPT_TRACER bool "Preemption-off Latency Tracer" default n depends on !ARCH_USES_GETTIMEOFFSET - depends on PREEMPT + depends on PREEMPTION select GENERIC_TRACER select TRACER_MAX_TRACE select RING_BUFFER_ALLOW_SWAP
kernel/trace/ftrace.c +1 -1
@@ -2814,7 +2814,7 @@ int ftrace_shutdown(struct ftrace_ops *o* synchornize_rcu_tasks() will wait for those tasks to * execute and either schedule voluntarily or enter user space. */ -if (IS_ENABLED (CONFIG_PREEMPT )) +if (IS_ENABLED (CONFIG_PREEMPTION ))synchronize_rcu_tasks (); free_ops:
kernel/trace/ring_buffer_benchmark.c +1 -1
@@ -267,7 +267,7 @@ static void ring_buffer_producer(void)if (consumer && !(cnt % wakeup_interval))wake_up_process (consumer); -#ifndef CONFIG_PREEMPT +#ifndef CONFIG_PREEMPTION /* * If we are a non preempt kernel, the 10 second run will * stop everything while it runs. Instead, we will call
kernel/trace/trace_events.c +2 -2
@@ -255,12 +255,12 @@ void *trace_event_buffer_reserve(structlocal_save_flags (fbuffer->flags); fbuffer->pc =preempt_count ();/* -* If CONFIG_PREEMPT is enabled, then the tracepoint itself disables +* If CONFIG_PREEMPTION is enabled, then the tracepoint itself disables * preemption (adding one to the preempt_count). Since we are * interested in the preempt_count at the time the tracepoint was * hit, we need to subtract one to offset the increment. */ -if (IS_ENABLED (CONFIG_PREEMPT )) +if (IS_ENABLED (CONFIG_PREEMPTION )) fbuffer->pc--; fbuffer->trace_file = trace_file;
tip-bot for Thomas Gleixner
merge bot[tip:sched/rt] tracing: Use CONFIG_PREEMPTION
tracing: Use CONFIG_PREEMPTION
Commit-ID: 30c937043b2db09ae3408f5534824f9ececdb581 Gitweb: https://git.kernel.org/tip/30c937043b2db09ae3408f5534824f9ececdb581 Author: Thomas Gleixner <[email protected]> AuthorDate: Fri, 26 Jul 2019 23:19:40 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Wed, 31 Jul 2019 19:03:35 +0200
tracing: Use CONFIG_PREEMPTION
CONFIG_PREEMPTION is selected by CONFIG_PREEMPT and by CONFIG_PREEMPT_RT. Both PREEMPT and PREEMPT_RT require the same functionality which today depends on CONFIG_PREEMPT.
Switch the conditionals in the tracer over to CONFIG_PREEMPTION.
This is the first step to make the tracer work on RT. The other small tweaks are submitted separately.
--- kernel/trace/Kconfig | 4 ++-- kernel/trace/ftrace.c | 2 +- kernel/trace/ring_buffer_benchmark.c | 2 +- kernel/trace/trace_events.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-)
kernel/trace/Kconfig +2 -2
@@ -179,7 +179,7 @@ config TRACE_PREEMPT_TOGGLE config PREEMPTIRQ_EVENTS bool "Enable trace events for preempt and irq disable/enable" select TRACE_IRQFLAGS - select TRACE_PREEMPT_TOGGLE if PREEMPT + select TRACE_PREEMPT_TOGGLE if PREEMPTION select GENERIC_TRACER default n help
@@ -214,7 +214,7 @@ config PREEMPT_TRACER bool "Preemption-off Latency Tracer" default n depends on !ARCH_USES_GETTIMEOFFSET - depends on PREEMPT + depends on PREEMPTION select GENERIC_TRACER select TRACER_MAX_TRACE select RING_BUFFER_ALLOW_SWAP
kernel/trace/ftrace.c +1 -1
@@ -2814,7 +2814,7 @@ int ftrace_shutdown(struct ftrace_ops *ops, int command)* synchornize_rcu_tasks() will wait for those tasks to * execute and either schedule voluntarily or enter user space. */ -if (IS_ENABLED (CONFIG_PREEMPT )) +if (IS_ENABLED (CONFIG_PREEMPTION ))synchronize_rcu_tasks (); free_ops:
kernel/trace/ring_buffer_benchmark.c +1 -1
@@ -267,7 +267,7 @@ static void ring_buffer_producer(void)if (consumer && !(cnt % wakeup_interval))wake_up_process (consumer); -#ifndef CONFIG_PREEMPT +#ifndef CONFIG_PREEMPTION /* * If we are a non preempt kernel, the 10 second run will * stop everything while it runs. Instead, we will call
kernel/trace/trace_events.c +2 -2
@@ -255,12 +255,12 @@ void *trace_event_buffer_reserve(struct trace_event_buffer *fbuffer,local_save_flags (fbuffer->flags); fbuffer->pc =preempt_count ();/* -* If CONFIG_PREEMPT is enabled, then the tracepoint itself disables +* If CONFIG_PREEMPTION is enabled, then the tracepoint itself disables * preemption (adding one to the preempt_count). Since we are * interested in the preempt_count at the time the tracepoint was * hit, we need to subtract one to offset the increment. */ -if (IS_ENABLED (CONFIG_PREEMPT )) +if (IS_ENABLED (CONFIG_PREEMPTION )) fbuffer->pc--; fbuffer->trace_file = trace_file;
PATCH 5/8 kprobes: Use CONFIG_PREEMPTION
In reply to Thomas GleixnerCONFIG_PREEMPTION is selected by CONFIG_PREEMPT and by CONFIG_PREEMPT_RT. Both PREEMPT and PREEMPT_RT require the same functionality which today depends on CONFIG_PREEMPT.
Switch kprobes conditional over to CONFIG_PREEMPTION.
--- kernel/kprobes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/kprobes.c +1 -1
@@ -1906,7 +1906,7 @@ int register_kretprobe(struct kretprobe/* Pre-allocate memory for max kretprobe instances */ if (rp->maxactive <=0 ) { -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION rp->maxactive = max_t(unsigned int, 10, 2*num_possible_cpus());#else rp->maxactive =num_possible_cpus ();
tip-bot for Thomas Gleixner
merge bot[tip:sched/rt] kprobes: Use CONFIG_PREEMPTION
kprobes: Use CONFIG_PREEMPTION
Commit-ID: 92616606368ee01f1163fcfc986116c810cd48ba Gitweb: https://git.kernel.org/tip/92616606368ee01f1163fcfc986116c810cd48ba Author: Thomas Gleixner <[email protected]> AuthorDate: Fri, 26 Jul 2019 23:19:41 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Wed, 31 Jul 2019 19:03:35 +0200
kprobes: Use CONFIG_PREEMPTION
CONFIG_PREEMPTION is selected by CONFIG_PREEMPT and by CONFIG_PREEMPT_RT. Both PREEMPT and PREEMPT_RT require the same functionality which today depends on CONFIG_PREEMPT.
Switch kprobes conditional over to CONFIG_PREEMPTION.
--- kernel/kprobes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/kprobes.c +1 -1
@@ -1906,7 +1906,7 @@ int register_kretprobe(struct kretprobe *rp)/* Pre-allocate memory for max kretprobe instances */ if (rp->maxactive <=0 ) { -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION rp->maxactive = max_t(unsigned int, 10, 2*num_possible_cpus());#else rp->maxactive =num_possible_cpus ();
PATCH 6/8 x86: Use CONFIG_PREEMPTION
In reply to Thomas GleixnerCONFIG_PREEMPTION is selected by CONFIG_PREEMPT and by CONFIG_PREEMPT_RT. Both PREEMPT and PREEMPT_RT require the same functionality which today depends on CONFIG_PREEMPT.
Switch the entry code, preempt and kprobes conditionals over to CONFIG_PREEMPTION.
--- arch/x86/entry/entry_32.S | 6 +++--- arch/x86/entry/entry_64.S | 4 ++-- arch/x86/entry/thunk_32.S | 2 +- arch/x86/entry/thunk_64.S | 4 ++-- arch/x86/include/asm/preempt.h | 2 +- arch/x86/kernel/kprobes/core.c | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-)
arch/x86/entry/entry_32.S +3 -3
@@ -63,7 +63,7 @@ * enough to patch inline, increasing performance. */ -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION # define preempt_stop(clobbers) DISABLE_INTERRUPTS(clobbers); TRACE_IRQS_OFF #else # define preempt_stop(clobbers)
@@ -1084,7 +1084,7 @@ ENTRY(entry_INT80_32) INTERRUPT_RETURN restore_all_kernel: -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION DISABLE_INTERRUPTS(CLBR_ANY) cmpl $0, PER_CPU_VAR(__preempt_count) jnz .Lno_preempt
@@ -1364,7 +1364,7 @@ ENTRY(xen_hypervisor_callback) ENTRY(xen_do_upcall) 1: mov %esp, %eax call xen_evtchn_do_upcall -#ifndef CONFIG_PREEMPT +#ifndef CONFIG_PREEMPTION call xen_maybe_preempt_hcall #endif jmp ret_from_intr
arch/x86/entry/entry_64.S +2 -2
@@ -662,7 +662,7 @@ GLOBAL(swapgs_restore_regs_and_return_to /* Returning to kernel space */ retint_kernel: -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION /* Interrupts are off */ /* Check if we need preemption */ btl $9, EFLAGS(%rsp) /* were interrupts off? */
@@ -1113,7 +1113,7 @@ ENTRY(xen_do_hypervisor_callback) /* do call xen_evtchn_do_upcall LEAVE_IRQ_STACK -#ifndef CONFIG_PREEMPT +#ifndef CONFIG_PREEMPTION call xen_maybe_preempt_hcall #endif jmp error_exit
arch/x86/entry/thunk_32.S +1 -1
@@ -34,7 +34,7 @@ THUNK trace_hardirqs_off_thunk,trace_hardirqs_off_caller,1 #endif -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION THUNK ___preempt_schedule, preempt_schedule THUNK ___preempt_schedule_notrace, preempt_schedule_notrace EXPORT_SYMBOL(___preempt_schedule)
arch/x86/entry/thunk_64.S +2 -2
@@ -46,7 +46,7 @@ THUNK lockdep_sys_exit_thunk,lockdep_sys_exit #endif -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION THUNK ___preempt_schedule, preempt_schedule THUNK ___preempt_schedule_notrace, preempt_schedule_notrace EXPORT_SYMBOL(___preempt_schedule)
@@ -55,7 +55,7 @@ #if defined(CONFIG_TRACE_IRQFLAGS) \ || defined(CONFIG_DEBUG_LOCK_ALLOC) \ - || defined(CONFIG_PREEMPT) + || defined(CONFIG_PREEMPTION) .L_restore: popq %r11 popq %r10
arch/x86/include/asm/preempt.h +1 -1
@@ -102,7 +102,7 @@ static __always_inline bool should_reschreturn unlikely (raw_cpu_read_4 (__preempt_count) == preempt_offset); } -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION extern asmlinkage void ___preempt_schedule(void);# define __preempt_schedule () \ asm volatile ("call ___preempt_schedule" : ASM_CALL_CONSTRAINT)
arch/x86/kernel/kprobes/core.c +1 -1
@@ -580,7 +580,7 @@ static void setup_singlestep(struct kproif (setup_detour_execution (p, regs, reenter))return ; -#if !defined(CONFIG_PREEMPT ) +#if !defined(CONFIG_PREEMPTION )if (p->ainsn.boostable && !p->post_handler) {/* Boost up -- we can execute copied instructions directly */ if (!reenter)
tip-bot for Thomas Gleixner
merge bot[tip:sched/rt] x86: Use CONFIG_PREEMPTION
x86: Use CONFIG_PREEMPTION
Commit-ID: 48593975aeee548f25e256c515fd1d1e3fb2cc20 Gitweb: https://git.kernel.org/tip/48593975aeee548f25e256c515fd1d1e3fb2cc20 Author: Thomas Gleixner <[email protected]> AuthorDate: Fri, 26 Jul 2019 23:19:42 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Wed, 31 Jul 2019 19:03:35 +0200
x86: Use CONFIG_PREEMPTION
CONFIG_PREEMPTION is selected by CONFIG_PREEMPT and by CONFIG_PREEMPT_RT. Both PREEMPT and PREEMPT_RT require the same functionality which today depends on CONFIG_PREEMPT.
Switch the entry code, preempt and kprobes conditionals over to CONFIG_PREEMPTION.
--- arch/x86/entry/entry_32.S | 6 +++--- arch/x86/entry/entry_64.S | 4 ++-- arch/x86/entry/thunk_32.S | 2 +- arch/x86/entry/thunk_64.S | 4 ++-- arch/x86/include/asm/preempt.h | 2 +- arch/x86/kernel/kprobes/core.c | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-)
arch/x86/entry/entry_32.S +3 -3
@@ -63,7 +63,7 @@ * enough to patch inline, increasing performance. */ -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION # define preempt_stop(clobbers) DISABLE_INTERRUPTS(clobbers); TRACE_IRQS_OFF #else # define preempt_stop(clobbers)
@@ -1084,7 +1084,7 @@ restore_all: INTERRUPT_RETURN restore_all_kernel: -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION DISABLE_INTERRUPTS(CLBR_ANY) cmpl $0, PER_CPU_VAR(__preempt_count) jnz .Lno_preempt
@@ -1364,7 +1364,7 @@ ENTRY(xen_hypervisor_callback) ENTRY(xen_do_upcall) 1: mov %esp, %eax call xen_evtchn_do_upcall -#ifndef CONFIG_PREEMPT +#ifndef CONFIG_PREEMPTION call xen_maybe_preempt_hcall #endif jmp ret_from_intr
arch/x86/entry/entry_64.S +2 -2
@@ -662,7 +662,7 @@ GLOBAL(swapgs_restore_regs_and_return_to_usermode) /* Returning to kernel space */ retint_kernel: -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION /* Interrupts are off */ /* Check if we need preemption */ btl $9, EFLAGS(%rsp) /* were interrupts off? */
@@ -1113,7 +1113,7 @@ ENTRY(xen_do_hypervisor_callback) /* do_hypervisor_callback(struct *pt_regs) */ call xen_evtchn_do_upcall LEAVE_IRQ_STACK -#ifndef CONFIG_PREEMPT +#ifndef CONFIG_PREEMPTION call xen_maybe_preempt_hcall #endif jmp error_exit
arch/x86/entry/thunk_32.S +1 -1
@@ -34,7 +34,7 @@ THUNK trace_hardirqs_off_thunk,trace_hardirqs_off_caller,1 #endif -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION THUNK ___preempt_schedule, preempt_schedule THUNK ___preempt_schedule_notrace, preempt_schedule_notrace EXPORT_SYMBOL(___preempt_schedule)
arch/x86/entry/thunk_64.S +2 -2
@@ -46,7 +46,7 @@ THUNK lockdep_sys_exit_thunk,lockdep_sys_exit #endif -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION THUNK ___preempt_schedule, preempt_schedule THUNK ___preempt_schedule_notrace, preempt_schedule_notrace EXPORT_SYMBOL(___preempt_schedule)
@@ -55,7 +55,7 @@ #if defined(CONFIG_TRACE_IRQFLAGS) \ || defined(CONFIG_DEBUG_LOCK_ALLOC) \ - || defined(CONFIG_PREEMPT) + || defined(CONFIG_PREEMPTION) .L_restore: popq %r11 popq %r10
arch/x86/include/asm/preempt.h +1 -1
@@ -102,7 +102,7 @@ static __always_inline bool should_resched(int preempt_offset)return unlikely (raw_cpu_read_4 (__preempt_count) == preempt_offset); } -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION extern asmlinkage void ___preempt_schedule(void);# define __preempt_schedule () \ asm volatile ("call ___preempt_schedule" : ASM_CALL_CONSTRAINT)
arch/x86/kernel/kprobes/core.c +1 -1
@@ -580,7 +580,7 @@ static void setup_singlestep(struct kprobe *p, struct pt_regs *regs,if (setup_detour_execution (p, regs, reenter))return ; -#if !defined(CONFIG_PREEMPT ) +#if !defined(CONFIG_PREEMPTION )if (p->ainsn.boostable && !p->post_handler) {/* Boost up -- we can execute copied instructions directly */ if (!reenter)
PATCH 7/8 x86/dumpstack: Indicate PREEMPT_RT in dumps
In reply to Thomas GleixnerStack dumps print whether the kernel has preemption enabled or not. Extend it so a PREEMPT_RT enabled kernel can be identified.
--- arch/x86/kernel/dumpstack.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
arch/x86/kernel/dumpstack.c +6 -1
@@ -367,13 +367,18 @@ NOKPROBE_SYMBOL(oops_end);int __die (const char *str,struct pt_regs *regs,long err) { +const char *pr ="" ; +/* Save the regs of the first oops for the executive summary later. */ if (!die_counter) exec_summary_regs = *regs; +if (IS_ENABLED (CONFIG_PREEMPTION )) + pr =IS_ENABLED (CONFIG_PREEMPT_RT ) ?" PREEMPT_RT" :" PREEMPT" ; + printk(KERN_DEFAULT "%s: %04lx [#%d]%s%s%s%s%s\n", str, err & 0xffff, ++die_counter, - IS_ENABLED(CONFIG_PREEMPT) ? " PREEMPT" : "", + pr, IS_ENABLED(CONFIG_SMP) ? " SMP" : "", debug_pagealloc_enabled() ? " DEBUG_PAGEALLOC" : "", IS_ENABLED(CONFIG_KASAN) ? " KASAN" : "",
tip-bot for Thomas Gleixner
merge bot[tip:sched/rt] x86/dumpstack: Indicate PREEMPT_RT in dumps
x86/dumpstack: Indicate PREEMPT_RT in dumps
Commit-ID: cb376c26971ff54f25980ec1f0ae2f06d6a69df0 Gitweb: https://git.kernel.org/tip/cb376c26971ff54f25980ec1f0ae2f06d6a69df0 Author: Thomas Gleixner <[email protected]> AuthorDate: Fri, 26 Jul 2019 23:19:43 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Wed, 31 Jul 2019 19:03:36 +0200
x86/dumpstack: Indicate PREEMPT_RT in dumps
Stack dumps print whether the kernel has preemption enabled or not. Extend it so a PREEMPT_RT enabled kernel can be identified.
--- arch/x86/kernel/dumpstack.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
arch/x86/kernel/dumpstack.c +6 -1
@@ -367,13 +367,18 @@ NOKPROBE_SYMBOL(oops_end);int __die (const char *str,struct pt_regs *regs,long err) { +const char *pr ="" ; +/* Save the regs of the first oops for the executive summary later. */ if (!die_counter) exec_summary_regs = *regs; +if (IS_ENABLED (CONFIG_PREEMPTION )) + pr =IS_ENABLED (CONFIG_PREEMPT_RT ) ?" PREEMPT_RT" :" PREEMPT" ; + printk(KERN_DEFAULT "%s: %04lx [#%d]%s%s%s%s%s\n", str, err & 0xffff, ++die_counter, - IS_ENABLED(CONFIG_PREEMPT) ? " PREEMPT" : "", + pr, IS_ENABLED(CONFIG_SMP) ? " SMP" : "", debug_pagealloc_enabled() ? " DEBUG_PAGEALLOC" : "", IS_ENABLED(CONFIG_KASAN) ? " KASAN" : "",
PATCH 8/8 x86/kvm: Use CONFIG_PREEMPTION
In reply to Thomas GleixnerCONFIG_PREEMPTION is selected by CONFIG_PREEMPT and by CONFIG_PREEMPT_RT. Both PREEMPT and PREEMPT_RT require the same functionality which today depends on CONFIG_PREEMPT.
Switch the conditional for async pagefaults to use CONFIG_PREEMPTION.
--- arch/x86/kernel/kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/kvm.c +1 -1
@@ -314,7 +314,7 @@ static void kvm_guest_cpu_init(void)if (kvm_para_has_feature (KVM_FEATURE_ASYNC_PF ) && kvmapf) {u64 pa =slow_virt_to_phys (this_cpu_ptr (&apf_reason)); -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION pa |=KVM_ASYNC_PF_SEND_ALWAYS ;#endif pa |=KVM_ASYNC_PF_ENABLED ;
tip-bot for Thomas Gleixner
merge bot[tip:sched/rt] x86/kvm: Use CONFIG_PREEMPTION
x86/kvm: Use CONFIG_PREEMPTION
Commit-ID: 09c7e8b21d67c3c78ab9701dbc0fb1e9f14a0ba5 Gitweb: https://git.kernel.org/tip/09c7e8b21d67c3c78ab9701dbc0fb1e9f14a0ba5 Author: Thomas Gleixner <[email protected]> AuthorDate: Fri, 26 Jul 2019 23:19:44 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Wed, 31 Jul 2019 19:03:36 +0200
x86/kvm: Use CONFIG_PREEMPTION
CONFIG_PREEMPTION is selected by CONFIG_PREEMPT and by CONFIG_PREEMPT_RT. Both PREEMPT and PREEMPT_RT require the same functionality which today depends on CONFIG_PREEMPT.
Switch the conditional for async pagefaults to use CONFIG_PREEMPTION.
--- arch/x86/kernel/kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/kvm.c +1 -1
@@ -314,7 +314,7 @@ static void kvm_guest_cpu_init(void)if (kvm_para_has_feature (KVM_FEATURE_ASYNC_PF ) && kvmapf) {u64 pa =slow_virt_to_phys (this_cpu_ptr (&apf_reason)); -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION pa |=KVM_ASYNC_PF_SEND_ALWAYS ;#endif pa |=KVM_ASYNC_PF_ENABLED ;
Steven Rostedt
maintainerQuoted 9 lines · On Fri, 26 Jul 2019 23:19:36 +0200 Thomas Gleixner <[email protected]> wrote:
CONFIG_PREEMPTIONis selected byCONFIG_PREEMPTand byCONFIG_PREEMPT_RT. Both PREEMPT andPREEMPT_RTrequire the same functionality which today depends onCONFIG_PREEMPT.The following series adjusts the core and x86 code to use
CONFIG_PREEMPTIONwhere appropriate and extends the x86 dumpstack implementation to displayPREEMPT_RTinstead of PREEMPT on a RT enabled kernel.
Hmm, I'm looking at v5.3-rc1 and I don't see a CONFIG_PREEMPTION defined. And the first patch doesn't define it. Did I miss a patch series that adds it?
-- Steve
Quoted 13 lines · Steven Rostedt
Quoted 9 lines · On Fri, 26 Jul 2019 23:19:36 +0200 Thomas Gleixner <[email protected]> wrote:
CONFIG_PREEMPTIONis selected byCONFIG_PREEMPTand byCONFIG_PREEMPT_RT. Both PREEMPT andPREEMPT_RTrequire the same functionality which today depends onCONFIG_PREEMPT.The following series adjusts the core and x86 code to use
CONFIG_PREEMPTIONwhere appropriate and extends the x86 dumpstack implementation to displayPREEMPT_RTinstead of PREEMPT on a RT enabled kernel.
Quoted 3 lines
Hmm, I'm looking at v5.3-rc1 and I don't see a
CONFIG_PREEMPTIONdefined. And the first patch doesn't define it. Did I miss a patch series that adds it?
It came right after rc1. The initial commit renamed PREEMPT to PREEMPT_LL and seletced PREEMPT, but that broke defconfigs and make olddefconfig :(
And in fact it was a good thing that I had to stare at all CONFIG_PREEMPT dependencies. Found some interesting things already :)
Thanks,
tglx
Quoted 8 lines · Thomas Gleixner
CONFIG_PREEMPTIONis selected byCONFIG_PREEMPTand byCONFIG_PREEMPT_RT. Both PREEMPT andPREEMPT_RTrequire the same functionality which today depends onCONFIG_PREEMPT.The following series adjusts the core and x86 code to use
CONFIG_PREEMPTIONwhere appropriate and extends the x86 dumpstack implementation to displayPREEMPT_RTinstead of PREEMPT on a RT enabled kernel.