Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 163041 - Recompiling and installing kernel resullts in depmod taking all memory and the OOM having to kill it.
Recompiling and installing kernel resullts in depmod taking al...
Product: Fedora
Classification: Fedora
Component: module-init-tools (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Depends On:
  Show dependency treegraph
Reported: 2005-07-12 10:08 EDT by cian cullinan
Modified: 2014-03-16 22:54 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-07-13 13:41:16 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
My .config kernel file (55.58 KB, text/plain)
2005-07-12 10:15 EDT, cian cullinan
no flags Details

  None (edit)
Description cian cullinan 2005-07-12 10:08:05 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):

How reproducible:

Steps to Reproduce:
1.wget http://ftp.heanet.ie/pub/fedora/linux/core/updates/4/SRPMS/kernel-2.6.12-1.1387_FC4.src.rpm
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

Additional info:
Comment 1 cian cullinan 2005-07-12 10:15:03 EDT
Created attachment 116655 [details]
My .config kernel file
Comment 2 cian cullinan 2005-07-13 05:18:45 EDT
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.
Comment 3 cian cullinan 2005-07-13 07:21:52 EDT
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
this one.
Comment 4 cian cullinan 2005-07-13 11:22:41 EDT
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.
Comment 5 Bill Nottingham 2005-07-13 13:41:16 EDT
OK, closing for now. Please reopen if it comes back; I couldn't reproduce this
on a test box here.
Comment 6 cian cullinan 2005-07-15 04:16:56 EDT
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?

Comment 7 cian cullinan 2005-07-15 05:22:04 EDT
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 :)
Comment 8 Bill Nottingham 2005-07-15 12:14:46 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.