|
@@ -399,14 +399,17 @@ static inline void drop_init_fpu(struct task_struct *tsk)
|
|
|
typedef struct { int preload; } fpu_switch_t;
|
|
|
|
|
|
/*
|
|
|
- * FIXME! We could do a totally lazy restore, but we need to
|
|
|
- * add a per-cpu "this was the task that last touched the FPU
|
|
|
- * on this CPU" variable, and the task needs to have a "I last
|
|
|
- * touched the FPU on this CPU" and check them.
|
|
|
+ * Must be run with preemption disabled: this clears the fpu_owner_task,
|
|
|
+ * on this CPU.
|
|
|
*
|
|
|
- * We don't do that yet, so "fpu_lazy_restore()" always returns
|
|
|
- * false, but some day..
|
|
|
+ * This will disable any lazy FPU state restore of the current FPU state,
|
|
|
+ * but if the current thread owns the FPU, it will still be saved by.
|
|
|
*/
|
|
|
+static inline void __cpu_disable_lazy_restore(unsigned int cpu)
|
|
|
+{
|
|
|
+ per_cpu(fpu_owner_task, cpu) = NULL;
|
|
|
+}
|
|
|
+
|
|
|
static inline int fpu_lazy_restore(struct task_struct *new, unsigned int cpu)
|
|
|
{
|
|
|
return new == this_cpu_read_stable(fpu_owner_task) &&
|