aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/process_32.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-08 01:47:47 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-08 01:47:47 -0400
commit93022136fff9e6130aa128a5ed8a599e93ac813c (patch)
tree185390fb75a3d7423cc508610b76637c957205b9 /arch/x86/kernel/process_32.c
parentc49c412a47b5102516d3313d4eba38cb1e968721 (diff)
parentb7279469d66b55119784b8b9529c99c1955fe747 (diff)
Merge commit 'v2.6.26-rc9' into x86/cpu
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 ae4020486a97..c2a11d77b1b5 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -274,6 +274,7 @@ void flush_thread(void)
274 /* 274 /*
275 * Forget coprocessor state.. 275 * Forget coprocessor state..
276 */ 276 */
277 tsk->fpu_counter = 0;
277 clear_fpu(tsk); 278 clear_fpu(tsk);
278 clear_used_math(); 279 clear_used_math();
279} 280}
@@ -590,8 +591,11 @@ struct task_struct * __switch_to(struct task_struct *prev_p, struct task_struct
590 /* If the task has used fpu the last 5 timeslices, just do a full 591 /* If the task has used fpu the last 5 timeslices, just do a full
591 * restore of the math state immediately to avoid the trap; the 592 * restore of the math state immediately to avoid the trap; the
592 * chances of needing FPU soon are obviously high now 593 * chances of needing FPU soon are obviously high now
594 *
595 * tsk_used_math() checks prevent calling math_state_restore(),
596 * which can sleep in the case of !tsk_used_math()
593 */ 597 */
594 if (next_p->fpu_counter > 5) 598 if (tsk_used_math(next_p) && next_p->fpu_counter > 5)
595 math_state_restore(); 599 math_state_restore();
596 600
597 /* 601 /*