diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2010-03-26 07:22:14 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-04-02 14:12:04 -0400 |
commit | cc87f76a601d2d256118f7bab15e35254356ae21 (patch) | |
tree | 1fea5a4ad226e030cdeb14c82f12dc8e766be8b2 /kernel/sched.c | |
parent | 65cc8e4859ff29a9ddc989c88557d6059834c2a2 (diff) |
sched: Fix nr_uninterruptible count
The cpuload calculation in calc_load_account_active() assumes
rq->nr_uninterruptible will not change on an offline cpu after
migrate_nr_uninterruptible(). However the recent migrate on wakeup
changes broke that and would result in decrementing the offline cpu's
rq->nr_uninterruptible.
Fix this by accounting the nr_uninterruptible on the waking cpu.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 51d336e08a92..14c8d2a1b38a 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -2378,8 +2378,12 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, | |||
2378 | * | 2378 | * |
2379 | * First fix up the nr_uninterruptible count: | 2379 | * First fix up the nr_uninterruptible count: |
2380 | */ | 2380 | */ |
2381 | if (task_contributes_to_load(p)) | 2381 | if (task_contributes_to_load(p)) { |
2382 | rq->nr_uninterruptible--; | 2382 | if (likely(cpu_online(orig_cpu))) |
2383 | rq->nr_uninterruptible--; | ||
2384 | else | ||
2385 | this_rq()->nr_uninterruptible--; | ||
2386 | } | ||
2383 | p->state = TASK_WAKING; | 2387 | p->state = TASK_WAKING; |
2384 | 2388 | ||
2385 | if (p->sched_class->task_waking) | 2389 | if (p->sched_class->task_waking) |