aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/process_32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/process_32.c')
-rw-r--r--arch/x86/kernel/process_32.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index a30aa1f2607a..61f7481c31dd 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -652,8 +652,11 @@ struct task_struct * __switch_to(struct task_struct *prev_p, struct task_struct
652 /* If the task has used fpu the last 5 timeslices, just do a full 652 /* If the task has used fpu the last 5 timeslices, just do a full
653 * restore of the math state immediately to avoid the trap; the 653 * restore of the math state immediately to avoid the trap; the
654 * chances of needing FPU soon are obviously high now 654 * chances of needing FPU soon are obviously high now
655 *
656 * tsk_used_math() checks prevent calling math_state_restore(),
657 * which can sleep in the case of !tsk_used_math()
655 */ 658 */
656 if (next_p->fpu_counter > 5) 659 if (tsk_used_math(next_p) && next_p->fpu_counter > 5)
657 math_state_restore(); 660 math_state_restore();
658 661
659 /* 662 /*