# 4GB RAM on 64bit Gentoo [SOLVED]

## pmatos

Hi all,

I am running gentoo kernel 2.6.31-r6. I just installed 2 Gb Dimms which adding to my previous 2Gb makes 4Gb. However, my top/free -m, etc are only showing 3Gb of memory available. 

Am I missing something? Suddenly I thought I had to enable something in the kernel but can't find any config option there for this.

Any tips?Last edited by pmatos on Sun Jan 31, 2010 7:03 pm; edited 1 time in total

----------

## aCOSwt

1/ Check in the bios.

You should have an option enabling the remapping of memory above 4G. Turn it on.

2/ You run gentoo sources... well, expected amd64 or x86_64 ones of course.

You speak about a kernel option, would you be under an x86 gentoo and speaking about the PAE option ?

----------

## papahuhn

If 4GB is the mainboard's maximum, it is possible that you won't be able to access the whole 4GB, no matter if you use PAE or amd64.

----------

## pmatos

 *aCOSwt wrote:*   

> 1/ Check in the bios.
> 
> You should have an option enabling the remapping of memory above 4G. Turn it on.
> 
> 

 

Checked the bios. It recognizes the 4G. However, it doesn't seem to have any mem specific option. It seems to accept it by default and it does show 4096MB of RAM.

 *aCOSwt wrote:*   

> 
> 
> 2/ You run gentoo sources... well, expected amd64 or x86_64 ones of course.
> 
> You speak about a kernel option, would you be under an x86 gentoo and speaking about the PAE option ?

 

Can't find the PAE option to enable on the kernel and `zcat /proc/config.gz | grep PAE` returns nothing.

----------

## pmatos

 *papahuhn wrote:*   

> If 4GB is the mainboard's maximum, it is possible that you won't be able to access the whole 4GB, no matter if you use PAE or amd64.

 

I assume that's not the case since the bios reports 4096 of RAM but I can still only see 3Gb. :-/

----------

## aCOSwt

Well, you did not answer : what is your arch ? x86 or x86_64 (aka amd64) ?

If and only if under x86, then the kernel feature for addressing 4G and more is under :

Processor type and features / High memory support

(CONFIG_HIGHMEM4G or CONFIG_HIGHMEM64G)Last edited by aCOSwt on Sat Jan 30, 2010 8:20 pm; edited 1 time in total

----------

## NeddySeagoon

pmatos,

PAE is a hardware/software trick to allow 32 bit CPUs to address more than 4G of RAM by paging.

Its an option thats only present in 32 bit kernels as its not needed in 64 bit kernels which have a 46 bit linear address space.

However, your PCI memory mapped IO and BIOS spaces are mepped into memory just below 4G (even in 64 bit systems).

Your hardware can do two things with the RAM that would be at these addresses. Remap it or throw it away.

A few early chip sets threw away RAM above about 3.2G

----------

## pmatos

 *aCOSwt wrote:*   

> Well, you did not answer : what is your arch ? x86 or x86_64 (aka amd64) ?
> 
> If and only if under x86, then the kernel feature for addressing 4G and more is under :
> 
> Processor type and features / High memory support
> ...

 

Sorry, I am under a x86_64!  :Smile: 

----------

## pmatos

 *NeddySeagoon wrote:*   

> pmatos,
> 
> PAE is a hardware/software trick to allow 32 bit CPUs to address more than 4G of RAM by paging.
> 
> Its an option thats only present in 32 bit kernels as its not needed in 64 bit kernels which have a 46 bit linear address space.
> ...

 

3.2 is the amount being reported to me by free -m: 3267 to be more specific.

How can I remap it then?

----------

## NeddySeagoon

pmatos,

Its down to your BIOS or the memory mapping in the kernel.

Look under 

```
Processor type and features

   Memory model (Sparse Memory)  --->
```

I only have Sparse Memory as an option. You may have others.

----------

## pmatos

 *NeddySeagoon wrote:*   

> pmatos,
> 
> Its down to your BIOS or the memory mapping in the kernel.
> 
> Look under 
> ...

 

I only have one also and it is selected.

Hummm, do you know if the kernel outputs any information about recognised RAM during boot?

----------

## NeddySeagoon

pmatos,

