[lkml]   [2000]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: initdata for modules?
On Mon, Nov 27, 2000 at 09:54:57AM +1100, Keith Owens wrote:
> On Sun, 26 Nov 2000 07:30:44 -0800,
> "Adam J. Richter" <> 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. It would complicate insmod, rmmod,
> ksymoops and gdb. gdb against the kernel already gets confused by
> vmlinux data that is discarded and gdb has problems with modules at the
> best of times. Definitely 2.5 material, if at all.

One really nice addition to the modutils would be to allow module
dependencies to be stored in the headers of modules. i.e. NetWare
NLMs have a "module depends" field where you can list modules you
have dependencies on, and so does NT with DLL's, and the loader auto
loads these modules when you load any module. What's troublesome
about modutils in their current form is if you don't have a
modules.dep file, insmod isn't smart enough to read the depenency
modules from a binary header, and load them without doing a lot
of needless checking with modprobe. Having to depend on an external
text file for this looks tacky to customers and is error prone.

I understand that it's nice to be able to change modules around
and have the flexibilty to do this dynamically, but since modules
that use this are complied from the kernel, and the kernel
build always knows "who owns the APIs" there's no reason it could
or should not be done this way. i.e.

when loading ppp and it's modules:


There's no reason that ppp could not have in it's binary header the
name "slhc" and any other modules it is dependent on so insmod
will load all of them if someone types

insmod ppp_deflate (should trigger load of all these modules). I
know it's works this way if there's a modules.dep file laying
around, but it would be nice for it to work this way without
needing the external text file.


> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to
> Please read the FAQ at
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:47    [W:0.040 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site