Kernel upgrade 2.4 -> 2.6, makes system very slow on laptop with 1GB of memory: BIOS caching bug



Hi,
I thought I should post the problem and solution here as it seems to be
very evasive bug (and took me days to solve), hopefully someone will
find it useful (and lemme know if it did ;)

The problem:

After upgrading (or installing fresh ) to 2.6.x kernel on
Debian/Ubuntu Linux system, the computer has became very slow. And i
mean REALLY slow -- it was taking 50 minutes just to boot.

Reason

Apparently the problem is that there is a bug in BIOS (quite popular),
which prevents memory region from 1008 to 1016 from being cached, and
linux is using that memory region quite actively. To check if this is
indeed the case try

cat /proc/mtrr

at the end where it displays caching region there will be a gap
somewhere in the high memory. (look for numbers starting with 0x3E and
3F)

Solution:

mem=1008M added to kernel options e.g. if one uses grub the
/usr/menu.lst
should read like:

kernel /boot/vmlinuz-2.6.12custom root=/dev/hda3 ro mem=1008M
single

Now, everything works just fine. But in my case sound, pcmcia and few
other things including
acpi stopped working.

Iteration 2.

Detailed study of the output of lspci command (use verbose option)
tells us that sound card uses memory region from 1016 to 1024MB...
Apparently when one specifies mem=1008M, kernel can not access that
region and <sigh> no sound...

The "hackish" solution is to turn off the the mem_4G option in the
kernel. For that one needs to recompile kernel with Mem4G option turned
off... Note, that in that case some top 100M will be inaccessible for
programs - but i guess it doesn't really matter. Interestingly enough,
the sound card still continues to use 1016-1024M region, and so once
one recompiles the kernel, s/he _has_ to remove the offending mem=1008
from the menu.lst....

I guess alternative would be to try to reconfigure sound not to use the
region above 1008 --
but i have not tried that.



Side note (and off topic).

The similar problem can be seen in Windows XP... (But of course one
would have no chance of finding out the cause for it, except by
installing linux...), the problem is even more evasive. The windows
would get very slow, not all the time, but only when some program
loads into uncached region... Eg. every few days or so...

The solution: add /maxmem=999 option to c:\boot.ini file.


enjoy,

mark

.



Relevant Pages

  • Re: Kernel upgrade 2.4 -> 2.6, makes system very slow on laptop with 1GB of memory: BIOS caching
    ... very evasive bug, ... After upgrading to 2.6.x kernel on ... linux is using that memory region quite actively. ... tells us that sound card uses memory region from 1016 to 1024MB... ...
    (comp.os.linux.setup)
  • [opensuse] Problems with sound, USB in general, USB drives etc.
    ... I recently upgraded to the latest kernel from the repositories ... sound card, the desktop crashes. ... delete files or write to the USB disk after this happens. ... cannot delete files again until I remount the drive. ...
    (SuSE)
  • Re: Setting up sound - alsa config
    ... > I have a 2.6.7 kernel running on a compaq presario laptop. ... The sound card driver support ... I have a compaq presario laptop as well with the same ali5451 card. ... You do not need any OSS modules, however I do have the ALSA - OSS ...
    (Debian-User)
  • Re: Need help with the sound card!!
    ... > that for all the sound card support there is a module already built ... All that are listed in /modules, until FreeBSD 5 where most everything ... think you'll need pcm and another if building the driver into the ... kernel statically. ...
    (freebsd-questions)
  • Re: I do not understand kernel modules
    ... Jorn Argelo wrote: ... >>the driver for my sound card. ... I added the following lines to the kernel ... very long time to compile all the modules even if I am not going to use ...
    (freebsd-questions)