Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

signals: inline __fatal_signal_pending

__fatal_signal_pending inlines to one instruction on x86, probably two
instructions on other machines. It takes two longer x86 instructions just
to call it and test its return value, not to mention the function itself.

On my random x86_64 config, this saved 70 bytes of text (59 of those being
__fatal_signal_pending itself).

Signed-off-by: Roland McGrath <roland@redhat.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Roland McGrath and committed by
Linus Torvalds
d9588725 ba0a6c9f

+4 -7
+4 -1
include/linux/sched.h
··· 2337 2337 return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING)); 2338 2338 } 2339 2339 2340 - extern int __fatal_signal_pending(struct task_struct *p); 2340 + static inline int __fatal_signal_pending(struct task_struct *p) 2341 + { 2342 + return unlikely(sigismember(&p->pending.signal, SIGKILL)); 2343 + } 2341 2344 2342 2345 static inline int fatal_signal_pending(struct task_struct *p) 2343 2346 {
-6
kernel/signal.c
··· 1050 1050 } 1051 1051 } 1052 1052 1053 - int __fatal_signal_pending(struct task_struct *tsk) 1054 - { 1055 - return sigismember(&tsk->pending.signal, SIGKILL); 1056 - } 1057 - EXPORT_SYMBOL(__fatal_signal_pending); 1058 - 1059 1053 struct sighand_struct *lock_task_sighand(struct task_struct *tsk, unsigned long *flags) 1060 1054 { 1061 1055 struct sighand_struct *sighand;