[PATCH 4/5] sched/fair: Remove NEXT_BUDDY

From: Ingo Molnar
Date: Sun Apr 07 2024 - 04:44:08 EST


It has been turned off in 2009 and hasn't been enabled since,
15 years ought to be enough to remove it.

Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
---
kernel/sched/fair.c | 11 -----------
kernel/sched/features.h | 7 -------
2 files changed, 18 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 0197ba78b89c..93ea653065f5 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1901,13 +1901,6 @@ set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
static struct sched_entity *
pick_next_entity(struct cfs_rq *cfs_rq)
{
- /*
- * Enabling NEXT_BUDDY will affect latency but not fairness.
- */
- if (sched_feat(NEXT_BUDDY) &&
- cfs_rq->next && entity_eligible(cfs_rq, cfs_rq->next))
- return cfs_rq->next;
-
return pick_eevdf(cfs_rq);
}

@@ -4671,10 +4664,6 @@ static void check_preempt_wakeup_fair(struct rq *rq, struct task_struct *p, int
if (unlikely(throttled_hierarchy(cfs_rq_of(pse))))
return;

- if (sched_feat(NEXT_BUDDY) && !(wake_flags & WF_FORK)) {
- set_next_buddy(pse);
- }
-
/*
* We can come here with TIF_NEED_RESCHED already set from new task
* wake up path.
diff --git a/kernel/sched/features.h b/kernel/sched/features.h
index 143f55df890b..f0df03fe24d8 100644
--- a/kernel/sched/features.h
+++ b/kernel/sched/features.h
@@ -8,13 +8,6 @@ SCHED_FEAT(PLACE_LAG, true)
SCHED_FEAT(PLACE_DEADLINE_INITIAL, true)
SCHED_FEAT(RUN_TO_PARITY, true)

-/*
- * Prefer to schedule the task we woke last (assuming it failed
- * wakeup-preemption), since its likely going to consume data we
- * touched, increases cache locality.
- */
-SCHED_FEAT(NEXT_BUDDY, false)
-
/*
* Consider buddies to be cache hot, decreases the likeliness of a
* cache buddy being migrated away, increases cache locality.
--
2.40.1