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

From: Andi Kleen (
Date: Wed Jun 26 2002 - 07:58:22 EST

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.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Sun Jun 30 2002 - 22:00:10 EST