Skip to content

Commit 0b9ca2d

Browse files
vingu-linaroPeter Zijlstra
authored andcommitted
sched/fair: Always trigger resched at the end of a protected period
Always trigger a resched after a protected period even if the entity is still eligible. It can happen that an entity remains eligible at the end of the protected period but must let an entity with a shorter slice to run in order to keep its lag shorter than slice. This is particulalry true with run to parity which tries to maximize the lag. Signed-off-by: Vincent Guittot <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 3a0baa8 commit 0b9ca2d

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

kernel/sched/fair.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,14 +1182,6 @@ static inline void update_curr_task(struct task_struct *p, s64 delta_exec)
11821182
cgroup_account_cputime(p, delta_exec);
11831183
}
11841184

1185-
static inline bool resched_next_slice(struct cfs_rq *cfs_rq, struct sched_entity *curr)
1186-
{
1187-
if (protect_slice(curr))
1188-
return false;
1189-
1190-
return !entity_eligible(cfs_rq, curr);
1191-
}
1192-
11931185
/*
11941186
* Used by other classes to account runtime.
11951187
*/
@@ -1250,7 +1242,7 @@ static void update_curr(struct cfs_rq *cfs_rq)
12501242
if (cfs_rq->nr_queued == 1)
12511243
return;
12521244

1253-
if (resched || resched_next_slice(cfs_rq, curr)) {
1245+
if (resched || !protect_slice(curr)) {
12541246
resched_curr_lazy(rq);
12551247
clear_buddies(cfs_rq, curr);
12561248
}

0 commit comments

Comments
 (0)