From 8bb4dfdd9e8ae102288628fcb1b8bbb0088f8bc6 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Tue, 5 Apr 2011 17:23:49 +0200 Subject: [PATCH] --- yaml --- r: 245580 b: refs/heads/master c: a8e4f2eaecc9bfa4954adf79a04f4f22fddd829c h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/sched.h | 1 + trunk/kernel/sched.c | 16 ++++------------ 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index 4da3f8cf6c87..5b45a132644f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3fe1698b7fe05aeb063564e71e40d09f28d8e80c +refs/heads/master: a8e4f2eaecc9bfa4954adf79a04f4f22fddd829c diff --git a/trunk/include/linux/sched.h b/trunk/include/linux/sched.h index 7f5732f8c618..25c50317ddc1 100644 --- a/trunk/include/linux/sched.h +++ b/trunk/include/linux/sched.h @@ -1273,6 +1273,7 @@ struct task_struct { /* Revert to default priority/policy when forking */ unsigned sched_reset_on_fork:1; + unsigned sched_contributes_to_load:1; pid_t pid; pid_t tgid; diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index 7a5eb2620785..fd32b78c123c 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -2519,18 +2519,7 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, if (unlikely(task_running(rq, p))) goto out_activate; - /* - * In order to handle concurrent wakeups and release the rq->lock - * we put the task in TASK_WAKING state. - * - * First fix up the nr_uninterruptible count: - */ - if (task_contributes_to_load(p)) { - if (likely(cpu_online(orig_cpu))) - rq->nr_uninterruptible--; - else - this_rq()->nr_uninterruptible--; - } + p->sched_contributes_to_load = !!task_contributes_to_load(p); p->state = TASK_WAKING; if (p->sched_class->task_waking) { @@ -2555,6 +2544,9 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, WARN_ON(task_cpu(p) != cpu); WARN_ON(p->state != TASK_WAKING); + if (p->sched_contributes_to_load) + rq->nr_uninterruptible--; + out_activate: #endif /* CONFIG_SMP */ ttwu_activate(rq, p, en_flags);