diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-01-26 11:56:17 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-01 04:49:06 -0500 |
commit | d942fb6c7d391baba3dddb566eb735fbf3df8528 (patch) | |
tree | 0340b810c79f873b7aea34298aa22e2ebf740df3 /kernel | |
parent | f90d4118bacef87894621a3e8aba853fa0c89abc (diff) |
sched: fix sync wakeups
Pawel Dziekonski reported that the openssl benchmark and his
quantum chemistry application both show slowdowns due to the
scheduler under-parallelizing execution.
The reason are pipe wakeups still doing 'sync' wakeups which
overrides the normal buddy wakeup logic - even if waker and
wakee are loosely coupled.
Fix an inversion of logic in the buddy wakeup code.
Reported-by: Pawel Dziekonski <dzieko@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched.c | 4 | ||||
-rw-r--r-- | kernel/sched_fair.c | 11 |
2 files changed, 6 insertions, 9 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 52bbf1c842a8..770b1f9ebe14 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -2266,6 +2266,10 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, int sync) | |||
2266 | if (!sched_feat(SYNC_WAKEUPS)) | 2266 | if (!sched_feat(SYNC_WAKEUPS)) |
2267 | sync = 0; | 2267 | sync = 0; |
2268 | 2268 | ||
2269 | if (!sync && (current->se.avg_overlap < sysctl_sched_migration_cost && | ||
2270 | p->se.avg_overlap < sysctl_sched_migration_cost)) | ||
2271 | sync = 1; | ||
2272 | |||
2269 | #ifdef CONFIG_SMP | 2273 | #ifdef CONFIG_SMP |
2270 | if (sched_feat(LB_WAKEUP_UPDATE)) { | 2274 | if (sched_feat(LB_WAKEUP_UPDATE)) { |
2271 | struct sched_domain *sd; | 2275 | struct sched_domain *sd; |
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 5cc1c162044f..fdc417504681 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -1179,20 +1179,15 @@ wake_affine(struct sched_domain *this_sd, struct rq *this_rq, | |||
1179 | int idx, unsigned long load, unsigned long this_load, | 1179 | int idx, unsigned long load, unsigned long this_load, |
1180 | unsigned int imbalance) | 1180 | unsigned int imbalance) |
1181 | { | 1181 | { |
1182 | struct task_struct *curr = this_rq->curr; | ||
1183 | struct task_group *tg; | ||
1184 | unsigned long tl = this_load; | 1182 | unsigned long tl = this_load; |
1185 | unsigned long tl_per_task; | 1183 | unsigned long tl_per_task; |
1184 | struct task_group *tg; | ||
1186 | unsigned long weight; | 1185 | unsigned long weight; |
1187 | int balanced; | 1186 | int balanced; |
1188 | 1187 | ||
1189 | if (!(this_sd->flags & SD_WAKE_AFFINE) || !sched_feat(AFFINE_WAKEUPS)) | 1188 | if (!(this_sd->flags & SD_WAKE_AFFINE) || !sched_feat(AFFINE_WAKEUPS)) |
1190 | return 0; | 1189 | return 0; |
1191 | 1190 | ||
1192 | if (sync && (curr->se.avg_overlap > sysctl_sched_migration_cost || | ||
1193 | p->se.avg_overlap > sysctl_sched_migration_cost)) | ||
1194 | sync = 0; | ||
1195 | |||
1196 | /* | 1191 | /* |
1197 | * If sync wakeup then subtract the (maximum possible) | 1192 | * If sync wakeup then subtract the (maximum possible) |
1198 | * effect of the currently running task from the load | 1193 | * effect of the currently running task from the load |
@@ -1419,9 +1414,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int sync) | |||
1419 | if (!sched_feat(WAKEUP_PREEMPT)) | 1414 | if (!sched_feat(WAKEUP_PREEMPT)) |
1420 | return; | 1415 | return; |
1421 | 1416 | ||
1422 | if (sched_feat(WAKEUP_OVERLAP) && (sync || | 1417 | if (sched_feat(WAKEUP_OVERLAP) && sync) { |
1423 | (se->avg_overlap < sysctl_sched_migration_cost && | ||
1424 | pse->avg_overlap < sysctl_sched_migration_cost))) { | ||
1425 | resched_task(curr); | 1418 | resched_task(curr); |
1426 | return; | 1419 | return; |
1427 | } | 1420 | } |