diff options
author | Roland McGrath <roland@redhat.com> | 2008-04-30 03:53:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-30 11:29:37 -0400 |
commit | 5a8da0ea82db6fa9737041381079fd16f25dcce2 (patch) | |
tree | abd26177c0a965315de290e1e9602d087b78f149 /include/asm-x86 | |
parent | f3de272b821accbc8387211977c2de4f38468d05 (diff) |
signals: x86 TS_RESTORE_SIGMASK
Replace TIF_RESTORE_SIGMASK with TS_RESTORE_SIGMASK and define our own
set_restore_sigmask() function. This saves the costly SMP-safe set_bit
operation, which we do not need for the sigmask flag since TIF_SIGPENDING
always has to be set too.
Signed-off-by: Roland McGrath <roland@redhat.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-x86')
-rw-r--r-- | include/asm-x86/thread_info_32.h | 13 | ||||
-rw-r--r-- | include/asm-x86/thread_info_64.h | 13 |
2 files changed, 22 insertions, 4 deletions
diff --git a/include/asm-x86/thread_info_32.h b/include/asm-x86/thread_info_32.h index 531859962096..b6338829d1a8 100644 --- a/include/asm-x86/thread_info_32.h +++ b/include/asm-x86/thread_info_32.h | |||
@@ -131,7 +131,6 @@ static inline struct thread_info *current_thread_info(void) | |||
131 | #define TIF_SYSCALL_EMU 5 /* syscall emulation active */ | 131 | #define TIF_SYSCALL_EMU 5 /* syscall emulation active */ |
132 | #define TIF_SYSCALL_AUDIT 6 /* syscall auditing active */ | 132 | #define TIF_SYSCALL_AUDIT 6 /* syscall auditing active */ |
133 | #define TIF_SECCOMP 7 /* secure computing */ | 133 | #define TIF_SECCOMP 7 /* secure computing */ |
134 | #define TIF_RESTORE_SIGMASK 8 /* restore signal mask in do_signal() */ | ||
135 | #define TIF_HRTICK_RESCHED 9 /* reprogram hrtick timer */ | 134 | #define TIF_HRTICK_RESCHED 9 /* reprogram hrtick timer */ |
136 | #define TIF_MEMDIE 16 | 135 | #define TIF_MEMDIE 16 |
137 | #define TIF_DEBUG 17 /* uses debug registers */ | 136 | #define TIF_DEBUG 17 /* uses debug registers */ |
@@ -151,7 +150,6 @@ static inline struct thread_info *current_thread_info(void) | |||
151 | #define _TIF_SYSCALL_EMU (1 << TIF_SYSCALL_EMU) | 150 | #define _TIF_SYSCALL_EMU (1 << TIF_SYSCALL_EMU) |
152 | #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) | 151 | #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) |
153 | #define _TIF_SECCOMP (1 << TIF_SECCOMP) | 152 | #define _TIF_SECCOMP (1 << TIF_SECCOMP) |
154 | #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) | ||
155 | #define _TIF_HRTICK_RESCHED (1 << TIF_HRTICK_RESCHED) | 153 | #define _TIF_HRTICK_RESCHED (1 << TIF_HRTICK_RESCHED) |
156 | #define _TIF_DEBUG (1 << TIF_DEBUG) | 154 | #define _TIF_DEBUG (1 << TIF_DEBUG) |
157 | #define _TIF_IO_BITMAP (1 << TIF_IO_BITMAP) | 155 | #define _TIF_IO_BITMAP (1 << TIF_IO_BITMAP) |
@@ -188,9 +186,20 @@ static inline struct thread_info *current_thread_info(void) | |||
188 | this quantum (SMP) */ | 186 | this quantum (SMP) */ |
189 | #define TS_POLLING 0x0002 /* True if in idle loop | 187 | #define TS_POLLING 0x0002 /* True if in idle loop |
190 | and not sleeping */ | 188 | and not sleeping */ |
189 | #define TS_RESTORE_SIGMASK 0x0004 /* restore signal mask in do_signal() */ | ||
191 | 190 | ||
192 | #define tsk_is_polling(t) (task_thread_info(t)->status & TS_POLLING) | 191 | #define tsk_is_polling(t) (task_thread_info(t)->status & TS_POLLING) |
193 | 192 | ||
193 | #ifndef __ASSEMBLY__ | ||
194 | #define HAVE_SET_RESTORE_SIGMASK 1 | ||
195 | static inline void set_restore_sigmask(void) | ||
196 | { | ||
197 | struct thread_info *ti = current_thread_info(); | ||
198 | ti->status |= TS_RESTORE_SIGMASK; | ||
199 | set_bit(TIF_SIGPENDING, &ti->flags); | ||
200 | } | ||
201 | #endif /* !__ASSEMBLY__ */ | ||
202 | |||
194 | #endif /* __KERNEL__ */ | 203 | #endif /* __KERNEL__ */ |
195 | 204 | ||
196 | #endif /* _ASM_THREAD_INFO_H */ | 205 | #endif /* _ASM_THREAD_INFO_H */ |
diff --git a/include/asm-x86/thread_info_64.h b/include/asm-x86/thread_info_64.h index ed664e874dec..cb69f70abba1 100644 --- a/include/asm-x86/thread_info_64.h +++ b/include/asm-x86/thread_info_64.h | |||
@@ -109,7 +109,6 @@ static inline struct thread_info *stack_thread_info(void) | |||
109 | #define TIF_IRET 5 /* force IRET */ | 109 | #define TIF_IRET 5 /* force IRET */ |
110 | #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ | 110 | #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ |
111 | #define TIF_SECCOMP 8 /* secure computing */ | 111 | #define TIF_SECCOMP 8 /* secure computing */ |
112 | #define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal */ | ||
113 | #define TIF_MCE_NOTIFY 10 /* notify userspace of an MCE */ | 112 | #define TIF_MCE_NOTIFY 10 /* notify userspace of an MCE */ |
114 | #define TIF_HRTICK_RESCHED 11 /* reprogram hrtick timer */ | 113 | #define TIF_HRTICK_RESCHED 11 /* reprogram hrtick timer */ |
115 | /* 16 free */ | 114 | /* 16 free */ |
@@ -133,7 +132,6 @@ static inline struct thread_info *stack_thread_info(void) | |||
133 | #define _TIF_IRET (1 << TIF_IRET) | 132 | #define _TIF_IRET (1 << TIF_IRET) |
134 | #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) | 133 | #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) |
135 | #define _TIF_SECCOMP (1 << TIF_SECCOMP) | 134 | #define _TIF_SECCOMP (1 << TIF_SECCOMP) |
136 | #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) | ||
137 | #define _TIF_MCE_NOTIFY (1 << TIF_MCE_NOTIFY) | 135 | #define _TIF_MCE_NOTIFY (1 << TIF_MCE_NOTIFY) |
138 | #define _TIF_HRTICK_RESCHED (1 << TIF_HRTICK_RESCHED) | 136 | #define _TIF_HRTICK_RESCHED (1 << TIF_HRTICK_RESCHED) |
139 | #define _TIF_IA32 (1 << TIF_IA32) | 137 | #define _TIF_IA32 (1 << TIF_IA32) |
@@ -178,9 +176,20 @@ static inline struct thread_info *stack_thread_info(void) | |||
178 | #define TS_COMPAT 0x0002 /* 32bit syscall active */ | 176 | #define TS_COMPAT 0x0002 /* 32bit syscall active */ |
179 | #define TS_POLLING 0x0004 /* true if in idle loop | 177 | #define TS_POLLING 0x0004 /* true if in idle loop |
180 | and not sleeping */ | 178 | and not sleeping */ |
179 | #define TS_RESTORE_SIGMASK 0x0008 /* restore signal mask in do_signal() */ | ||
181 | 180 | ||
182 | #define tsk_is_polling(t) (task_thread_info(t)->status & TS_POLLING) | 181 | #define tsk_is_polling(t) (task_thread_info(t)->status & TS_POLLING) |
183 | 182 | ||
183 | #ifndef __ASSEMBLY__ | ||
184 | #define HAVE_SET_RESTORE_SIGMASK 1 | ||
185 | static inline void set_restore_sigmask(void) | ||
186 | { | ||
187 | struct thread_info *ti = current_thread_info(); | ||
188 | ti->status |= TS_RESTORE_SIGMASK; | ||
189 | set_bit(TIF_SIGPENDING, &ti->flags); | ||
190 | } | ||
191 | #endif /* !__ASSEMBLY__ */ | ||
192 | |||
184 | #endif /* __KERNEL__ */ | 193 | #endif /* __KERNEL__ */ |
185 | 194 | ||
186 | #endif /* _ASM_THREAD_INFO_H */ | 195 | #endif /* _ASM_THREAD_INFO_H */ |