Skip to content

Commit d206fba

Browse files
author
Peter Zijlstra
committed
sched/fair: Revert max_newidle_lb_cost bump
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
1 parent e837456 commit d206fba

1 file changed

Lines changed: 3 additions & 16 deletions

File tree

kernel/sched/fair.c

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12230,14 +12230,8 @@ static inline bool update_newidle_cost(struct sched_domain *sd, u64 cost)
1223012230
/*
1223112231
* Track max cost of a domain to make sure to not delay the
1223212232
* next wakeup on the CPU.
12233-
*
12234-
* sched_balance_newidle() bumps the cost whenever newidle
12235-
* balance fails, and we don't want things to grow out of
12236-
* control. Use the sysctl_sched_migration_cost as the upper
12237-
* limit, plus a litle extra to avoid off by ones.
1223812233
*/
12239-
sd->max_newidle_lb_cost =
12240-
min(cost, sysctl_sched_migration_cost + 200);
12234+
sd->max_newidle_lb_cost = cost;
1224112235
sd->last_decay_max_lb_cost = jiffies;
1224212236
} else if (time_after(jiffies, sd->last_decay_max_lb_cost + HZ)) {
1224312237
/*
@@ -12920,17 +12914,10 @@ static int sched_balance_newidle(struct rq *this_rq, struct rq_flags *rf)
1292012914

1292112915
t1 = sched_clock_cpu(this_cpu);
1292212916
domain_cost = t1 - t0;
12917+
update_newidle_cost(sd, domain_cost);
12918+
1292312919
curr_cost += domain_cost;
1292412920
t0 = t1;
12925-
12926-
/*
12927-
* Failing newidle means it is not effective;
12928-
* bump the cost so we end up doing less of it.
12929-
*/
12930-
if (!pulled_task)
12931-
domain_cost = (3 * sd->max_newidle_lb_cost) / 2;
12932-
12933-
update_newidle_cost(sd, domain_cost);
1293412921
}
1293512922

1293612923
/*

0 commit comments

Comments
 (0)