Skip to contentSkip to conversation

i386: avoid redundant preempt_disable in __unlazy_fpu

PATCH In review Jan Kiszka 2 participants 2 messages Apr 30, 2007

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 i386: avoid redundant preempt_disable in __unlazy_fpu

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.

---
 include/asm-i386/i387.h |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
include/asm-i386/i387.h +6 -5
Index: 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 )					\
#1 lore raw
Quoted 3 lines · 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