Skip to content

Commit 15257cc

Browse files
vingu-linaroPeter Zijlstra
authored andcommitted
sched/fair: Revert force wakeup preemption
This agressively bypasses run_to_parity and slice protection with the assumpiton that this is what waker wants but there is no garantee that the wakee will be the next to run. It is a better choice to use yield_to_task or WF_SYNC in such case. This increases the number of resched and preemption because a task becomes quickly "ineligible" when it runs; We update the task vruntime periodically and before the task exhausted its slice or at least quantum. Example: 2 tasks A and B wake up simultaneously with lag = 0. Both are eligible. Task A runs 1st and wakes up task C. Scheduler updates task A's vruntime which becomes greater than average runtime as all others have a lag == 0 and didn't run yet. Now task A is ineligible because it received more runtime than the other task but it has not yet exhausted its slice nor a min quantum. We force preemption, disable protection but Task B will run 1st not task C. Sidenote, DELAY_ZERO increases this effect by clearing positive lag at wake up. Fixes: e837456 ("sched/fair: Reimplement NEXT_BUDDY to align with EEVDF goals") Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://patch.msgid.link/20260123102858.52428-1-vincent.guittot@linaro.org
1 parent 4f70f10 commit 15257cc

1 file changed

Lines changed: 0 additions & 10 deletions

File tree

kernel/sched/fair.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8828,16 +8828,6 @@ static void check_preempt_wakeup_fair(struct rq *rq, struct task_struct *p, int
88288828
if ((wake_flags & WF_FORK) || pse->sched_delayed)
88298829
return;
88308830

8831-
/*
8832-
* If @p potentially is completing work required by current then
8833-
* consider preemption.
8834-
*
8835-
* Reschedule if waker is no longer eligible. */
8836-
if (in_task() && !entity_eligible(cfs_rq, se)) {
8837-
preempt_action = PREEMPT_WAKEUP_RESCHED;
8838-
goto preempt;
8839-
}
8840-
88418831
/* Prefer picking wakee soon if appropriate. */
88428832
if (sched_feat(NEXT_BUDDY) &&
88438833
set_preempt_buddy(cfs_rq, wake_flags, pse, se)) {

0 commit comments

Comments
 (0)