Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754637AbYFHRTU (ORCPT ); Sun, 8 Jun 2008 13:19:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751945AbYFHRTJ (ORCPT ); Sun, 8 Jun 2008 13:19:09 -0400 Received: from x346.tv-sign.ru ([89.108.83.215]:41436 "EHLO mail.screens.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752006AbYFHRTJ (ORCPT ); Sun, 8 Jun 2008 13:19:09 -0400 Date: Sun, 8 Jun 2008 21:20:42 +0400 From: Oleg Nesterov To: Andrew Morton , Ingo Molnar Cc: Dmitry Adamushko , Linus Torvalds , Matthew Wilcox , Peter Zijlstra , Roland McGrath , linux-kernel@vger.kernel.org Subject: [PATCH 2/3] __mutex_lock_common: use signal_pending_state() Message-ID: <20080608172042.GA10386@tv-sign.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.11 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1202 Lines: 31 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 --- 26-rc2/kernel/mutex.c~2_MUTEX_USE_HELPER 2008-06-04 22:05:53.000000000 +0400 +++ 26-rc2/kernel/mutex.c 2008-06-08 19:08:32.000000000 +0400 @@ -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); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/