Commit 5b2becc8cffdccdd60c63099f592ddd35aa6c34f

Authored by Oleg Nesterov
Committed by Linus Torvalds
1 parent 3219445033

semaphore: __down_common: use signal_pending_state()

Change __down_common() to use signal_pending_state() instead of open
coding.

The changes in kernel/semaphore.o are just artifacts, the state checks are
optimized away.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 1 additions and 3 deletions Side-by-side Diff

... ... @@ -212,9 +212,7 @@
212 212 waiter.up = 0;
213 213  
214 214 for (;;) {
215   - if (state == TASK_INTERRUPTIBLE && signal_pending(task))
216   - goto interrupted;
217   - if (state == TASK_KILLABLE && fatal_signal_pending(task))
  215 + if (signal_pending_state(state, task))
218 216 goto interrupted;
219 217 if (timeout <= 0)
220 218 goto timed_out;