aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/fair.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 9807a991dc0e..01856a8bcd4c 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6765,10 +6765,8 @@ more_balance:
6765 if (sd_parent) { 6765 if (sd_parent) {
6766 int *group_imbalance = &sd_parent->groups->sgc->imbalance; 6766 int *group_imbalance = &sd_parent->groups->sgc->imbalance;
6767 6767
6768 if ((env.flags & LBF_SOME_PINNED) && env.imbalance > 0) { 6768 if ((env.flags & LBF_SOME_PINNED) && env.imbalance > 0)
6769 *group_imbalance = 1; 6769 *group_imbalance = 1;
6770 } else if (*group_imbalance)
6771 *group_imbalance = 0;
6772 } 6770 }
6773 6771
6774 /* All tasks on this runqueue were pinned by CPU affinity */ 6772 /* All tasks on this runqueue were pinned by CPU affinity */
@@ -6779,7 +6777,7 @@ more_balance:
6779 env.loop_break = sched_nr_migrate_break; 6777 env.loop_break = sched_nr_migrate_break;
6780 goto redo; 6778 goto redo;
6781 } 6779 }
6782 goto out_balanced; 6780 goto out_all_pinned;
6783 } 6781 }
6784 } 6782 }
6785 6783
@@ -6853,6 +6851,23 @@ more_balance:
6853 goto out; 6851 goto out;
6854 6852
6855out_balanced: 6853out_balanced:
6854 /*
6855 * We reach balance although we may have faced some affinity
6856 * constraints. Clear the imbalance flag if it was set.
6857 */
6858 if (sd_parent) {
6859 int *group_imbalance = &sd_parent->groups->sgc->imbalance;
6860
6861 if (*group_imbalance)
6862 *group_imbalance = 0;
6863 }
6864
6865out_all_pinned:
6866 /*
6867 * We reach balance because all tasks are pinned at this level so
6868 * we can't migrate them. Let the imbalance flag set so parent level
6869 * can try to migrate them.
6870 */
6856 schedstat_inc(sd, lb_balanced[idle]); 6871 schedstat_inc(sd, lb_balanced[idle]);
6857 6872
6858 sd->nr_balance_failed = 0; 6873 sd->nr_balance_failed = 0;