Red Hat Bugzilla – Bug 163041
Recompiling and installing 22.214.171.124-1.1387 kernel resullts in depmod taking all memory and the OOM having to kill it.
Last modified: 2014-03-16 22:54:48 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050524 Fedora/1.0.4-4 Firefox/1.0.4
Description of problem:
When compiling and installing kernel from kernel-2.6.12-1.1387_FC4.src.rpm all goes well until the "make modules_install" stage - during which the command
"sh /usr/src/redhat/BUILD/kernel-2.6.12/linux-2.6.12/arch/i386/boot/install.sh 2.6.12-prep arch/i386/boot/bzImage System.map "/boot" "
results in the depmod process taking all memory until the OOM gaurdian kills it (and some other processes along the way).
I have compiled my kernel many times before and have not come across this problem.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
2.sudo mv kernel-2.6.12-1.1387_FC4.src.rpm /usr/src/redhat/SRPMS
3.cd /usr/src/redhat/SRPMS && sudo rpm -ivh kernel-2.6.12-1.1387_FC4.src.rpm
4.cd /usr/src/redhat/SPECS && sudo rpmbuild -bp --target=i686 kernel-2.6.spec
5.cd /usr/src/redhat/BUILD/kernel-2.6.12/linux-2.6.12 && make mrproper
6.sudo cp configs/kernel-2.6.12-i686.config ./.config && make menuconfig
7.Change processor type to Pentium-M, enable software suspend and set default resume partition, disable IBM Thinkpad Laptop Extras, enable ATI Radeon Display Support, enable NTFS Support as a module and enable NTFS Write Support.
8.sudo sh -c "make && make modules_install && make install"
Actual Results: All goes well until the depmod stage during "make modules_install" at which stage memory usage climbs to 100%, machine swaps wildly and OOM starts killing processes until it finally kills depmod.
Expected Results: Kernel and modules to compile and be installed in the correct locations and a new entry to be made in /etc/grub.conf
Created attachment 116655 [details]
My .config kernel file
This same thing occurs for kernel-2.6.11-1.14_FC3.src.rpm as well but did not
happen before upgrading to FC4. It seems as if the upgrade has broken something.
I have tried rolling back to a previous version of
module-init-tools(3.1-0.pre5.3.i386.rpm) but to no avail. Not sure how to debug
Problem solved. It was a combination of FC4 (and whatever software it installed)
and my 2.6.11-1.35 kernel that was causing the problem. Upgrading to
2.6.12-1.1390 then recompiling from there worked.
OK, closing for now. Please reopen if it comes back; I couldn't reproduce this
on a test box here.
OK, update. It seems like the problem is caused by depmod loading all of
/lib/modules/kernel-2.6.12-prep into memory when building it's list of module
By simply taking the default kernel-2.6.12-i686.config file that comes with the
kernel-2.6.12-1.1387_FC4.src.rpm package and recompiling it, one ends up with a
/lib/modules/kernel-2.6.12-prep directory almost 300MB in size.
My poor laptop only has 512MB physical memory and I think depmod demanding 300MB
might have been too much for it. Physical memory filled up, and the OOM killer
came into play.
By going through menuconfig before compiling and removing all the modules I
don't need I end up with a /lib/modules/kernel-2.6.12 of less than 150MB, and
the whole compile and install goes without a hitch.
Just to make sure, I monitored depmod's memory footprint for both of the above
module scenarios and indeed it peaked at about 295MB with the unaltered .config
and at only 145MB with the trimmed down version.
I've never had this issue, is this just how depmod is supposed to work? Maybe
it's just that there are more/larger modules in the current kernels?
Well the act of writing the last post made me think "hang on a second, maybe
there's something wrong with my swap partition", and there was. It only came to
light because of the memory intensive nature of depmod. Apologies for not
spotting this sooner :)
Heh, no problem. I suppose depmod should probably be changed to use less memory,
but that's not something we'd probably work on outside of upstream.