22 lines
749 B
Diff
22 lines
749 B
Diff
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
|
|
--- a/kernel/sched/fair.c
|
|
+++ b/kernel/sched/fair.c
|
|
@@ -13338,12 +13338,15 @@ static int sched_balance_rq(int this_cpu, struct rq *this_rq,
|
|
* still unbalanced. ld_moved simply stays zero, so it is
|
|
* correctly treated as an imbalance.
|
|
*/
|
|
- env.loop_max = min(sysctl_sched_nr_migrate, busiest->nr_running);
|
|
-
|
|
more_balance:
|
|
rq_lock_irqsave(busiest, &rf);
|
|
update_rq_clock(busiest);
|
|
|
|
+ if (!env.loop_max)
|
|
+ env.loop_max = min(sysctl_sched_nr_migrate, busiest->cfs.h_nr_queued);
|
|
+ else
|
|
+ env.loop_max = min(env.loop_max, busiest->cfs.h_nr_queued);
|
|
+
|
|
/*
|
|
* cur_ld_moved - load moved in current iteration
|
|
* ld_moved - cumulative load moved across iterations
|