From: Andy Lutomirski <luto@amacapital.net>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Ingo Molnar <mingo@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
Andy Lutomirski <luto@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 1/2] x86/nmi: Optimize the check for being in the repeat_nmi code
Date: Thu, 9 Mar 2017 19:50:57 -0800 [thread overview]
Message-ID: <CALCETrUFE0X89bmsO8-tcOjPgPXTVCM1URUSD+HaEsGesfq6XA@mail.gmail.com> (raw)
In-Reply-To: <B0A59A10-BA5C-42AA-A23B-4CF832E6B764@goodmis.org>
On Thu, Mar 9, 2017 at 7:49 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
>
>
> On March 9, 2017 9:42:57 PM EST, Andy Lutomirski <luto@amacapital.net> wrote:
>>On Thu, Mar 9, 2017 at 2:42 PM, Steven Rostedt <rostedt@goodmis.org>
>>wrote:
>>> From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
>>>
>>> Linus mentioned that doing two compares can be replaced by a single
>>> compare. That is, instead of:
>>>
>>> movq $repeat_nmi, %rdx
>>> cmpq 8(%rsp), %rdx
>>> ja not_in_region
>>> movq $end_repeat_nmi, %rdx
>>> cmpq 8(%rsp), %rdx
>>> ja in_region
>>>
>>> we can replace that with:
>>>
>>> movq 8(%rsp), %rdx
>>> subq $repeat_nmi, %rdx
>>> cmpq $end_repeat_nmi-repeat_nmi, %rdx
>>> jb in_region
>>
>>Seems reasonable to me. Good luck ever noticing the speedup :)
>>
>
> It had nothing to do with speedup. Linus said that the current code makes the assembly programmer in him die a little. I want to cure that.
>
One might argue that the world would be a better place if the assembly
programmer in some people died a little.
next prev parent reply other threads:[~2017-03-10 3:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-09 22:42 [PATCH 0/2] x86/nmi: Optimize address compares with better jump algorithm Steven Rostedt
2017-03-09 22:42 ` [PATCH 1/2] x86/nmi: Optimize the check for being in the repeat_nmi code Steven Rostedt
2017-03-10 2:42 ` Andy Lutomirski
2017-03-10 3:49 ` Steven Rostedt
2017-03-10 3:50 ` Andy Lutomirski [this message]
2017-03-10 7:20 ` Ingo Molnar
2017-03-10 19:00 ` Linus Torvalds
2017-03-10 19:03 ` Andy Lutomirski
2017-03-09 22:42 ` [PATCH 2/2] x86/nmi: Fix and optimize the NMI stack check code Steven Rostedt
2017-03-10 2:43 ` Andy Lutomirski
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=CALCETrUFE0X89bmsO8-tcOjPgPXTVCM1URUSD+HaEsGesfq6XA@mail.gmail.com \
--to=luto@amacapital.net \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).