diff --git a/patches.kernel.org/6.2.12-130-sched-fair-Fix-imbalance-overflow.patch b/patches.kernel.org/6.2.12-130-sched-fair-Fix-imbalance-overflow.patch new file mode 100644 index 0000000..c87a4c7 --- /dev/null +++ b/patches.kernel.org/6.2.12-130-sched-fair-Fix-imbalance-overflow.patch @@ -0,0 +1,49 @@ +From: Vincent Guittot +Date: Tue, 11 Apr 2023 11:06:11 +0200 +Subject: [PATCH] sched/fair: Fix imbalance overflow +References: bsc#1012628 +Patch-mainline: 6.2.12 +Git-commit: 91dcf1e8068e9a8823e419a7a34ff4341275fb70 + +[ Upstream commit 91dcf1e8068e9a8823e419a7a34ff4341275fb70 ] + +When local group is fully busy but its average load is above system load, +computing the imbalance will overflow and local group is not the best +target for pulling this load. + +Fixes: 0b0695f2b34a ("sched/fair: Rework load_balance()") +Reported-by: Tingjia Cao +Signed-off-by: Vincent Guittot +Signed-off-by: Peter Zijlstra (Intel) +Tested-by: Tingjia Cao +Link: https://lore.kernel.org/lkml/CABcWv9_DAhVBOq2=W=2ypKE9dKM5s2DvoV8-U0+GDwwuKZ89jQ@mail.gmail.com/T/ +Signed-off-by: Sasha Levin +Signed-off-by: Jiri Slaby +--- + kernel/sched/fair.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c +index e046a2bf..661226e3 100644 +--- a/kernel/sched/fair.c ++++ b/kernel/sched/fair.c +@@ -10123,6 +10123,16 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s + + sds->avg_load = (sds->total_load * SCHED_CAPACITY_SCALE) / + sds->total_capacity; ++ ++ /* ++ * If the local group is more loaded than the average system ++ * load, don't try to pull any tasks. ++ */ ++ if (local->avg_load >= sds->avg_load) { ++ env->imbalance = 0; ++ return; ++ } ++ + } + + /* +-- +2.35.3 + diff --git a/series.conf b/series.conf index 060217a..9f42d3d 100644 --- a/series.conf +++ b/series.conf @@ -2357,6 +2357,7 @@ patches.kernel.org/6.2.12-127-ubi-Fix-deadlock-caused-by-recursively-holding.patch patches.kernel.org/6.2.12-128-i2c-mchp-pci1xxxx-Update-Timing-registers.patch patches.kernel.org/6.2.12-129-powerpc-papr_scm-Update-the-NUMA-distance-tabl.patch + patches.kernel.org/6.2.12-130-sched-fair-Fix-imbalance-overflow.patch ######################################################## # Build fixes that apply to the vanilla kernel too.