Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751193AbbECRkN (ORCPT ); Sun, 3 May 2015 13:40:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42603 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750961AbbECRkF (ORCPT ); Sun, 3 May 2015 13:40:05 -0400 Date: Sun, 3 May 2015 19:39:17 +0200 From: Oleg Nesterov To: Bobby Powers Cc: Ingo Molnar , Kernel development list , x86@kernel.org, Andi Kleen , Borislav Petkov , Andy Lutomirski , Dave Hansen , Fenghua Yu , Linus Torvalds , Pekka Riikonen , Quentin Casasnovas , Rik van Riel , Suresh Siddha Subject: Re: [PATCH v2] x86/fpu: always restore_xinit_state() when use_eager_cpu() Message-ID: <20150503173917.GB22052@redhat.com> References: <20150427144931.GA25690@redhat.com> <1430147441-9820-1-git-send-email-bobbypowers@gmail.com> <20150427151946.GA28094@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3450 Lines: 95 On 05/02, Bobby Powers wrote: > > Hello, > > Oleg Nesterov wrote: > > Thanks! > > Dave gave this his: > > Tested-By: Dave Hansen > > over under v1 of this patch: > https://lkml.kernel.org/g/5543C277.9070208@intel.com > > Anything else anyone sees, or anyone in particular I have to poke at > to get this in? Ingo? Yes, please, 4.1 needs this patch. Borislav, perhaps you can help ? > > yours, > Bobby > > On Mon, Apr 27, 2015 at 11:19 AM, Oleg Nesterov wrote: > > Thanks! > > > > On 04/27, Bobby Powers wrote: > >> > >> v2: switch used_math() -> tsk_used_math(tsk) to consistently use the > >> grabbed tsk instead of current, like in the rest of flush_thread(). > >> > >> Oleg's commit f893959b ("x86/fpu: Don't abuse drop_init_fpu() in > >> flush_thread()") removed drop_init_fpu() usage from flush_thread. > >> This seems to break things for me - the Go 1.4 test suite fails all > >> over the place with floating point comparision errors (offending > >> commit found through bisection). > >> > >> The functional change was that flush_thread after f893959b only calls > >> restore_init_xstate when both use_eager_fpu() and !used_math() are > >> true. drop_init_fpu (now fpu_reset_state) calls restore_init_xstate() > >> regardless of whether current used_math() - apply the same logic here. > >> > >> Fixes: f893959b ("x86/fpu: Don't abuse drop_init_fpu() in flush_thread()") > >> Signed-off-by: Bobby Powers > >> Acked-by: Oleg Nesterov > >> Cc: Andi Kleen > >> Cc: Borislav Petkov > >> Cc: Ingo Molnar > >> Cc: Andy Lutomirski > >> Cc: Dave Hansen > >> Cc: Fenghua Yu > >> Cc: Linus Torvalds > >> Cc: Pekka Riikonen > >> Cc: Quentin Casasnovas > >> Cc: Rik van Riel > >> Cc: Suresh Siddha > >> --- > >> arch/x86/kernel/process.c | 12 +++++++----- > >> 1 file changed, 7 insertions(+), 5 deletions(-) > >> > >> diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c > >> index 8213da6..1a6fcf8 100644 > >> --- a/arch/x86/kernel/process.c > >> +++ b/arch/x86/kernel/process.c > >> @@ -156,11 +156,13 @@ void flush_thread(void) > >> /* FPU state will be reallocated lazily at the first use. */ > >> drop_fpu(tsk); > >> free_thread_xstate(tsk); > >> - } else if (!used_math()) { > >> - /* kthread execs. TODO: cleanup this horror. */ > >> - if (WARN_ON(init_fpu(tsk))) > >> - force_sig(SIGKILL, tsk); > >> - user_fpu_begin(); > >> + } else { > >> + if (!tsk_used_math(tsk)) { > >> + /* kthread execs. TODO: cleanup this horror. */ > >> + if (WARN_ON(init_fpu(tsk))) > >> + force_sig(SIGKILL, tsk); > >> + user_fpu_begin(); > >> + } > >> restore_init_xstate(); > >> } > >> } > >> -- > >> 2.3.6 > >> > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/