Its right at the start of dmesg.  Resd it with dmesg | less

```
[    0.000000] Linux version 2.6.32-gentoo-r1 (roy@NeddySeagoon) (gcc version 4.4.2 (Gentoo 4.4.2 p1.0) ) #2 SMP PREEMPT Fri Jan 1 12:45:04 GMT 2010

[    0.000000] Command line: root=/dev/md5 vga=0x317 video=vesafb:mtrr:3,ywrap

[    0.000000] KERNEL supported cpus:

[    0.000000]   Intel GenuineIntel

[    0.000000]   AMD AuthenticAMD

[    0.000000]   Centaur CentaurHauls

[    0.000000] BIOS-provided physical RAM map:

[    0.000000]  BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)

[    0.000000]  BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)

[    0.000000]  BIOS-e820: 00000000000e6000 - 0000000000100000 (reserved)

[    0.000000]  BIOS-e820: 0000000000100000 - 00000000cff90000 (usable)

[    0.000000]  BIOS-e820: 00000000cff90000 - 00000000cffa8000 (ACPI data)

[    0.000000]  BIOS-e820: 00000000cffa8000 - 00000000cffd0000 (ACPI NVS)

[    0.000000]  BIOS-e820: 00000000cffd0000 - 00000000d0000000 (reserved)

[    0.000000]  BIOS-e820: 00000000fff00000 - 0000000100000000 (reserved)

[    0.000000]  BIOS-e820: 0000000100000000 - 0000000230000000 (usable)

[    0.000000] DMI present.
```

The first three lines are :-

640kB of lowmem

64kB for the graphics card

1M to 0x0cff90000 is the RAM space below 4G 

The last line, 0000000100000000 - 0000000230000000 (usable) is RAM above 4G

Any remapping the BIOS may do is not shown directly but can be deduced from the numbers.

I have 8G fitted.

----------

## pmatos

 *NeddySeagoon wrote:*   

