Subject: Re: bcopy, bzero, copypage, and zeropage
To: David S. Miller <davem@jenolan.rutgers.edu>
From: Chris G Demetriou <Chris_G_Demetriou@auchentoshan.pdl.cs.cmu.edu>
List: tech-kern
Date: 12/14/1996 13:52:29
> Why not include all of the routines, set aside enough space in the
> "real" routines for the largest of all the possible routines, which is
> just full of nops, and self modify that code space with the routine
> you want to use? Zero overhead execution time wise. If space is a
> concern, put each possible routine in a page aligned full page of
> space, once the routine you want has been copied into it's final
> destination you can give back all that space to the pager.
And all of a sudden, tracebacks and post-mortem debugging become so
much less useful and/or harder...
(Something like this was actually suggested in another forum
yesterday(?) by jonathan stone, as well... And i still dislike it. 8-)
Note that this affects only GENERIC kernels. For machine-specific
kernels, which people should be using, anyway, in my opinion, there is
no overhead whatsoever. That philosophy, and the fact that it's been
part of BSD "forever," is a good reason to run specific kernels.
GENERIC kernels are used e.g. for distributions. You don't
particularly want trickery there. Also, if somebody's trying to run
them on a new machine, and gets a crash, you want that crash to be
absolutely as debuggable as possible, so that if it's a stupid mistake
you can fix it and not have them testing kernels ad infinitum...
While self-modifying code may have advantages, in my opinion this
isn't a place where the advantages outweigh the disadvantages.
chris