diff options
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 584a122b553c..9d64cec9ae1d 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -3811,9 +3811,13 @@ static inline void update_sd_lb_stats(struct sched_domain *sd, int this_cpu, | |||
3811 | const struct cpumask *cpus, int *balance, | 3811 | const struct cpumask *cpus, int *balance, |
3812 | struct sd_lb_stats *sds) | 3812 | struct sd_lb_stats *sds) |
3813 | { | 3813 | { |
3814 | struct sched_domain *child = sd->child; | ||
3814 | struct sched_group *group = sd->groups; | 3815 | struct sched_group *group = sd->groups; |
3815 | struct sg_lb_stats sgs; | 3816 | struct sg_lb_stats sgs; |
3816 | int load_idx; | 3817 | int load_idx, prefer_sibling = 0; |
3818 | |||
3819 | if (child && child->flags & SD_PREFER_SIBLING) | ||
3820 | prefer_sibling = 1; | ||
3817 | 3821 | ||
3818 | init_sd_power_savings_stats(sd, sds, idle); | 3822 | init_sd_power_savings_stats(sd, sds, idle); |
3819 | load_idx = get_sd_load_idx(sd, idle); | 3823 | load_idx = get_sd_load_idx(sd, idle); |
@@ -3833,6 +3837,14 @@ static inline void update_sd_lb_stats(struct sched_domain *sd, int this_cpu, | |||
3833 | sds->total_load += sgs.group_load; | 3837 | sds->total_load += sgs.group_load; |
3834 | sds->total_pwr += group->__cpu_power; | 3838 | sds->total_pwr += group->__cpu_power; |
3835 | 3839 | ||
3840 | /* | ||
3841 | * In case the child domain prefers tasks go to siblings | ||
3842 | * first, lower the group capacity to one so that we'll try | ||
3843 | * and move all the excess tasks away. | ||
3844 | */ | ||
3845 | if (prefer_sibling) | ||
3846 | sgs.group_capacity = 1; | ||
3847 | |||
3836 | if (local_group) { | 3848 | if (local_group) { |
3837 | sds->this_load = sgs.avg_load; | 3849 | sds->this_load = sgs.avg_load; |
3838 | sds->this = group; | 3850 | sds->this = group; |