Re: Possible kernel optimization

Tom Dyas (
Fri, 13 Dec 96 12:02:30 EST

> | heh :) when i first read the ELF standard i came up with the very same
> | idea ... then i was told that this idea is almost as old as Linux itself,
> | and that it comes up regularly on linux-kernel, but nobody has done it so
> | far.
> I would venture to guess that it is older than Linux. I first ran across it in
> 1975-1979 when I went to college and hacked on CDC 6[46]00 systems, where it
> was common to put the init code in the area you would use as buffers. I
> imagine that it is much older than that.

The SPARC port already implements the ability to throw init code and
data out the door into the bit bucket after system setup. It should be
in the mainline kernel whenever Linus syncs the main tree to the SPARC
port's tree.

Every piece of init code and data is tagged with the magical "section"
gcc attribute. Init code ends up in ELF section "text.init" and init
data ends up in "data.init". It is similar to the magical section
tricks done with the new exception handling mechanism.

During the link stage, we arrange for the text.init and data.init
sections to be last in the executable. After system setup, the init
code/data gets reassigned as free pages. Viola!