sched: do not count frozen tasks toward load
sched: do not count frozen tasks toward load

Freezing tasks via the cgroup freezer causes the load average to climb
because the freezer's current implementation puts frozen tasks in
uninterruptible sleep (D state).

Some applications which perform job-scheduling functions consult the
load average when making decisions.  If a cgroup is frozen, the load
average does not provide a useful measure of the system's utilization
to such applications.  This is especially inconvenient if the job
scheduler employs the cgroup freezer as a mechanism for preempting low
priority jobs.  Contrast this with using SIGSTOP for the same purpose:
the stopped tasks do not count toward system load.

Change task_contributes_to_load() to return false if the task is
frozen.  This results in /proc/loadavg behavior that better meets
users' expectations.

Signed-off-by: Nathan Lynch <e04de97a81056a5c7ecb3646886e1cc27299320d@pobox.com>
Acked-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Acked-by: Nigel Cunningham <cfea2496442c091fddd1ba215d62a69ec34e94d0@tuxonice.net>
Tested-by: Nigel Cunningham <cfea2496442c091fddd1ba215d62a69ec34e94d0@tuxonice.net>
Cc: <4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@kernel.org>
Cc: 642b5cd982d48582ca759a01b28bd2ade45c3b8a@lists.linux-foundation.org
Cc: b46218f6b44e9c202c4acd9f095c69546b4b0dff@lists.linux-foundation.org
Cc: Matt Helsley <2287c8c1619f3346c45c9ab3e01772af39dba7ac@us.ibm.com>
LKML-Reference: <937b3abad28657cc9fad33d70eb8f672b77311b5@manatee.lan>
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>

KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs