Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit e0c2ff9

Browse files
Peter ZijlstraIngo Molnar
authored andcommitted
sched/fair: Remove sched_feat(START_DEBIT)
With the introduction of avg_vruntime() there is no need to use worse approximations. Take the 0-lag point as starting point for inserting new tasks. Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent af4cf40 commit e0c2ff9

File tree

2 files changed

+1
-26
lines changed

2 files changed

+1
-26
lines changed

kernel/sched/fair.c

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -906,16 +906,6 @@ static u64 sched_slice(struct cfs_rq *cfs_rq, struct sched_entity *se)
906906
return slice;
907907
}
908908

909-
/*
910-
* We calculate the vruntime slice of a to-be-inserted task.
911-
*
912-
* vs = s/w
913-
*/
914-
static u64 sched_vslice(struct cfs_rq *cfs_rq, struct sched_entity *se)
915-
{
916-
return calc_delta_fair(sched_slice(cfs_rq, se), se);
917-
}
918-
919909
#include "pelt.h"
920910
#ifdef CONFIG_SMP
921911

@@ -4862,16 +4852,7 @@ static inline bool entity_is_long_sleeper(struct sched_entity *se)
48624852
static void
48634853
place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
48644854
{
4865-
u64 vruntime = cfs_rq->min_vruntime;
4866-
4867-
/*
4868-
* The 'current' period is already promised to the current tasks,
4869-
* however the extra weight of the new task will slow them down a
4870-
* little, place the new task so that it fits in the slot that
4871-
* stays open at the end.
4872-
*/
4873-
if (initial && sched_feat(START_DEBIT))
4874-
vruntime += sched_vslice(cfs_rq, se);
4855+
u64 vruntime = avg_vruntime(cfs_rq);
48754856

48764857
/* sleeps up to a single latency don't count. */
48774858
if (!initial) {

kernel/sched/features.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@
66
*/
77
SCHED_FEAT(GENTLE_FAIR_SLEEPERS, true)
88

9-
/*
10-
* Place new tasks ahead so that they do not starve already running
11-
* tasks
12-
*/
13-
SCHED_FEAT(START_DEBIT, true)
14-
159
/*
1610
* Prefer to schedule the task we woke last (assuming it failed
1711
* wakeup-preemption), since its likely going to consume data we

0 commit comments

Comments
 (0)