Commit c74f66ce authored by liguang's avatar liguang Committed by Linus Torvalds

semaphore: use unlikely() for down's timeout

Signed-off-by: default avatarliguang <lig.fnst@cn.fujitsu.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 97439d0f
......@@ -214,7 +214,7 @@ static inline int __sched __down_common(struct semaphore *sem, long state,
for (;;) {
if (signal_pending_state(state, task))
goto interrupted;
if (timeout <= 0)
if (unlikely(timeout <= 0))
goto timed_out;
__set_task_state(task, state);
raw_spin_unlock_irq(&sem->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment