diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-06-25 06:32:01 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-06-25 06:32:01 -0400 |
commit | da7878d75b8520c9ae00d27dfbbce546a7bfdfbb (patch) | |
tree | 547fd497a80818a60ac36831377d5df97868173c /arch/x86/kernel/process_64.c | |
parent | 0e50a4c6ab94ffe7e5515b86b5df9e5abc8c6b13 (diff) | |
parent | 543cf4cb3fe6f6cae3651ba918b9c56200b257d0 (diff) |
Merge branch 'linus' into x86/pebs
Diffstat (limited to 'arch/x86/kernel/process_64.c')
-rw-r--r-- | arch/x86/kernel/process_64.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index 4a93c98a60a2..a4ad0d7ea621 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c | |||
@@ -302,6 +302,7 @@ void flush_thread(void) | |||
302 | /* | 302 | /* |
303 | * Forget coprocessor state.. | 303 | * Forget coprocessor state.. |
304 | */ | 304 | */ |
305 | tsk->fpu_counter = 0; | ||
305 | clear_fpu(tsk); | 306 | clear_fpu(tsk); |
306 | clear_used_math(); | 307 | clear_used_math(); |
307 | } | 308 | } |
@@ -680,8 +681,11 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) | |||
680 | /* If the task has used fpu the last 5 timeslices, just do a full | 681 | /* If the task has used fpu the last 5 timeslices, just do a full |
681 | * restore of the math state immediately to avoid the trap; the | 682 | * restore of the math state immediately to avoid the trap; the |
682 | * chances of needing FPU soon are obviously high now | 683 | * chances of needing FPU soon are obviously high now |
684 | * | ||
685 | * tsk_used_math() checks prevent calling math_state_restore(), | ||
686 | * which can sleep in the case of !tsk_used_math() | ||
683 | */ | 687 | */ |
684 | if (next_p->fpu_counter>5) | 688 | if (tsk_used_math(next_p) && next_p->fpu_counter > 5) |
685 | math_state_restore(); | 689 | math_state_restore(); |
686 | return prev_p; | 690 | return prev_p; |
687 | } | 691 | } |