Re: PATCH: move more functions and data into init memory (2.1.89)

Matthias Hanisch (matze@camline.com)
Wed, 11 Mar 1998 11:30:39 +0100 (MET)


On Wed, 11 Mar 1998, Jakub Jelinek wrote:

> > I am not so sure about the best method getting init strings into the
> > initdata segment. I haven't found a clean method like
> >
> > "foobar" __initdata
>
> There is none, unless you do:
>
> static char mystring[] __initdata = "That string";

That's what my patch does... :)

> but that's ugly and not usable. People usually want their strings to sit in
> the code where they are used...

I agree that it's ugly. But I just don't want to waste my kernel memory
with a lot of startup messages for networking, kswapd, cpu checking and
especially not with "hidden" startup error messages (look in the aha1542.c
part, for example)...

> Martin Mares said he'll be looking into egcs to add support for something
> like that (so that all strings from some function with some special
> attribute would go to a special section). There is a lot of other things to

This would be very useful. In the meantime I could imagine some kind of
preprocessing for files that contain init strings. I have to think about
it.

> do in this area, e.g. if gcc optimizes away some part of code which has the
> only occurence of some string, it does not have to be in the resulting
> binary at all...

But this is not too fatal (except of low-memory machines) because it will
be freed later...

Regards,

Matze

--
Matthias Hanisch    gesch.: matze@camline.com    priv.: matze@pingu.franken.de
                            +49 8137 935-219            +49 8441 82387

"Modell 10 - Software from Experts for Experts"

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu