aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2010-03-26 12:22:14 +0100
committerPaul Gortmaker <paul.gortmaker@windriver.com>2011-01-06 18:07:51 -0500
commitd9f7ec9b3727555ba55ad14bddb056468fc7e122 (patch)
treef2a1eb027247a2b717438eb62e83153ded6397c1 /kernel
parent61b3749e9e41eee782bae9cfb21ba81d10f5f583 (diff)
sched: Fix nr_uninterruptible count
commit cc87f76a601d2d256118f7bab15e35254356ae21 upstream. 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> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index e542c1e56b8..074c4d8ec1d 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2388,8 +2388,12 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state,
*
* First fix up the nr_uninterruptible count:
*/
- if (task_contributes_to_load(p))
- rq->nr_uninterruptible--;
+ if (task_contributes_to_load(p)) {
+ if (likely(cpu_online(orig_cpu)))
+ rq->nr_uninterruptible--;
+ else
+ this_rq()->nr_uninterruptible--;
+ }
p->state = TASK_WAKING;
if (p->sched_class->task_waking)