Re: [Question] sched: Should nr_uninterruptible be decremented inttwu_do_activate()?
From: Peter Zijlstra
Date: Wed Jan 11 2012 - 12:29:25 EST
On Wed, 2012-01-11 at 23:22 +0600, Rakib Mullick wrote:
> Hello all,
>
> In ttwu_do_activate(), we're decrementing nr_uninterruptible if
> p->sched_contributes_to_load (for SMP=y). But, we're also decrementing
> nr_uninterruptible from activate_task at the same path. Why we're
> doing it twice for a single task activation path?
activate_task() does:
if (task_contributes_to_load(p))
rq->nr_uninterruptible--;
Now task_contributes_to_load() reads like:
#define task_contributes_to_load(task) \
((task->state & TASK_UNINTERRUPTIBLE) != 0 && \
(task->flags & PF_FREEZING) == 0)
which will be false, since we've set TASK_WAKING.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/