From: Oleg Nesterov Change __mutex_lock_common() to use signal_pending_state() for the sake of the code re-use. This adds 7 bytes to kernel/mutex.o, but afaics only because gcc isn't smart enough. (btw, uninlining of __mutex_lock_common() shrinks .text from 2722 to 1542, perhaps it is worth doing). Signed-off-by: Oleg Nesterov Cc: Ingo Molnar Cc: Matthew Wilcox Cc: Dmitry Adamushko Cc: Peter Zijlstra Cc: Roland McGrath Signed-off-by: Andrew Morton --- kernel/mutex.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff -puN kernel/mutex.c~__mutex_lock_common-use-signal_pending_state kernel/mutex.c --- a/kernel/mutex.c~__mutex_lock_common-use-signal_pending_state +++ a/kernel/mutex.c @@ -165,10 +165,7 @@ __mutex_lock_common(struct mutex *lock, * got a signal? (This code gets eliminated in the * TASK_UNINTERRUPTIBLE case.) */ - if (unlikely((state == TASK_INTERRUPTIBLE && - signal_pending(task)) || - (state == TASK_KILLABLE && - fatal_signal_pending(task)))) { + if (unlikely(signal_pending_state(state, task))) { mutex_remove_waiter(lock, &waiter, task_thread_info(task)); mutex_release(&lock->dep_map, 1, ip); _