I want install a module kernel ( arround 80 Mb) in a machine with CentOS 6.0.
When I try it jumps this error: "insmod: error inserting '/usr/local/lib/click.ko': -1 Cannot allocate memory".
After investigating, I come to the conclusion that machine cannot install a module kernel bigger than 64 Mb.
Some ideas how increase the maximum size allowed in memory for kernel modules?
Thank's
Jorge
Increase the maximum size allowed for kernel modules
Increase the maximum size allowed for kernel modules
What does dmesg say?
Re: Increase the maximum size allowed for kernel modules
Where does click.ko come from, and more importantly was it compiled against the kernel into which you are trying to load it?
What documentation do you have to suggest there is a 64MB module size limit (although I must admit I've not seen a module that big before)?
What documentation do you have to suggest there is a 64MB module size limit (although I must admit I've not seen a module that big before)?
Re: Increase the maximum size allowed for kernel modules
To test your maximum size theory, can you see if the module is stripped, and if not strip the module with --strip-debug:
[code]
# file /usr/local/lib/click.ko
[/code]
and if it says "not stripped" then try stripping the module (make a backup of the original version first):
[code]
# cp /usr/local/lib/click.ko /usr/local/lib/click.ko.bak
# strip --strip-debug /usr/local/lib/click.ko
[/code]
Now see how the size of the stripped module compares to the original. Is it less than 64MB, and does it now load?
[code]
# file /usr/local/lib/click.ko
[/code]
and if it says "not stripped" then try stripping the module (make a backup of the original version first):
[code]
# cp /usr/local/lib/click.ko /usr/local/lib/click.ko.bak
# strip --strip-debug /usr/local/lib/click.ko
[/code]
Now see how the size of the stripped module compares to the original. Is it less than 64MB, and does it now load?
Re: Increase the maximum size allowed for kernel modules
The 3 biggest modules in my kernel are the nvidia, radeon and xfs modules and all of those are less than 20MB in size. I have to ask, does yours actually need to be this large? Can you not split it up into multiple modules? Or is it using huge static arrays of data that might be better relocated elsewhere?
To me, 80MB just sounds ridiculous.
To me, 80MB just sounds ridiculous.
Re: Increase the maximum size allowed for kernel modules
Just following up on this...
Yes there is a maximum module size of 64MB as defined in module.c:
[code]
/* vmalloc barfs on "unusual" numbers. Check here */
if (len > 64 * 1024 * 1024 || (hdr = vmalloc(len)) == NULL)
[/code]
which was recently removed from more recent upstream kernels:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=commitdiff;h=41f8ef7f8b7c2b0b0d1f4682bb70c709c1d3c541
Yes there is a maximum module size of 64MB as defined in module.c:
[code]
/* vmalloc barfs on "unusual" numbers. Check here */
if (len > 64 * 1024 * 1024 || (hdr = vmalloc(len)) == NULL)
[/code]
which was recently removed from more recent upstream kernels:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=commitdiff;h=41f8ef7f8b7c2b0b0d1f4682bb70c709c1d3c541