Commit 8a1c17574a01555e5d3fdf56d8d72969904c91ca
Committed by
Linus Torvalds
1 parent
498d0c5711
Exists in
master
and in
39 other branches
[PATCH] schedule_timeout_[un]interruptible() speedup
These functions don't need schedule_timeout()'s barrier. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing 1 changed file with 6 additions and 3 deletions Side-by-side Diff
kernel/timer.c
... | ... | @@ -1151,19 +1151,22 @@ |
1151 | 1151 | out: |
1152 | 1152 | return timeout < 0 ? 0 : timeout; |
1153 | 1153 | } |
1154 | - | |
1155 | 1154 | EXPORT_SYMBOL(schedule_timeout); |
1156 | 1155 | |
1156 | +/* | |
1157 | + * We can use __set_current_state() here because schedule_timeout() calls | |
1158 | + * schedule() unconditionally. | |
1159 | + */ | |
1157 | 1160 | signed long __sched schedule_timeout_interruptible(signed long timeout) |
1158 | 1161 | { |
1159 | - set_current_state(TASK_INTERRUPTIBLE); | |
1162 | + __set_current_state(TASK_INTERRUPTIBLE); | |
1160 | 1163 | return schedule_timeout(timeout); |
1161 | 1164 | } |
1162 | 1165 | EXPORT_SYMBOL(schedule_timeout_interruptible); |
1163 | 1166 | |
1164 | 1167 | signed long __sched schedule_timeout_uninterruptible(signed long timeout) |
1165 | 1168 | { |
1166 | - set_current_state(TASK_UNINTERRUPTIBLE); | |
1169 | + __set_current_state(TASK_UNINTERRUPTIBLE); | |
1167 | 1170 | return schedule_timeout(timeout); |
1168 | 1171 | } |
1169 | 1172 | EXPORT_SYMBOL(schedule_timeout_uninterruptible); |