[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-cc87f76a601d2d256118f7bab15e35254356ae21@git.kernel.org>
Date: Fri, 2 Apr 2010 19:13:58 GMT
From: tip-bot for Peter Zijlstra <a.p.zijlstra@...llo.nl>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
a.p.zijlstra@...llo.nl, tglx@...utronix.de, mingo@...e.hu
Subject: [tip:sched/core] sched: Fix nr_uninterruptible count
Commit-ID: cc87f76a601d2d256118f7bab15e35254356ae21
Gitweb: http://git.kernel.org/tip/cc87f76a601d2d256118f7bab15e35254356ae21
Author: Peter Zijlstra <a.p.zijlstra@...llo.nl>
AuthorDate: Fri, 26 Mar 2010 12:22:14 +0100
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Fri, 2 Apr 2010 20:12:04 +0200
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@...llo.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
kernel/sched.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c
index 51d336e..14c8d2a 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,
*
* 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)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists