From: "George Spelvin" <linux@horizon.com>
To: hpa@zytor.com
Cc: linux@horizon.com, linux-kernel@vger.kernel.org, sbsiddha@gmail.com
Subject: Re: [GIT PULL] x86 fixes for v3.14-rc6
Date: 8 Mar 2014 00:24:10 -0500 [thread overview]
Message-ID: <20140308052410.14411.qmail@science.horizon.com> (raw)
> The FPU stuff is still pending, I fear. I haven't heard anything from
> Suresh so I suspect I'm going to have to dig into the init specifics
> myself and fix up the patchset.
As I mentioned a couple of weeks ago in the "[PATCH] Make
math_state_restore() save and restore the interrupt flag" thread,
I've been running with just Suresh's second patch for the last month,
and it's cured all my symptoms.
Although, just as a minor style point, I might reduce the
number of levels if indentation by rewriting it as:
void __kernel_fpu_end(void)
{
- if (use_eager_fpu())
- math_state_restore();
- else
+ if (!use_eager_fpu()) {
stts();
+ } else if (likely(tsk_used_math(current)))
+ math_state_restore();
+ }
+ /*
+ * When using eager fpu, tsk_used_math() is almost always true,
+ * and we restore the user math state eagerly. In some special
+ * cases during thread exit, signal handling etc, tsk_used_math()
+ * is false. Those few places will take proper actions, so we
+ * don't need to restore the math here.
+ */
}
EXPORT_SYMBOL(__kernel_fpu_end);
Truthfully, the idea I like best is Linus's proposal to postpone all
such adjustments to the processor state until the return to user space,
so multiple kernel_fpu_begin()/_end() pairs become much cheaper:
http://marc.info/?l=linux-kernel&m=139128398717816
Hoerver, that deep into Here Be Dragons code is somewhere I fear to tread,
so I'm hoping someone braver than I is inspired.
next reply other threads:[~2014-03-08 5:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-08 5:24 George Spelvin [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-03-07 23:25 H. Peter Anvin
2014-03-08 3:03 ` Linus Torvalds
2014-03-08 3:34 ` H. Peter Anvin
2014-03-08 3:36 ` H. Peter Anvin
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=20140308052410.14411.qmail@science.horizon.com \
--to=linux@horizon.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sbsiddha@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®