x86/fpu: Remove the free_thread_xstate() complication
authorIngo Molnar <mingo@kernel.org>
Wed, 22 Apr 2015 09:44:46 +0000 (11:44 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 19 May 2015 13:47:17 +0000 (15:47 +0200)
Use fpstate_free() directly to manage FPU state.

Only process.c was using this method, so this is a speedup as well,
as it removes the extra function call and related clobbers.

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>
arch/x86/include/asm/processor.h
arch/x86/kernel/process.c

index 6b75c4b927ec018e8f6f7fc7739785b3d3ba1509..fef8db024ece7e6910821fa1b202000391e338cf 100644 (file)
@@ -362,7 +362,6 @@ DECLARE_PER_CPU(struct irq_stack *, softirq_stack);
 #endif /* X86_64 */
 
 extern unsigned int xstate_size;
-extern void free_thread_xstate(struct task_struct *);
 extern struct kmem_cache *task_xstate_cachep;
 
 struct perf_event;
index 35d0f19255242679e71d9d7e0e037beb93f54654..6ab180f40a7ea2d47422c361e350db9987d4375f 100644 (file)
@@ -99,14 +99,9 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
        return 0;
 }
 
-void free_thread_xstate(struct task_struct *tsk)
-{
-       fpstate_free(&tsk->thread.fpu);
-}
-
 void arch_release_task_struct(struct task_struct *tsk)
 {
-       free_thread_xstate(tsk);
+       fpstate_free(&tsk->thread.fpu);
 }
 
 void arch_task_cache_init(void)
@@ -154,7 +149,7 @@ void flush_thread(void)
        if (!use_eager_fpu()) {
                /* FPU state will be reallocated lazily at the first use. */
                drop_fpu(tsk);
-               free_thread_xstate(tsk);
+               fpstate_free(&tsk->thread.fpu);
        } else {
                if (!tsk_used_math(tsk)) {
                        /* kthread execs. TODO: cleanup this horror. */