From: Oleg Nesterov <oleg@redhat.com>
To: Bobby Powers <bobbypowers@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>,
Kernel development list <linux-kernel@vger.kernel.org>,
x86@kernel.org, Andi Kleen <ak@linux.intel.com>,
Borislav Petkov <bp@suse.de>,
Andy Lutomirski <luto@amacapital.net>,
Dave Hansen <dave.hansen@intel.com>,
Fenghua Yu <fenghua.yu@intel.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Pekka Riikonen <priikone@iki.fi>,
Quentin Casasnovas <quentin.casasnovas@oracle.com>,
Rik van Riel <riel@redhat.com>,
Suresh Siddha <sbsiddha@gmail.com>
Subject: Re: [PATCH v2] x86/fpu: always restore_xinit_state() when use_eager_cpu()
Date: Sun, 3 May 2015 19:39:17 +0200 [thread overview]
Message-ID: <20150503173917.GB22052@redhat.com> (raw)
In-Reply-To: <CAArOQ2U7fZyEGEbmXW5Ge1E1_fVCruOA-YLSLpY04jPxYUehKQ@mail.gmail.com>
On 05/02, Bobby Powers wrote:
>
> Hello,
>
> Oleg Nesterov <oleg@redhat.com> wrote:
> > Thanks!
>
> Dave gave this his:
>
> Tested-By: Dave Hansen <dave.hansen@intel.com>
>
> 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 <oleg@redhat.com> 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 <bobbypowers@gmail.com>
> >> Acked-by: Oleg Nesterov <oleg@redhat.com>
> >> Cc: Andi Kleen <ak@linux.intel.com>
> >> Cc: Borislav Petkov <bp@suse.de>
> >> Cc: Ingo Molnar <mingo@kernel.org>
> >> Cc: Andy Lutomirski <luto@amacapital.net>
> >> Cc: Dave Hansen <dave.hansen@intel.com>
> >> Cc: Fenghua Yu <fenghua.yu@intel.com>
> >> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> >> Cc: Pekka Riikonen <priikone@iki.fi>
> >> Cc: Quentin Casasnovas <quentin.casasnovas@oracle.com>
> >> Cc: Rik van Riel <riel@redhat.com>
> >> Cc: Suresh Siddha <sbsiddha@gmail.com>
> >> ---
> >> 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
> >>
> >
next prev parent reply other threads:[~2015-05-03 17:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-26 22:04 [PATCH] x86/fpu: always restore_xinit_state() when !use_eager_cpu() Bobby Powers
2015-04-27 14:46 ` Dave Hansen
2015-04-27 15:00 ` Oleg Nesterov
2015-05-01 18:14 ` Dave Hansen
2015-04-27 14:49 ` Oleg Nesterov
2015-04-27 14:58 ` Bobby Powers
2015-04-27 15:10 ` [PATCH v2] x86/fpu: always restore_xinit_state() when use_eager_cpu() Bobby Powers
2015-04-27 15:19 ` Oleg Nesterov
2015-05-02 20:42 ` Bobby Powers
2015-05-03 17:39 ` Oleg Nesterov [this message]
2015-05-04 8:11 ` Borislav Petkov
2015-05-06 10:14 ` [tip:x86/urgent] x86/fpu: Always " tip-bot for Bobby Powers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150503173917.GB22052@redhat.com \
--to=oleg@redhat.com \
--cc=ak@linux.intel.com \
--cc=bobbypowers@gmail.com \
--cc=bp@suse.de \
--cc=dave.hansen@intel.com \
--cc=fenghua.yu@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@kernel.org \
--cc=priikone@iki.fi \
--cc=quentin.casasnovas@oracle.com \
--cc=riel@redhat.com \
--cc=sbsiddha@gmail.com \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.