Skip to content

Commit 2f2fc17

Browse files
author
Peter Zijlstra
committed
sched/eevdf: Also update slice on placement
Tasks that never consume their full slice would not update their slice value. This means that tasks that are spawned before the sysctl scaling keep their original (UP) slice length. Fixes: 147f3ef ("sched/fair: Implement an EEVDF-like scheduling policy") Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 8a749fd commit 2f2fc17

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

kernel/sched/fair.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4919,10 +4919,12 @@ static inline void update_misfit_status(struct task_struct *p, struct rq *rq) {}
49194919
static void
49204920
place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
49214921
{
4922-
u64 vslice = calc_delta_fair(se->slice, se);
4923-
u64 vruntime = avg_vruntime(cfs_rq);
4922+
u64 vslice, vruntime = avg_vruntime(cfs_rq);
49244923
s64 lag = 0;
49254924

4925+
se->slice = sysctl_sched_base_slice;
4926+
vslice = calc_delta_fair(se->slice, se);
4927+
49264928
/*
49274929
* Due to how V is constructed as the weighted average of entities,
49284930
* adding tasks with positive lag, or removing tasks with negative lag

0 commit comments

Comments
 (0)