* Forget coprocessor state..
*/
preempt_disable();
- tsk->thread.fpu_counter = 0;
+ tsk->thread.fpu.counter = 0;
if (__thread_has_fpu(tsk)) {
/* Ignore delayed exceptions from user space */
* or if the past 5 consecutive context-switches used math.
*/
fpu.preload = tsk_used_math(new) &&
- (use_eager_fpu() || new->thread.fpu_counter > 5);
+ (use_eager_fpu() || new->thread.fpu.counter > 5);
if (__thread_has_fpu(old)) {
if (!__save_init_fpu(old))
/* Don't change CR0.TS if we just switch! */
if (fpu.preload) {
- new->thread.fpu_counter++;
+ new->thread.fpu.counter++;
__thread_set_has_fpu(new);
prefetch(new->thread.fpu.state);
} else if (!use_eager_fpu())
stts();
} else {
- old->thread.fpu_counter = 0;
+ old->thread.fpu.counter = 0;
task_disable_lazy_fpu_restore(old);
if (fpu.preload) {
- new->thread.fpu_counter++;
+ new->thread.fpu.counter++;
if (fpu_lazy_restore(new, cpu))
fpu.preload = 0;
else
unsigned int last_cpu;
unsigned int has_fpu;
union thread_xstate *state;
+ /*
+ * This counter contains the number of consecutive context switches
+ * that the FPU is used. If this is over a threshold, the lazy fpu
+ * saving becomes unlazy to save the trap. This is an unsigned char
+ * so that after 256 times the counter wraps and the behavior turns
+ * lazy again; this to deal with bursty apps that only use FPU for
+ * a short time
+ */
+ unsigned char counter;
};
#ifdef CONFIG_X86_64
unsigned long iopl;
/* Max allowed port in the bitmap, in bytes: */
unsigned io_bitmap_max;
- /*
- * fpu_counter contains the number of consecutive context switches
- * that the FPU is used. If this is over a threshold, the lazy fpu
- * saving becomes unlazy to save the trap. This is an unsigned char
- * so that after 256 times the counter wraps and the behavior turns
- * lazy again; this to deal with bursty apps that only use FPU for
- * a short time
- */
- unsigned char fpu_counter;
};
/*
{
*dst = *src;
- dst->thread.fpu_counter = 0;
+ dst->thread.fpu.counter = 0;
dst->thread.fpu.has_fpu = 0;
dst->thread.fpu.state = NULL;
task_disable_lazy_fpu_restore(dst);