summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2015-05-27 12:22:29 +0200
committerIngo Molnar <mingo@kernel.org>2015-05-27 14:11:25 +0200
commit9ba6b79102a594293c79f30319cabf476c5e300e (patch)
tree7e8c24ce19756a1a10680f7adbc03475fb690e6b
parent0560281266b313400b622c5ddfafb0ee8e59c702 (diff)
downloadtalos-obmc-linux-9ba6b79102a594293c79f30319cabf476c5e300e.tar.gz
talos-obmc-linux-9ba6b79102a594293c79f30319cabf476c5e300e.zip
x86/fpu: Optimize fpu__activate_fpstate_read()
fpu__activate_fpstate_read() is used before FPU registers are read from the fpstate by ptrace and core dumping. It's not necessary to unlazy non-current child tasks in this case, since the reading of registers is non-destructive. Cc: Andy Lutomirski <luto@amacapital.net> Cc: Bobby Powers <bobbypowers@gmail.com> 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: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/kernel/fpu/core.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c
index 174add372bb8..06cb7e3e9886 100644
--- a/arch/x86/kernel/fpu/core.c
+++ b/arch/x86/kernel/fpu/core.c
@@ -312,10 +312,7 @@ void fpu__activate_fpstate_read(struct fpu *fpu)
if (fpu->fpregs_active) {
fpu__save(fpu);
} else {
- if (fpu->fpstate_active) {
- /* Invalidate any lazy state: */
- fpu->last_cpu = -1;
- } else {
+ if (!fpu->fpstate_active) {
fpstate_init(&fpu->state);
/* Safe to do for current and for stopped child tasks: */
OpenPOWER on IntegriCloud