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



Mark.Sandler@xxxxxxxxx wrote:
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...
Do you mean this:

# CONFIG_HIGHMEM4G is not set
CONFIG_HIGHMEM64G=y
CONFIG_HIGHMEM=y

If so, it is not so simple.

In Red Hat Enterprise Linux 3, the stuff looks like this.

# CONFIG_NOHIGHMEM is not set
# CONFIG_HIGHMEM4G is not set
CONFIG_HIGHMEM64G=y
CONFIG_X86_4G=y

Now for my system, I need them as they are. If I turn off the
CONFIG_HIGHMEM64G=y I will be unable to see the top 4GBytes of RAM, and if I
turn off the CONFIG_X86_4G=y then it will build a kernel that gives itself 1
GByte of address space, and the user only 3 GBytes, but if I have it on like
this, both the users and the kernel can get up to 4 GBytes if they want it.

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



--
.~. Jean-David Beyer Registered Linux User 85642.
/V\ PGP-Key: 9A2FC99A Registered Machine 241939.
/( )\ Shrewsbury, New Jersey http://counter.li.org
^^-^^ 22:15:00 up 5 days, 34 min, 5 users, load average: 4.23, 4.37, 4.35
.



Relevant Pages

  • Kernel upgrade 2.4 -> 2.6, makes system very slow on laptop with 1GB of memory: BIOS caching bug
    ... 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)