Re: [Lse-tech] Re: efficient copy_to_user and copy_from_user routines in Linux Kernel

Andi Kleen (ak@suse.de)
Wed, 26 Jun 2002 14:58:22 +0200


On Tue, Jun 25, 2002 at 09:11:27PM +0200, Dave Jones wrote:
> On Tue, Jun 25, 2002 at 01:58:01PM -0500, Niels Christiansen wrote:
>
> > Maybe it is time to see if the compiler has improved enough to
> > scrap the copy code in the kernel in favor of code as generated by the
> > compiler.
>
> This came up about a month ago. I'll repeat what I said then.
> "I'll believe it when I see it".

Just look at the x86-64 port (2.5)

The code generated by gcc 3.1 is a lot better than the inline macros.
For example it knows the alignment of target/source and emits
unrolled big (4,2,1bytes) moves and some tricks.
We're using that on x86-64. For tricky cases (it cannot determine length
or alignment) it'll still call out to out of line functions, which
should be optimized, notably not just use rep ; s... like the inline macros
which isn't very efficient on Athlon.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/