|
@@ -6765,10 +6765,8 @@ more_balance:
|
|
|
if (sd_parent) {
|
|
|
int *group_imbalance = &sd_parent->groups->sgc->imbalance;
|
|
|
|
|
|
- if ((env.flags & LBF_SOME_PINNED) && env.imbalance > 0) {
|
|
|
+ if ((env.flags & LBF_SOME_PINNED) && env.imbalance > 0)
|
|
|
*group_imbalance = 1;
|
|
|
- } else if (*group_imbalance)
|
|
|
- *group_imbalance = 0;
|
|
|
}
|
|
|
|
|
|
/* All tasks on this runqueue were pinned by CPU affinity */
|
|
@@ -6779,7 +6777,7 @@ more_balance:
|
|
|
env.loop_break = sched_nr_migrate_break;
|
|
|
goto redo;
|
|
|
}
|
|
|
- goto out_balanced;
|
|
|
+ goto out_all_pinned;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -6853,6 +6851,23 @@ more_balance:
|
|
|
goto out;
|
|
|
|
|
|
out_balanced:
|
|
|
+ /*
|
|
|
+ * We reach balance although we may have faced some affinity
|
|
|
+ * constraints. Clear the imbalance flag if it was set.
|
|
|
+ */
|
|
|
+ if (sd_parent) {
|
|
|
+ int *group_imbalance = &sd_parent->groups->sgc->imbalance;
|
|
|
+
|
|
|
+ if (*group_imbalance)
|
|
|
+ *group_imbalance = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+out_all_pinned:
|
|
|
+ /*
|
|
|
+ * We reach balance because all tasks are pinned at this level so
|
|
|
+ * we can't migrate them. Let the imbalance flag set so parent level
|
|
|
+ * can try to migrate them.
|
|
|
+ */
|
|
|
schedstat_inc(sd, lb_balanced[idle]);
|
|
|
|
|
|
sd->nr_balance_failed = 0;
|