sched: Add Lazy preemption model
Change fair to use resched_curr_lazy(), which, when the lazy preemption model is selected, will set TIF_NEED_RESCHED_LAZY. This LAZY bit will be promoted to the full NEED_RESCHED bit on tick. As such, the average delay between setting LAZY and actually rescheduling will be TICK_NSEC/2. In short, Lazy preemption will delay preemption for fair class but will function as Full preemption for all the other classes, most notably the realtime (RR/FIFO/DEADLINE) classes. The goal is to bridge the performance gap with Voluntary, such that we might eventually remove that option entirely. Suggested-by:Thomas Gleixner <tglx@linutronix.de> Signed-off-by:
Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by:
Sebastian Andrzej Siewior <bigeasy@linutronix.de> Link: https://lkml.kernel.org/r/20241007075055.331243614@infradead.org
Showing
- include/linux/preempt.h 7 additions, 1 deletioninclude/linux/preempt.h
- kernel/Kconfig.preempt 15 additions, 0 deletionskernel/Kconfig.preempt
- kernel/sched/core.c 78 additions, 2 deletionskernel/sched/core.c
- kernel/sched/debug.c 3 additions, 2 deletionskernel/sched/debug.c
- kernel/sched/fair.c 3 additions, 3 deletionskernel/sched/fair.c
- kernel/sched/sched.h 1 addition, 0 deletionskernel/sched/sched.h
Loading
Please register or sign in to comment