]> git.karo-electronics.de Git - karo-tx-linux.git/commit
x86/fpu: Change fpu->fpregs_active from 'int' to 'char', add lazy switching comments
authorIngo Molnar <mingo@kernel.org>
Fri, 1 May 2015 07:59:04 +0000 (09:59 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 19 May 2015 13:48:09 +0000 (15:48 +0200)
commitaeb997b9f2a2199c72b89b7a304cafc394e4202b
treea9b963ffe79fee076fe09196714ba99f5326d254
parentc47ada305de3803517ae64aa50686f644c5456fa
x86/fpu: Change fpu->fpregs_active from 'int' to 'char', add lazy switching comments

Improve the memory layout of 'struct fpu':

 - change ->fpregs_active from 'int' to 'char' - it's just a single flag
   and modern x86 CPUs can do efficient byte accesses.

 - pack related fields closer to each other: often 'fpu->state' will not be
   touched, while the other fields will - so pack them into a group.

Also add comments to each field, describing their purpose, and add
some background information about lazy restores.

Also fix an obsolete, lazy switching related comment in fpu_copy()'s description.

Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
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/fpu/types.h
arch/x86/kernel/fpu/core.c
arch/x86/kernel/fpu/xstate.c