[opensuse-kernel] compressed modules
Hi, does anyone / anything depend on module-init-tools being able to handle gzip compressed modules? Disabling zlib support would reduce depmod memory usage quite a lot (see bnc#371966 and bnc#350896), because it allows to mmap the modules instead of copying them into memory. Of course, it's possible to keep zlib support in module-init-tools and mmap non-compressed files, it's just more work ;-). Michal -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Michal Marek wrote:
Hi,
does anyone / anything depend on module-init-tools being able to handle gzip compressed modules? Disabling zlib support would reduce depmod memory usage quite a lot (see bnc#371966 and bnc#350896), because it allows to mmap the modules instead of copying them into memory.
Of course, it's possible to keep zlib support in module-init-tools and mmap non-compressed files, it's just more work ;-).
Huh, I didn't even know it had this capability. The POS guys might want the functionality to reduce the kernel image footprint when flash is extremely limited. We don't use it currently, but it might not be a bad idea to leave it in and make it conditional. It's interesting that it's zlib causing this. I don't see zlib mentioned in either of those bugs. Could you elaborate? - -Jeff - -- Jeff Mahoney SUSE Labs -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.8 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkfljuoACgkQLPWxlyuTD7JLzgCeP/NniMkndCAj5YWH3hBHtp59 4XkAn3DyCMQxpUVhDVare9MYQHky6RCh =L9iC -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
Jeff Mahoney wrote:
Michal Marek wrote:
Hi,
does anyone / anything depend on module-init-tools being able to handle gzip compressed modules? Disabling zlib support would reduce depmod memory usage quite a lot (see bnc#371966 and bnc#350896), because it allows to mmap the modules instead of copying them into memory.
Of course, it's possible to keep zlib support in module-init-tools and mmap non-compressed files, it's just more work ;-).
Huh, I didn't even know it had this capability. The POS guys might want the functionality to reduce the kernel image footprint when flash is extremely limited. We don't use it currently, but it might not be a bad idea to leave it in and make it conditional.
OK.
It's interesting that it's zlib causing this. I don't see zlib mentioned in either of those bugs. Could you elaborate?
It's not zlib's fault, it's the way zlib is used by m-i-t: Without zlib support, each module is simply mmapped (and the mmapped elf image is queried for aliases, dependencies, etc. or loaded into kernel). Now because mmapping a compressed module is of no use, if zlib support is enabled, _all_ modules are copied into memory by gzread(). So the option is either to disable zlib support or to improve it not to do useless copies. Michal -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
Michal Marek napsal(a):
It's not zlib's fault, it's the way zlib is used by m-i-t: Without zlib support, each module is simply mmapped (and the mmapped elf image is queried for aliases, dependencies, etc. or loaded into kernel). Now because mmapping a compressed module is of no use, if zlib support is enabled, _all_ modules are copied into memory by gzread(). So the option is either to disable zlib support or to improve it not to do useless copies.
I fixed this the other day: mmap() is used in all cases, compressed modules are first unpacked into /tmp. This means that if the modules are not compressed, the memory usage of a depmod run will be reasonable. For compressed modules, depmod will need space for the uncompressed files in /tmp. In other words, the zlib feature still has its drawbacks, but at least it doesn't do any harm if not used. Michal -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
participants (2)
-
Jeff Mahoney
-
Michal Marek