mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-13 05:20:13 +00:00
Once the lazy preemption is supported, it would be desirable to change
the preemption models at runtime. So add support for dynamic preemption
using DYNAMIC_KEY.
::Tested lightly on Power10 LPAR
Performance numbers indicate that, preempt=none(no dynamic) and
preempt=none(dynamic) are close.
cat /sys/kernel/debug/sched/preempt
(none) voluntary full lazy
perf stat -e probe:__cond_resched -a sleep 1
Performance counter stats for 'system wide':
1,253 probe:__cond_resched
echo full > /sys/kernel/debug/sched/preempt
cat /sys/kernel/debug/sched/preempt
none voluntary (full) lazy
perf stat -e probe:__cond_resched -a sleep 1
Performance counter stats for 'system wide':
0 probe:__cond_resched
Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20250210184334.567383-2-sshegde@linux.ibm.com
17 lines
481 B
C
17 lines
481 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __ASM_POWERPC_PREEMPT_H
|
|
#define __ASM_POWERPC_PREEMPT_H
|
|
|
|
#include <asm-generic/preempt.h>
|
|
|
|
#if defined(CONFIG_PREEMPT_DYNAMIC)
|
|
#include <linux/jump_label.h>
|
|
DECLARE_STATIC_KEY_TRUE(sk_dynamic_irqentry_exit_cond_resched);
|
|
#define need_irq_preemption() \
|
|
(static_branch_unlikely(&sk_dynamic_irqentry_exit_cond_resched))
|
|
#else
|
|
#define need_irq_preemption() (IS_ENABLED(CONFIG_PREEMPTION))
|
|
#endif
|
|
|
|
#endif /* __ASM_POWERPC_PREEMPT_H */
|