From: "H. Peter Anvin" <hpa@zytor.com>
To: David Miller <davem@davemloft.net>
Cc: torvalds@linux-foundation.org, benh@kernel.crashing.org,
mingo@kernel.org, x86@kernel.org, linux-arch@vger.kernel.org
Subject: Re: x86: faster strncpy_from_user()
Date: Tue, 10 Apr 2012 16:33:48 -0700 [thread overview]
Message-ID: <4F84C35C.1020803@zytor.com> (raw)
In-Reply-To: <20120410.192935.289591767950787447.davem@davemloft.net>
On 04/10/2012 04:29 PM, David Miller wrote:
>
> Just wanted to mention that handling the detect zeroes operations on
> cpus that require alignment is easy, just rewind the pointer at the
> beginning to be aligned and "or" in a mask of 0xff for each alignment
> pad byte into the initially loaded word.
>
Even on machines which don't require alignment it will still be faster
to do aligned memory references only, not counting the startup cost
(which is substantial in this case, of course, since the average length
is so short.) However, it also neatly avoids the page overrun problem.
-hpa
next prev parent reply other threads:[~2012-04-10 23:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-06 21:32 x86: faster strncpy_from_user() Linus Torvalds
2012-04-06 21:49 ` Linus Torvalds
2012-04-10 22:35 ` Benjamin Herrenschmidt
2012-04-10 22:50 ` Linus Torvalds
2012-04-10 23:29 ` David Miller
2012-04-10 23:33 ` H. Peter Anvin [this message]
2012-04-10 23:56 ` Benjamin Herrenschmidt
2012-04-10 23:25 ` David Miller
2012-04-11 0:34 ` Linus Torvalds
2012-04-11 0:43 ` David Miller
2012-04-11 0:50 ` Linus Torvalds
2012-04-11 0:57 ` Linus Torvalds
2012-04-11 1:09 ` David Miller
2012-04-11 1:18 ` Linus Torvalds
2012-04-11 1:25 ` Benjamin Herrenschmidt
2012-04-11 8:22 ` Geert Uytterhoeven
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=4F84C35C.1020803@zytor.com \
--to=hpa@zytor.com \
--cc=benh@kernel.crashing.org \
--cc=davem@davemloft.net \
--cc=linux-arch@vger.kernel.org \
--cc=mingo@kernel.org \
--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