]> Gentwo Git Trees - linux/.git/commit
sched: Cancel the slice protection of the idle entity
authorzihan zhou <15645113830zzh@gmail.com>
Sat, 8 Feb 2025 08:08:52 +0000 (16:08 +0800)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 14 Feb 2025 09:32:00 +0000 (10:32 +0100)
commitf553741ac8c0e467a3b873e305f34b902e50b86d
treefed2da8cc7f04be6af616f678ab2f08753c2cc3c
parenta64dcfb451e254085a7daee5fe51bf22959d52d3
sched: Cancel the slice protection of the idle entity

A wakeup non-idle entity should preempt idle entity at any time,
but because of the slice protection of the idle entity, the non-idle
entity has to wait, so just cancel it.

This patch is aimed at minimizing the impact of SCHED_IDLE on
SCHED_NORMAL. For example, a task with SCHED_IDLE policy that sleeps for
1s and then runs for 3 ms, running cyclictest on the same cpu, has a
maximum latency of 3 ms, which is caused by the slice protection of the
idle entity. It is unreasonable. With this patch, the cyclictest latency
under the same conditions is basically the same on the cpu with idle
processes and on empty cpu.

[peterz: add helpers]
Fixes: 63304558ba5d ("sched/eevdf: Curb wakeup-preemption")
Signed-off-by: zihan zhou <15645113830zzh@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Tested-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lkml.kernel.org/r/20250208080850.16300-1-15645113830zzh@gmail.com
kernel/sched/fair.c