Re: copy_from_user() fix

Savochkin Andrey Vladimirovich (saw@msu.ru)
Sun, 23 Aug 1998 16:33:29 +0400


On Sun, Aug 23, 1998 at 12:03:55PM +0200, Andi Kleen wrote:
> Wouldn't it be better to do the zeroing out of line? EFAULT isn't a
> path worth optimizing for, and doing it with inline code in .fixup for
> every copy bloats the kernel a lot. I think it would be better to just put a
> call to a common zero function into .fixup.
>
> As some data: my current kernel contains about 215 __copy_*_user() calls,
> if you only add 30 bytes per call then that is about 6KB alone.

I've just done my own calculation.

__copy_to_user was kept unmodified.
__copy_from_user is mentioned in architecture independent and i386 specific
sources about 20 times.

My vmlinux has 72 "stosl" instructions in .fixup entries clearing the memory.
Most of them is in groups of 11-12 bytes of the extra code.
The call instruction takes 5 bytes.
For my configuration calls in .fixup entries would save me about 500 bytes
against the current implementation.

I haven't heard Linus' opinion at all. If he wishes I'll do a new patch.

Best wishes
Andrey V.
Savochkin

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html