]> git.karo-electronics.de Git - karo-tx-linux.git/commit
hrtimers: Special-case zero length sleeps
authorMatthew Garrett <mjg@redhat.com>
Thu, 8 Dec 2011 04:32:13 +0000 (15:32 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 9 Dec 2011 04:52:25 +0000 (15:52 +1100)
commit9cf4f721736d44633bd9763e7427a018292c6194
treeac151c1337190c7397452147a21bff1d0a5cacb7
parent1d037a7aad3146bea953e608505c6448284534da
hrtimers: Special-case zero length sleeps

sleep(0) is a common construct used by applications that want to trigger
the scheduler.  sched_yield() might make more sense, but only appeared in
POSIX.1-2001 and so plenty of example code still uses the sleep(0) form.

This wouldn't normally be a problem, but it means that event-driven
applications that are merely trying to avoid starving other processes may
actually end up sleeping due to having large timer_slack values.  Special-
casing this seems reasonable.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/hrtimer.c