On 5/12/2010 11:34 AM, Stefan Monnier wrote: >> Less file system overhead on the flash side and no memory used to manage >> the structures needed to insmod / rmmod. >> > Exactly. Maybe also a tighter memory layout since each module doesn't > have to be in its own set of ELF sections, IIUC. > > Also, the linkage would be (presumably) static rather than dynamic. > I don't think gcc will take much advantage of it, but it could otherwise > also enable further code optimizations. > > You are correct. Each module has an ELF header, sections and possibly a comment. I do not believe these would be present when the code is compiled into the kernel.
Obviously, one loses flexibility with this approach, but gains some resources. >> Regardless, I would guess that the overhead is quite minimal. >> > Could be. But my OpenWRT router has 48 modules, half of which claim to > use 2KB or less. The total of the sizes reported by lsmod is > 968928 bytes, whereas the corresponding total of the sizes of the > module files in /lib/modules is 1970768. > > Those numbers don't guarantee anything (I don't know what the lsmod > numbers mean, really), but they seem to indicate that there's at least > the potential for a significant gain. > While I have seen the "size" listed in lsmod and /proc/modules, I don't really know what it represents. I am assuming that it means code size and not memory. Make sure that you are counting the size of the files in /lib/modules only for modules you have loaded, and we might have a better picture of typical flash savings. I still don't think that much RAM will be saved, but the flash savings may be worth it if one has enough modules loaded. Mark _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel