slow last 128MB of RAM in a 2GB system?

Dave Johnson dave-gnhlug at davej.org
Thu Apr 12 19:30:38 EDT 2007


Bill McGonigle writes:
> Long story short: I put 2GB in my soho "server" and if I use the last  
> 128MB or RAM or so the machine is murderously slow. If I boot the  
> machine mem=1920M it's just fine.
> 
> Some googling around has lead me to look at linux himem handling and  
> mtrr cache stuff, but I'm not really sure what's going on.
> 
> 1920MB is practically just fine, but I can't leave well enough alone...
> 
> $cat /proc/mtrr
> reg00: base=0x00000000 (   0MB), size=1024MB: write-back, count=1
> reg01: base=0x40000000 (1024MB), size= 512MB: write-back, count=1
> reg02: base=0x60000000 (1536MB), size= 256MB: write-back, count=1
> reg03: base=0x70000000 (1792MB), size= 128MB: write-back, count=1
> reg04: base=0x78000000 (1920MB), size=  64MB: write-back, count=1
> 
> I believe this is telling me that only the first 1920MB of RAM is  
> being cached.  But I'm not sure why or what's happening to the last  
> 128MB.  32MB of that last 128MB is allocated to the integrated  
> graphics controller.   Maybe the last 128MB is mapped to the graphics  
> controller anyway?  But then why doesn't linux detect this?  Also,  
> this wasn't a problem with 1GB in the system.
> 
> Documentation/mtrr.txt hasn't been particularly helpful for me, and  
> Googling has gotten me a fix, but not much in the way of theory  
> (other than MTRR is an old nasty x86 hack and linux ought to dump  
> MTRR on modern hardware and use PAT like Windows does - whatever that  
> is).
> 
> Has anybody figured this out before?

I unfortunately know way too much about these types of problems having
debugged and fixed a commercial BIOS W.R.T. to MTRR and E820 bugs.

The MTRR map is (by default) filled out by the BIOS.  It also fills
out the E820 memory map.

This first question is what did the bios fill out for the E820 map?
This is printed at the begging of the kernel startup with the text
'BIOS-provided physical RAM map'.

Also, what is the output of /proc/iomem and 'lspci -vv' (run as root
please).

The BIOS may be providing a memory break at 1984MB with the remaining
64MB at 4GB and forgetting to add the MTRR entry for that, or it may
be reserving that 64MB for use by ACPI/SMM/etc... and forgetting to
mark those regions reserved in the E820 map.  Either way it's usually
a BIOS bug, but linux should be able to work around either case
(though that might mean some kernel changes).


-- 
Dave



More information about the gnhlug-discuss mailing list