Skip to content

Commit aab3236

Browse files
Peter Zijlstragregkh
authored andcommitted
sched/fair: Revert max_newidle_lb_cost bump
[ Upstream commit d206fba ] Many people reported regressions on their database workloads due to: 155213a ("sched/fair: Bump sd->max_newidle_lb_cost when newidle balance fails") For instance Adam Li reported a 6% regression on SpecJBB. Conversely this will regress schbench again; on my machine from 2.22 Mrps/s down to 2.04 Mrps/s. Reported-by: Joseph Salisbury <joseph.salisbury@oracle.com> Reported-by: Adam Li <adamli@os.amperecomputing.com> Reported-by: Dietmar Eggemann <dietmar.eggemann@arm.com> Reported-by: Hazem Mohamed Abuelfotoh <abuehaze@amazon.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com> Tested-by: Dietmar Eggemann <dietmar.eggemann@arm.com> Tested-by: Chris Mason <clm@meta.com> Link: https://lkml.kernel.org/r/20250626144017.1510594-2-clm@fb.com Link: https://lkml.kernel.org/r/006c9df2-b691-47f1-82e6-e233c3f91faf@oracle.com Link: https://patch.msgid.link/20251107161739.406147760@infradead.org Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 3ed049f commit aab3236

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

kernel/sched/fair.c

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12174,14 +12174,8 @@ static inline bool update_newidle_cost(struct sched_domain *sd, u64 cost)
1217412174
/*
1217512175
* Track max cost of a domain to make sure to not delay the
1217612176
* next wakeup on the CPU.
12177-
*
12178-
* sched_balance_newidle() bumps the cost whenever newidle
12179-
* balance fails, and we don't want things to grow out of
12180-
* control. Use the sysctl_sched_migration_cost as the upper
12181-
* limit, plus a litle extra to avoid off by ones.
1218212177
*/
12183-
sd->max_newidle_lb_cost =
12184-
min(cost, sysctl_sched_migration_cost + 200);
12178+
sd->max_newidle_lb_cost = cost;
1218512179
sd->last_decay_max_lb_cost = jiffies;
1218612180
} else if (time_after(jiffies, sd->last_decay_max_lb_cost + HZ)) {
1218712181
/*
@@ -12873,17 +12867,10 @@ static int sched_balance_newidle(struct rq *this_rq, struct rq_flags *rf)
1287312867

1287412868
t1 = sched_clock_cpu(this_cpu);
1287512869
domain_cost = t1 - t0;
12870+
update_newidle_cost(sd, domain_cost);
12871+
1287612872
curr_cost += domain_cost;
1287712873
t0 = t1;
12878-
12879-
/*
12880-
* Failing newidle means it is not effective;
12881-
* bump the cost so we end up doing less of it.
12882-
*/
12883-
if (!pulled_task)
12884-
domain_cost = (3 * sd->max_newidle_lb_cost) / 2;
12885-
12886-
update_newidle_cost(sd, domain_cost);
1288712874
}
1288812875

1288912876
/*

0 commit comments

Comments
 (0)