Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 163041 - Recompiling and installing kernel resullts in depmod taking all memory and the OOM having to kill it.
Summary: Recompiling and installing kernel resullts in depmod taking al...
Alias: None
Product: Fedora
Classification: Fedora
Component: module-init-tools
Version: 4
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2005-07-12 14:08 UTC by cian cullinan
Modified: 2014-03-17 02:54 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2005-07-13 17:41:16 UTC

Attachments (Terms of Use)
My .config kernel file (deleted)
2005-07-12 14:15 UTC, cian cullinan
no flags Details

Description cian cullinan 2005-07-12 14:08:05 UTC
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/ 2.6.12-prep arch/i386/boot/bzImage "/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:
2.sudo mv kernel-2.6.12-1.1387_FC4.src.rpm /usr/src/redhat/SRPMS /usr/src/redhat/SRPMS && sudo rpm -ivh kernel-2.6.12-1.1387_FC4.src.rpm /usr/src/redhat/SPECS && sudo rpmbuild -bp --target=i686 kernel-2.6.spec /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 14:15:03 UTC
Created attachment 116655 [details]
My .config kernel file

Comment 2 cian cullinan 2005-07-13 09:18:45 UTC
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 11:21:52 UTC
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 15:22:41 UTC
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 17:41:16 UTC
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 08:16:56 UTC
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 09:22:04 UTC
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 16:14:46 UTC
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.