diff options
Diffstat (limited to 'arch/x86/kernel/process_64.c')
-rw-r--r-- | arch/x86/kernel/process_64.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index dd349c92f051..dc534f40c8d3 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c | |||
@@ -661,8 +661,11 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) | |||
661 | /* If the task has used fpu the last 5 timeslices, just do a full | 661 | /* If the task has used fpu the last 5 timeslices, just do a full |
662 | * restore of the math state immediately to avoid the trap; the | 662 | * restore of the math state immediately to avoid the trap; the |
663 | * chances of needing FPU soon are obviously high now | 663 | * chances of needing FPU soon are obviously high now |
664 | * | ||
665 | * tsk_used_math() checks prevent calling math_state_restore(), | ||
666 | * which can sleep in the case of !tsk_used_math() | ||
664 | */ | 667 | */ |
665 | if (next_p->fpu_counter>5) | 668 | if (tsk_used_math(next_p) && next_p->fpu_counter > 5) |
666 | math_state_restore(); | 669 | math_state_restore(); |
667 | return prev_p; | 670 | return prev_p; |
668 | } | 671 | } |