aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/process_32.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-06-25 06:32:01 -0400
committerIngo Molnar <mingo@elte.hu>2008-06-25 06:32:01 -0400
commitda7878d75b8520c9ae00d27dfbbce546a7bfdfbb (patch)
tree547fd497a80818a60ac36831377d5df97868173c /arch/x86/kernel/process_32.c
parent0e50a4c6ab94ffe7e5515b86b5df9e5abc8c6b13 (diff)
parent543cf4cb3fe6f6cae3651ba918b9c56200b257d0 (diff)
Merge branch 'linus' into x86/pebs
Diffstat (limited to 'arch/x86/kernel/process_32.c')
-rw-r--r--arch/x86/kernel/process_32.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 496ea3110aa2..b105c559a073 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -341,6 +341,7 @@ void flush_thread(void)
341 /* 341 /*
342 * Forget coprocessor state.. 342 * Forget coprocessor state..
343 */ 343 */
344 tsk->fpu_counter = 0;
344 clear_fpu(tsk); 345 clear_fpu(tsk);
345 clear_used_math(); 346 clear_used_math();
346} 347}
@@ -679,8 +680,11 @@ struct task_struct * __switch_to(struct task_struct *prev_p, struct task_struct
679 /* If the task has used fpu the last 5 timeslices, just do a full 680 /* If the task has used fpu the last 5 timeslices, just do a full
680 * restore of the math state immediately to avoid the trap; the 681 * restore of the math state immediately to avoid the trap; the
681 * chances of needing FPU soon are obviously high now 682 * chances of needing FPU soon are obviously high now
683 *
684 * tsk_used_math() checks prevent calling math_state_restore(),
685 * which can sleep in the case of !tsk_used_math()
682 */ 686 */
683 if (next_p->fpu_counter > 5) 687 if (tsk_used_math(next_p) && next_p->fpu_counter > 5)
684 math_state_restore(); 688 math_state_restore();
685 689
686 /* 690 /*