From: "Jeff V. Merkey" <jmerkey@vger.timpanogas.org>
To: "Adam J. Richter" <adam@yggdrasil.com>
Cc: kaos@ocs.com.au, linux-kernel@vger.kernel.org
Subject: Re: initdata for modules?
Date: Sun, 26 Nov 2000 19:49:43 -0700 [thread overview]
Message-ID: <20001126194943.F2265@vger.timpanogas.org> (raw)
In-Reply-To: <200011262347.PAA11866@baldur.yggdrasil.com>
In-Reply-To: <200011262347.PAA11866@baldur.yggdrasil.com>; from adam@yggdrasil.com on Sun, Nov 26, 2000 at 03:47:30PM -0800
On Sun, Nov 26, 2000 at 03:47:30PM -0800, Adam J. Richter wrote:
> Keith Owens <kaos@ocs.com.au> wrote:
> >"Adam J. Richter" <adam@yggdrasil.com> wrote:
> >> In reading include/linux/init.h, I was surprised to discover
> >>that __init{,data} expands to nothing when compiling a module.
> >>I was wondering if anyone is contemplating adding support for
> >>__init{,data} in module loading, to reduce the memory footprints
> >>of modules after they have been loaded.
>
> >It has been discussed a few times but nothing was ever done about it.
> >AFAIK the savings were not seen to be that important because modules
> >occupy complete pages. __init would have to be stored in a separate
> >page which was then discarded. [...]
>
> No, you could just discard the part after the next page
> boundary. The expected savings would be about the same, since
> the cases where the original code had just creeped over a page
> boundary in many cases would result in dropping more memory savings
> that the actual init size, from dropping those unused bytes
> between the very end of the init section and the end of that page.
> I say "about" the same becuase the distribution of text and data
> sizes is not uniformly random within some fixed interval.
>
> Since you would not have to bump the start address of a
> section to the next page boundary, I wonder if it would still
> complicate insmod et al.
>
> In case there is any confusion, I am not suggesting that
> this should go into the stock 2.4.0 releases.
>
> However, I do find it helpful in allocating my time to
> cosider that saving one page by something like this or by enhancing
> gcc's variable placement saves as much space as 1024 eliminations
> of "= 0" or "= NULL" static variable initializations.
Microsoft drivers have an .INIT code section that is initialization
ccode that get's chunked after it's loaded. Their model allows
memory segments to be defined as DISCARDABLE, which tells the loader
to chunk them after they get loaded in portable executable format.
If ELF has something like it, perhaps it should go in the loader?
Jeff
>
> Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104
> adam@yggdrasil.com \ / San Jose, California 95129-1034
> +1 408 261-6630 | g g d r a s i l United States of America
> fax +1 408 261-6631 "Free Software For The Rest Of Us."
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> Please read the FAQ at http://www.tux.org/lkml/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2000-11-27 2:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-11-26 23:47 initdata for modules? Adam J. Richter
2000-11-27 2:49 ` Jeff V. Merkey [this message]
2000-11-27 2:06 ` Keith Owens
2000-11-27 3:27 ` Jeff V. Merkey
-- strict thread matches above, loose matches on Subject: below --
2000-11-26 15:30 Adam J. Richter
2000-11-26 22:54 ` Keith Owens
2000-11-27 0:01 ` Jeff V. Merkey
2000-11-26 23:45 ` Keith Owens
2000-11-27 2:45 ` Jeff V. Merkey
2000-11-27 7:35 ` Jakub Jelinek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20001126194943.F2265@vger.timpanogas.org \
--to=jmerkey@vger.timpanogas.org \
--cc=adam@yggdrasil.com \
--cc=kaos@ocs.com.au \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox