]> git.karo-electronics.de Git - karo-tx-linux.git/commit
hrtimers: Special-case zero length sleeps
authorMatthew Garrett <mjg@redhat.com>
Wed, 16 Nov 2011 23:41:07 +0000 (10:41 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 21 Nov 2011 02:18:07 +0000 (13:18 +1100)
commit857f8b925583c461689a9630d861226e1b573ef1
treeb755a04924639266d6f8539a47f5db102fc5bdc5
parent7705e54d5f7be9d953133a21f3eaaef685037d59
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