mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 17:11:46 +00:00
x86/fpu: Get rid of PF_USED_MATH usage, convert it to fpu->fpstate_active
Introduce a simple fpu->fpstate_active flag in the fpu context data structure and use that instead of PF_USED_MATH in task->flags. Testing for this flag byte should be slightly more efficient than testing a bit in a bitmask, but the main advantage is that most FPU functions can now be performed on a 'struct fpu' alone, they don't need access to 'struct task_struct' anymore. There's a slight linecount increase, mostly due to the 'fpu' local variables and due to extra comments. The local variables will go away once we move most of the FPU methods to pure 'struct fpu' parameters. Reviewed-by: Borislav Petkov <bp@alien8.de> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
parent
af7f8721f1
commit
c5bedc6847
9 changed files with 54 additions and 28 deletions
|
@ -375,7 +375,7 @@ static inline void drop_fpu(struct task_struct *tsk)
|
|||
__thread_fpu_end(fpu);
|
||||
}
|
||||
|
||||
tsk->flags &= ~PF_USED_MATH;
|
||||
fpu->fpstate_active = 0;
|
||||
|
||||
preempt_enable();
|
||||
}
|
||||
|
@ -424,7 +424,7 @@ static inline fpu_switch_t switch_fpu_prepare(struct task_struct *old, struct ta
|
|||
* If the task has used the math, pre-load the FPU on xsave processors
|
||||
* or if the past 5 consecutive context-switches used math.
|
||||
*/
|
||||
fpu.preload = (new->flags & PF_USED_MATH) &&
|
||||
fpu.preload = new_fpu->fpstate_active &&
|
||||
(use_eager_fpu() || new->thread.fpu.counter > 5);
|
||||
|
||||
if (old_fpu->has_fpu) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue