Skip to content

Commit 2a77e4b

Browse files
author
Peter Zijlstra
committed
sched/fair: Untangle NEXT_BUDDY and pick_next_task()
There are 3 sites using set_next_buddy() and only one is conditional on NEXT_BUDDY, the other two sites are unconditional; to note: - yield_to_task() - cgroup dequeue / pick optimization However, having NEXT_BUDDY control both the wakeup-preemption and the picking side of things means its near useless. 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 95d9fed commit 2a77e4b

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

kernel/sched/fair.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5630,9 +5630,9 @@ pick_next_entity(struct rq *rq, struct cfs_rq *cfs_rq)
56305630
struct sched_entity *se;
56315631

56325632
/*
5633-
* Enabling NEXT_BUDDY will affect latency but not fairness.
5633+
* Picking the ->next buddy will affect latency but not fairness.
56345634
*/
5635-
if (sched_feat(NEXT_BUDDY) &&
5635+
if (sched_feat(PICK_BUDDY) &&
56365636
cfs_rq->next && entity_eligible(cfs_rq, cfs_rq->next)) {
56375637
/* ->next will never be delayed */
56385638
SCHED_WARN_ON(cfs_rq->next->sched_delayed);

kernel/sched/features.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ SCHED_FEAT(PREEMPT_SHORT, true)
3131
*/
3232
SCHED_FEAT(NEXT_BUDDY, false)
3333

34+
/*
35+
* Allow completely ignoring cfs_rq->next; which can be set from various
36+
* places:
37+
* - NEXT_BUDDY (wakeup preemption)
38+
* - yield_to_task()
39+
* - cgroup dequeue / pick
40+
*/
41+
SCHED_FEAT(PICK_BUDDY, true)
42+
3443
/*
3544
* Consider buddies to be cache hot, decreases the likeliness of a
3645
* cache buddy being migrated away, increases cache locality.

0 commit comments

Comments
 (0)