From: Andrew Morton Date: Tue, 13 Sep 2005 08:25:15 +0000 (-0700) Subject: [PATCH] schedule_timeout_[un]interruptible() speedup X-Git-Tag: v2.6.14-rc2~93 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a1c17574a01555e5d3fdf56d8d72969904c91ca;p=linux-2.6 [PATCH] schedule_timeout_[un]interruptible() speedup These functions don't need schedule_timeout()'s barrier. Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/timer.c b/kernel/timer.c index f4152fcd9f..3ba10fa35b 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -1151,19 +1151,22 @@ fastcall signed long __sched schedule_timeout(signed long timeout) out: return timeout < 0 ? 0 : timeout; } - EXPORT_SYMBOL(schedule_timeout); +/* + * We can use __set_current_state() here because schedule_timeout() calls + * schedule() unconditionally. + */ signed long __sched schedule_timeout_interruptible(signed long timeout) { - set_current_state(TASK_INTERRUPTIBLE); + __set_current_state(TASK_INTERRUPTIBLE); return schedule_timeout(timeout); } EXPORT_SYMBOL(schedule_timeout_interruptible); signed long __sched schedule_timeout_uninterruptible(signed long timeout) { - set_current_state(TASK_UNINTERRUPTIBLE); + __set_current_state(TASK_UNINTERRUPTIBLE); return schedule_timeout(timeout); } EXPORT_SYMBOL(schedule_timeout_uninterruptible);