sched: fix nr_uninterruptible accounting of frozen tasks really
commitd7895f7d3f4abfe44bcbb2dbb3b95cea882e7393
authorThomas Gleixner <tglx@linutronix.de>
Fri, 17 Jul 2009 12:15:47 +0000 (17 14:15 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 30 Jul 2009 21:39:56 +0000 (30 14:39 -0700)
treea9dc287b80309f8064c3006cd3f371e92d020682
parentc58b0ab995f63edcbc3524a582ffa22277d1c650
sched: fix nr_uninterruptible accounting of frozen tasks really

commit 6301cb95c119ebf324bb96ee226fa9ddffad80a7 upstream.

commit e3c8ca8336 (sched: do not count frozen tasks toward load) broke
the nr_uninterruptible accounting on freeze/thaw. On freeze the task
is excluded from accounting with a check for (task->flags &
PF_FROZEN), but that flag is cleared before the task is thawed. So
while we prevent that the task with state TASK_UNINTERRUPTIBLE
is accounted to nr_uninterruptible on freeze we decrement
nr_uninterruptible on thaw.

Use a separate flag which is handled by the freezing task itself. Set
it before calling the scheduler with TASK_UNINTERRUPTIBLE state and
clear it after we return from frozen state.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
include/linux/sched.h
kernel/freezer.c