Re: asm/uaccess.h reimplementation, patch. [was: Re: 2.1 kernel bloat revisited]

Alan Cox (alan@lxorguk.ukuu.org.uk)
Sun, 30 Mar 1997 13:14:33 +0100 (BST)


> > The big increase in the _ioctl() functions seem to suggest that the
> > new _user() user memory access primitives generate much more code
> > than the 2.0 routines.
> a simple access_ok() inline is ~30 bytes code.
>
> The problem is that we have to check two things runtime:
>
> 1) is this call done from kernel-space
> 2) if not then is the user-space pointer in user-space?

Sixty seconds of poking around answers the problem I think:

We have one set of calls (the fast inline ones) and two sets of uses of
it - the slow ioctl paths and the fast I/O paths. I suspect a lot of the
problem will take a walk if all the little used ioctl() paths used a
slow_copy_from_user() etc

A lot of the ioctl calls could be tidied up to use some form of generic
ioctl handler (look at BSD and learn for once ;)). Even tho we often don't
do size encoding a short routine to handle the parameter stuff would be
much cleaner for most ioctl calls.

Alan