* [PATCH] i386: avoid redundant preempt_disable in __unlazy_fpu
@ 2007-04-30 11:16 Jan Kiszka
2007-04-30 11:23 ` Andi Kleen
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2007-04-30 11:16 UTC (permalink / raw)
To: linux-kernel; +Cc: Andi Kleen
[-- Attachment #1: Type: text/plain, Size: 1089 bytes --]
There are two callers of __unlazy_fpu, unlazy_fpu and __switch_to, and
none of them appear to require additional preempt_disable/enable here.
Let's open-code save_init_fpu in __unlazy_fpu to save a few ops.
Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
---
include/asm-i386/i387.h | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
Index: linux-2.6/include/asm-i386/i387.h
===================================================================
--- linux-2.6.orig/include/asm-i386/i387.h
+++ linux-2.6/include/asm-i386/i387.h
@@ -74,11 +74,12 @@ static inline void __save_init_fpu( stru
task_thread_info(tsk)->status &= ~TS_USEDFPU;
}
-#define __unlazy_fpu( tsk ) do { \
- if (task_thread_info(tsk)->status & TS_USEDFPU) \
- save_init_fpu( tsk ); \
- else \
- tsk->fpu_counter = 0; \
+#define __unlazy_fpu( tsk ) do { \
+ if (task_thread_info(tsk)->status & TS_USEDFPU) { \
+ __save_init_fpu(tsk); \
+ stts(); \
+ } else \
+ tsk->fpu_counter = 0; \
} while (0)
#define __clear_fpu( tsk ) \
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] i386: avoid redundant preempt_disable in __unlazy_fpu
2007-04-30 11:16 [PATCH] i386: avoid redundant preempt_disable in __unlazy_fpu Jan Kiszka
@ 2007-04-30 11:23 ` Andi Kleen
0 siblings, 0 replies; 2+ messages in thread
From: Andi Kleen @ 2007-04-30 11:23 UTC (permalink / raw)
To: Jan Kiszka; +Cc: linux-kernel
On Monday 30 April 2007 13:16:42 Jan Kiszka wrote:
> There are two callers of __unlazy_fpu, unlazy_fpu and __switch_to, and
> none of them appear to require additional preempt_disable/enable here.
> Let's open-code save_init_fpu in __unlazy_fpu to save a few ops.
Both patches added thanks
-Andi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-04-30 11:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-30 11:16 [PATCH] i386: avoid redundant preempt_disable in __unlazy_fpu Jan Kiszka
2007-04-30 11:23 ` Andi Kleen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox