]> asedeno.scripts.mit.edu Git - linux.git/commit
swait: Add idle variants which don't contribute to load average
authorLuis R. Rodriguez <mcgrof@kernel.org>
Tue, 20 Jun 2017 21:45:46 +0000 (14:45 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Thu, 17 Aug 2017 14:26:07 +0000 (07:26 -0700)
commit352eee1242ef62e18a475ef9278697dbd865969b
tree440f00092d574f433b255edf677dd75fa09c3833
parentc5ebe66ce774126b888617cab658f6556d23365e
swait: Add idle variants which don't contribute to load average

There are cases where folks are using an interruptible swait when
using kthreads. This is rather confusing given you'd expect
interruptible waits to be -- interruptible, but kthreads are not
interruptible ! The reason for such practice though is to avoid
having these kthreads contribute to the system load average.

When systems are idle some kthreads may spend a lot of time blocking if
using swait_event_timeout(). This would contribute to the system load
average. On systems without preemption this would mean the load average
of an idle system is bumped to 2 instead of 0. On systems with PREEMPT=y
this would mean the load average of an idle system is bumped to 3
instead of 0.

This adds proper API using TASK_IDLE to make such goals explicit and
avoid confusion.

Suggested-by: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Tested-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
include/linux/swait.h