From: Peter Zijlstra Date: Fri, 26 Mar 2010 11:22:14 +0000 (+0100) Subject: sched: Fix nr_uninterruptible count X-Git-Tag: firefly_0821_release~10186^2~954 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bea226b8e646ddb0bd262fc666b741134b9e9612;p=firefly-linux-kernel-4.4.55.git 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 LKML-Reference: Signed-off-by: Ingo Molnar Signed-off-by: Mike Galbraith Signed-off-by: Greg Kroah-Hartman --- diff --git a/kernel/sched.c b/kernel/sched.c index 0a2df531b90d..7aed676da071 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -2435,8 +2435,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)