aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/process_64.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_64.c
parentc49c412a47b5102516d3313d4eba38cb1e968721 (diff)
parentb7279469d66b55119784b8b9529c99c1955fe747 (diff)
Merge commit 'v2.6.26-rc9' into x86/cpu
Diffstat (limited to 'arch/x86/kernel/process_64.c')
-rw-r--r--arch/x86/kernel/process_64.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 9fb3a6fe863b..290183e9731a 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -263,6 +263,7 @@ void flush_thread(void)
263 /* 263 /*
264 * Forget coprocessor state.. 264 * Forget coprocessor state..
265 */ 265 */
266 tsk->fpu_counter = 0;
266 clear_fpu(tsk); 267 clear_fpu(tsk);
267 clear_used_math(); 268 clear_used_math();
268} 269}
@@ -627,8 +628,11 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
627 /* If the task has used fpu the last 5 timeslices, just do a full 628 /* If the task has used fpu the last 5 timeslices, just do a full
628 * restore of the math state immediately to avoid the trap; the 629 * restore of the math state immediately to avoid the trap; the
629 * chances of needing FPU soon are obviously high now 630 * chances of needing FPU soon are obviously high now
631 *
632 * tsk_used_math() checks prevent calling math_state_restore(),
633 * which can sleep in the case of !tsk_used_math()
630 */ 634 */
631 if (next_p->fpu_counter>5) 635 if (tsk_used_math(next_p) && next_p->fpu_counter > 5)
632 math_state_restore(); 636 math_state_restore();
633 return prev_p; 637 return prev_p;
634} 638}