Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion kernel/sched/fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -8783,7 +8783,19 @@ static void yield_task_fair(struct rq *rq)
*/
rq_clock_skip_update(rq);

se->deadline += calc_delta_fair(se->slice, se);
/*
* Forfeit the remaining vruntime, only if the entity is eligible. This
* condition is necessary because in core scheduling we prefer to run
* ineligible tasks rather than force idling. If this happens we may
* end up in a loop where the core scheduler picks the yielding task,
* which yields immediately again; without the condition the vruntime
* ends up quickly running away.
*/
if (entity_eligible(cfs_rq, se)) {
se->vruntime = se->deadline;
se->deadline += calc_delta_fair(se->slice, se);
update_min_vruntime(cfs_rq);
}
}

static bool yield_to_task_fair(struct rq *rq, struct task_struct *p)
Expand Down
Loading