diff options
-rw-r--r-- | kernel/sched/fair.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index cd2fb8384fbe..d012681fb1ab 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7334,13 +7334,22 @@ out_all_pinned: sd->nr_balance_failed = 0; out_one_pinned: + ld_moved = 0; + + /* + * idle_balance() disregards balance intervals, so we could repeatedly + * reach this code, which would lead to balance_interval skyrocketting + * in a short amount of time. Skip the balance_interval increase logic + * to avoid that. + */ + if (env.idle == CPU_NEWLY_IDLE) + goto out; + /* tune up the balancing interval */ if (((env.flags & LBF_ALL_PINNED) && sd->balance_interval < MAX_PINNED_INTERVAL) || (sd->balance_interval < sd->max_interval)) sd->balance_interval *= 2; - - ld_moved = 0; out: return ld_moved; } |