Skip to content

Commit

Permalink
[PATCH] i386: avoid redundant preempt_disable in __unlazy_fpu
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Andi Kleen <ak@suse.de>
  • Loading branch information
Jan Kiszka authored and Andi Kleen committed May 2, 2007
1 parent 02b64da commit c41bf8f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions include/asm-i386/i387.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ static inline void __save_init_fpu( struct task_struct *tsk )
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 ) \
Expand Down

0 comments on commit c41bf8f

Please sign in to comment.