diff options
Diffstat (limited to 'kernel/sched_fair.c')
-rw-r--r-- | kernel/sched_fair.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 8b3eddbcf9a4..19593568031a 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -1232,12 +1232,27 @@ static int wake_affine(struct sched_domain *sd, struct task_struct *p, int sync) | |||
1232 | * domain. | 1232 | * domain. |
1233 | */ | 1233 | */ |
1234 | static struct sched_group * | 1234 | static struct sched_group * |
1235 | find_idlest_group(struct sched_domain *sd, struct task_struct *p, int this_cpu) | 1235 | find_idlest_group(struct sched_domain *sd, struct task_struct *p, |
1236 | int this_cpu, int flag) | ||
1236 | { | 1237 | { |
1237 | struct sched_group *idlest = NULL, *this = NULL, *group = sd->groups; | 1238 | struct sched_group *idlest = NULL, *this = NULL, *group = sd->groups; |
1238 | unsigned long min_load = ULONG_MAX, this_load = 0; | 1239 | unsigned long min_load = ULONG_MAX, this_load = 0; |
1239 | int load_idx = sd->forkexec_idx; | ||
1240 | int imbalance = 100 + (sd->imbalance_pct-100)/2; | 1240 | int imbalance = 100 + (sd->imbalance_pct-100)/2; |
1241 | int load_idx = 0; | ||
1242 | |||
1243 | switch (flag) { | ||
1244 | case SD_BALANCE_FORK: | ||
1245 | case SD_BALANCE_EXEC: | ||
1246 | load_idx = sd->forkexec_idx; | ||
1247 | break; | ||
1248 | |||
1249 | case SD_BALANCE_WAKE: | ||
1250 | load_idx = sd->wake_idx; | ||
1251 | break; | ||
1252 | |||
1253 | default: | ||
1254 | break; | ||
1255 | } | ||
1241 | 1256 | ||
1242 | do { | 1257 | do { |
1243 | unsigned long load, avg_load; | 1258 | unsigned long load, avg_load; |
@@ -1392,7 +1407,7 @@ static int select_task_rq_fair(struct task_struct *p, int flag, int sync) | |||
1392 | continue; | 1407 | continue; |
1393 | } | 1408 | } |
1394 | 1409 | ||
1395 | group = find_idlest_group(sd, p, cpu); | 1410 | group = find_idlest_group(sd, p, cpu, flag); |
1396 | if (!group) { | 1411 | if (!group) { |
1397 | sd = sd->child; | 1412 | sd = sd->child; |
1398 | continue; | 1413 | continue; |