From: "H. Peter Anvin" <hpa@zytor.com>
To: Joris van Rantwijk <jorispubl@xs4all.nl>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Inflation of vmlinux by linker on x86_64
Date: Fri, 26 Sep 2008 13:07:11 -0700 [thread overview]
Message-ID: <48DD40EF.4000107@zytor.com> (raw)
In-Reply-To: <eb34240721c0b92818908672eccecf62@xs4all.nl>
Joris van Rantwijk wrote:
>
> On 26 sep 2008, at 20:52, H. Peter Anvin wrote:
>> Instead of adding a comment like this, we should simply rename it
>> memmove().
>
> Yes. I tried, but it clashed with an existing memmove declaration in
> asm-x86/string_32.h.
>
> What is the accepted solution for this?
> Redefining memmove should be allowed, but then it could no longer be a
> static function.
> Using the memmove implementation from the main kernel would be painful
> and ugly.
> We could also define "__memmove()" plus "#define memmove __memmove",
> which would also be ugly.
>
>> Furthermore, we probably spend enough time copying that using a real
>> memmove() implementation, using string instructions, would be good.
>
> Are string instructions that much faster?
> We can also get some speedup by copying ints instead of chars.
>
String instructions are indeed very much faster, especially on recent
hardware where they are optimized in microcode.
In this case, I think the easiest thing to do is to provide an optimized
memmove and not making it a static function. I have a reasonably
optimized memmove in 32-bit assembly at:
http://git.kernel.org/?p=boot/syslinux/syslinux.git;a=blob;f=com32/lib/memmove.S;hb=HEAD
A 64-bit implementation can be done on similar principles.
-hpa
next prev parent reply other threads:[~2008-09-26 20:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-26 12:42 Inflation of vmlinux by linker on x86_64 Joris van Rantwijk
2008-09-26 18:52 ` H. Peter Anvin
2008-09-26 19:50 ` Joris van Rantwijk
2008-09-26 20:07 ` H. Peter Anvin [this message]
2008-09-26 21:55 ` Joris van Rantwijk
2008-09-26 21:57 ` 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=48DD40EF.4000107@zytor.com \
--to=hpa@zytor.com \
--cc=jorispubl@xs4all.nl \
--cc=linux-kernel@vger.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.