> pmatos,
> 
> Its right at the start of dmesg.  Resd it with dmesg | less
> 
> ```
> ...

 

Interesting that my dmesg doesn't show everything since the beginning of the boot. :-/

Well, with /var/log/messages I can see the following:

 *Quote:*   

> Jan 30 21:20:09 turing syslog-ng[14423]: syslog-ng starting up; version='3.0.4'
> 
> Jan 30 21:20:09 turing _arch_pfn: = 0x400000000
> 
> Jan 30 21:20:09 turing kernel: MTRR default type: uncachable
> ...

 

The uncacheable part is interesting... all the other are write-back and it's what I can see. I wonder if it has anything to do with MTRR.

----------

## eccerr0r

 *pmatos wrote:*   

>  *papahuhn wrote:*   If 4GB is the mainboard's maximum, it is possible that you won't be able to access the whole 4GB, no matter if you use PAE or amd64. 
> 
> I assume that's not the case since the bios reports 4096 of RAM but I can still only see 3Gb. :-/

 

Still curious, what board/chipset is this machine?

----------

## pmatos

 *eccerr0r wrote:*   

>  *pmatos wrote:*    *papahuhn wrote:*   If 4GB is the mainboard's maximum, it is possible that you won't be able to access the whole 4GB, no matter if you use PAE or amd64. 
> 
> I assume that's not the case since the bios reports 4096 of RAM but I can still only see 3Gb. :-/ 
> 
> Still curious, what board/chipset is this machine?

 

This is a:

 *Quote:*   

> $ cat /proc/cpuinfo 
> 
> processor	: 0
> 
> vendor_id	: GenuineIntel
> ...

 

----------

## eccerr0r

That's cpuinfo, but what chipset?

Though this is NOT a good assumption but since you have an older Pentium-D you may have a 945 chipset computer which does not support more than 4GB RAM.  The problem is that there will be space allocated to PCI that will "cover" the RAM and hence you end up with 3.2G accessable.  Despite the CPU capable of addressing it, the chipset does not...

More info from lspci or lshw or dmidecode.

----------

## NeddySeagoon

pmatos,

Its in dmesg. The 

```
Jan 30 21:20:09 turing kernel: A0000-FFFFF uncachable 
```

is expected.

That memory range in your video card video RAM, as exposed in real mode, in 64k blocks at 0x0a0000 followed by the ranges reserved for BIOS expansion ROM and the BIOS itself.  You really don't wan to cache the video RAM, as its paged and the rest is read only.

Its faster if its cached but any writes are errors.

Linux does not use this range at all.

----------

## pmatos

 *eccerr0r wrote:*   

> That's cpuinfo, but what chipset?
> 
> Though this is NOT a good assumption but since you have an older Pentium-D you may have a 945 chipset computer which does not support more than 4GB RAM.  The problem is that there will be space allocated to PCI that will "cover" the RAM and hence you end up with 3.2G accessable.  Despite the CPU capable of addressing it, the chipset does not...
> 
> More info from lspci or lshw or dmidecode.

 

You're right, I have a MB Intel D945GTP. :-/

Is there now workaround to use the 4GB?

----------

## eccerr0r

 :Sad: 

Looks like you'll have to live with not seeing all 4G in OS.

I'm not sure if you can reduce stuff like memory holes and AGP aperture size to "see" more memory but for the most part of the missing memory, it's pretty much hidden away and gone.

----------

## pmatos

 *eccerr0r wrote:*   

> 
> 
> Looks like you'll have to live with not seeing all 4G in OS.
> 
> I'm not sure if you can reduce stuff like memory holes and AGP aperture size to "see" more memory but for the most part of the missing memory, it's pretty much hidden away and gone.

 

Oh well, guess I will sell one of the DIMMs then.

Thanks a lot all of you for the help.

----------

## eccerr0r

If you're really hurting for cash you may well sell but you will still gain dual channel with the current setup (unless you weren't doing 1+1+1+1 or 2+2)...

----------

## pmatos

 *eccerr0r wrote:*   

> If you're really hurting for cash you may well sell but you will still gain dual channel with the current setup (unless you weren't doing 1+1+1+1 or 2+2)...

 

Yes, I was doing 1+1+1+1, however, one of them was completely invisible to the OS, however, not to the BIOS which detected the 4096MB

----------

## eccerr0r

You should have seen around 3.25GB RAM, which is larger than 3.0GB ... but what I'm saying is that you'll gain dual channel benefits if the DIMMs match.

If you had one 2GB and two 1's, then dual channel wouldn't be enabled and jettisoning one 1G DIMM wouldn't be much of a loss.

----------

## genoneplusone

Hi

I have installed Gentoo 4.19.57 on an old Mac Pro 2006 1.1 with Intel 5100 chipset and 2x Xeon X5365 and 16GB installed ram, yet Gentoo just recognise 3894MB of it.

I think it's because of EFI32 that comes with Mac Pro, because even in boot cd it's the same.

Appreciate any help.

More detail about hardware and my geek bench result is here

https://browser.geekbench.com/v4/cpu/14378215

Thanks in advance.  :Smile: 

----------

## joanandk

 *pmatos wrote:*   

> You're right, I have a MB Intel D945GTP. :-/
> 
> Is there now workaround to use the 4GB?

 

Hi pmatos,

I have had the same issue with a HP PC: The BIOS showed the correct amount of RAM (4096MB), but OS was not able to use more than 3.2GB. The reason for this mismatch is, BIOS uses the SPD data to calculate the total amount of RAM. Accoding to the manual, it is stated that the mainboard cannot handle more than 3GB RAM.

I was first also happy to see 4GB in the BIOS and got disappointed after Gentoo has booted.

You can create a 1+1+1+0 memory configuration, as the dual channel benefits seems to be not that big in real life!

You could yourself test that: Compile your kernel with 4GB and 3GB (doing "make clean" in between) and check the duration. So you will find what is faster.

BR

----------

## genoneplusone

Hi joanandk

But my problem is different from this one,

I mean if I install Mac, I can use 32GB without problem and Mac OS and all software are recognizing 32GB,, but on Gentoo and rescue boot CD there is just 3845MB.

Can someone please help me? Thanks.

----------

## Hu

Which rescue CD and kernel are you using?  That amount is reasonable if you used a non-PAE 32-bit kernel.  For that amount of RAM, you should use a 64-bit kernel.

Also, why are we discussing this in a nine year old solved thread?  Solved threads usually get less attention.  Would you like for me to move this out to its own thread?

----------

