From: Jens Axboe <axboe@kernel.dk>
To: Linus Torvalds <torvalds@linux-foundation.org>, pabeni@redhat.com
Cc: Ingo Molnar <mingo@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>,
bp@alien8.de, Peter Anvin <hpa@zytor.com>,
the arch/x86 maintainers <x86@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Andrew Lutomirski <luto@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
dvlasenk@redhat.com, brgerst@gmail.com,
Linux List Kernel Mailing <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86: only use ERMS for user copies for larger sizes
Date: Fri, 23 Nov 2018 23:09:24 -0700 [thread overview]
Message-ID: <3f739385-5bc5-6061-cf49-00c92ded3166@kernel.dk> (raw)
In-Reply-To: <CAHk-=wjweUiVewcnk39mUccEN-SjxHeTZdB3VOXZrvvW4Cs3dw@mail.gmail.com>
On 11/21/18 11:16 AM, Linus Torvalds wrote:
> On Wed, Nov 21, 2018 at 9:27 AM Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
>>
>> It would be interesting to know exactly which copy it is that matters
>> so much... *inlining* the erms case might show that nicely in
>> profiles.
>
> Side note: the fact that Jens' patch (which I don't like in that form)
> allegedly shrunk the resulting kernel binary would seem to indicate
> that there's a *lot* of compile-time constant-sized memcpy calls that
> we are missing, and that fall back to copy_user_generic().
Other kind of side note... This also affects memset(), which does
rep stosb if we have ERMS if any size memset. I noticed this from
sg_init_table(), which does a memset of the table. For my kind of
testing, the entry size is small. The below, too, reduces memset()
overhead by 50% here for me.
diff --git a/arch/x86/lib/memset_64.S b/arch/x86/lib/memset_64.S
index 9bc861c71e75..bad0fdb9ddcd 100644
--- a/arch/x86/lib/memset_64.S
+++ b/arch/x86/lib/memset_64.S
@@ -60,6 +60,8 @@ EXPORT_SYMBOL(__memset)
* rax original destination
*/
ENTRY(memset_erms)
+ cmpl $128,%edx
+ jb memset_orig
movq %rdi,%r9
movb %sil,%al
movq %rdx,%rcx
--
Jens Axboe
prev parent reply other threads:[~2018-11-24 6:09 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <02bfc577-32a5-66be-64bf-d476b7d447d2@kernel.dk>
2018-11-20 20:24 ` Jens Axboe
2018-11-21 6:36 ` Ingo Molnar
2018-11-21 13:32 ` Jens Axboe
2018-11-21 13:44 ` Denys Vlasenko
2018-11-22 17:36 ` David Laight
2018-11-22 17:52 ` Linus Torvalds
2018-11-22 18:06 ` Andy Lutomirski
2018-11-22 18:58 ` Linus Torvalds
2018-11-23 9:34 ` David Laight
2018-11-23 10:12 ` David Laight
2018-11-23 16:36 ` Linus Torvalds
2018-11-23 17:42 ` Linus Torvalds
2018-11-23 18:39 ` Andy Lutomirski
2018-11-23 18:44 ` Linus Torvalds
2018-11-23 19:11 ` Andy Lutomirski
2018-11-26 10:12 ` David Laight
2018-11-26 10:01 ` David Laight
2018-11-26 10:26 ` David Laight
2019-01-05 2:38 ` Linus Torvalds
2019-01-07 9:55 ` David Laight
2019-01-07 17:43 ` Linus Torvalds
2019-01-08 9:10 ` David Laight
2019-01-08 18:01 ` Linus Torvalds
2018-11-21 13:45 ` Paolo Abeni
2018-11-21 17:27 ` Linus Torvalds
2018-11-21 18:04 ` Jens Axboe
2018-11-21 18:26 ` Andy Lutomirski
2018-11-21 18:43 ` Linus Torvalds
2018-11-21 22:38 ` Andy Lutomirski
2018-11-21 18:16 ` Linus Torvalds
2018-11-21 19:01 ` Linus Torvalds
2018-11-22 10:32 ` Ingo Molnar
2018-11-22 11:13 ` Ingo Molnar
2018-11-22 11:21 ` Ingo Molnar
2018-11-23 16:40 ` Josh Poimboeuf
2018-11-22 16:55 ` Linus Torvalds
2018-11-22 17:26 ` Andy Lutomirski
2018-11-22 17:35 ` Linus Torvalds
2018-11-24 6:09 ` Jens Axboe [this message]
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=3f739385-5bc5-6061-cf49-00c92ded3166@kernel.dk \
--to=axboe@kernel.dk \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=brgerst@gmail.com \
--cc=dvlasenk@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=pabeni@redhat.com \
--cc=tglx@linutronix.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome