# Gentoo recognise just 3894MB of 16GB ram (SOLVED)

## 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 or maybe some kernel option, because in Mac OS I have all 16GB and can use it .

More detail about hardware and my geek bench result is here

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

Please help.

Thanks in advance.  :Smile: Last edited by genoneplusone on Sat Aug 24, 2019 9:17 am; edited 1 time in total

----------

## mike155

Please post 

the output of 'dmesg'

your kernel config

the output of 'emerge --info'

using wgetpaste.

----------

## joanandk

 *Quote:*   

> I think it's because of EFI32

 

You are saying nothing about which bootloader you are using.If you are using the kernel stub, there is an option for mixed-mode which could help you to boot from a 32bit EFI.

BR

----------

## NeddySeagoon

genoneplusone,

That would be about right with a 32 bit install.

----------

## genoneplusone

 *NeddySeagoon wrote:*   

> genoneplusone,
> 
> That would be about right with a 32 bit install.

 

So, is there any solution?

Dmseg says 

[    1.385738] efi: EFI_MEMMAP is not enabled.

Btw I'm using Grub2 without bootcamp.

----------

## Jaglover

There was information requested about your installation, how do you think we can help you without knowing anything about your Gentoo?

----------

## NeddySeagoon

genoneplusone,

Make use of wgetpaste and post the things that mike155 asked for.

There is certainly a solution but we need some information to work with.

Its unlikely you are the first to install on a Mac Pro 2006 and if only 4G of RAM could be used from Linux, Google would know all about it.

----------

## genoneplusone

Hi again

 So Sorry I write back late, there were some challenges to find out using wgetpaste.

Here is .config

[url]http://dpaste.com/3KCH25K

[/url]

dmesg part1

http://dpaste.com/1WRYTYT

dmesg part2

http://dpaste.com/158XZBT

dmesg part3

http://dpaste.com/0Z4Y19R

emerge --info output

http://dpaste.com/1A5HX8KLast edited by genoneplusone on Thu Aug 22, 2019 11:47 pm; edited 1 time in total

----------

## genoneplusone

Dear NeddySeagoon

 *NeddySeagoon wrote:*   

> genoneplusone,
> 
> Its unlikely you are the first to install on a Mac Pro 2006 and if only 4G of RAM could be used from Linux, Google would know all about it.

 

Actually I searched a lot in Google and in the forum, to find out, but founf nothing. Here is my last hope.

Thanks.

----------

## mike155

Thanks for the data!

```
Portage 2.3.69 (python 3.6.5-final-0, default/linux/amd64/17.0/desktop, gcc-8.3.0, glibc-2.29-r2, 4.19.57-gentoo x86_64)

=================================================================

System uname: Linux-4.19.57-gentoo-x86_64-Intel-R-_Xeon-R-_CPU_X5365_@_3.00GHz-with-gentoo-2.6

KiB Mem:     3982032 total,   2500352 free

KiB Swap:          0 total,         0 free
```

You installed a 64 bit version of Gentoo and the system reports only 3.98 GB of memory. Interesting!

The first part of your kernel config got lost. Can you post it (again), please? It should be possible to post the whole kernel config in one wgetpaste paste. There's no need to split it into several parts.

----------

## genoneplusone

 *mike155 wrote:*   

> Thanks for the data!
> 
> ```
> Portage 2.3.69 (python 3.6.5-final-0, default/linux/amd64/17.0/desktop, gcc-8.3.0, glibc-2.29-r2, 4.19.57-gentoo x86_64)
> 
> ...

 

Hi

Thanks for reply.

here is kernel config

http://dpaste.com/3KCH25K

----------

## Anon-E-moose

If you boot with systemrescuecd what does it show?

Edit to add: the early macpro 1/2 (2006/7 models) did have 32bit efi and have problems because of that. 

I didn't do a lot of googling, but with a generic enough search you can find mention of the problems.

Not sure what the solution is, though I'm sure there is one.

ETA2: http://wikigentoo.ksiezyc.pl/Apple_Mac_Pro.htm

----------

## Jaglover

What does 'dmidecode -t memory' from Linux tell?

----------

## joanandk

 *mike155 wrote:*   

> 
> 
> You installed a 64 bit version of Gentoo and the system reports only 3.98 GB of memory. Interesting!
> 
> 

 

HI Mike155,

Not really, if the system has NUMA, this could be possible. I have quickly checked the mainboard and have seen that it supports 2 CPUs and has two memory-board-slots.

BR

----------

## Anon-E-moose

You might try the mem= kernel option 

```
    mem=nn[KMG] [KNL,BOOT] Force usage of a specific amount of memory

            Amount of memory to be used when the kernel is not able

            to see the whole system memory or for test.
```

----------

## genoneplusone

 *Anon-E-moose wrote:*   

> You might try the mem= kernel option 
> 
> ```
>     mem=nn[KMG] [KNL,BOOT] Force usage of a specific amount of memory
> 
> ...

 

Hi Anon-E-moose

I have tried this before in Grub Boot menu, I tried with e (for edit boot option) and add mem=16384M (16x1024) but still 3.98GB.

----------

## NeddySeagoon

genoneplusone,

Lets look at the RAM the BIOS claims to know about.

```
[    0.000000] BIOS-provided physical RAM map:

[    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000008efff] usable

[    0.000000] BIOS-e820: [mem 0x000000000008f000-0x000000000008ffff] ACPI NVS
```

That's the traditional 640k is enough for anyone. RAM. When the CPU starts is 16 bit mode and all Intel/AMD CPUs still do that, thats all the RAM they can use. 

ACPI didn't exist so that has stolen 64kB 

In 16 bit mode, only 1MB of RAM can be addressed. Actually, due to a hardware bug in the 286, which has to be propagated to all later CPUs to retain backwards compatibility,

there is actually almost another 64kB that can be addressed. It was known as the himem region.  

```
[    0.000000] BIOS-e820: [mem 0x0000000000090000-0x000000000009ffff
```

usable

This is your video card RAM. There is hack piled upon had to fit more that 64kB into thin 64kB region but its only used that way during early boot, before switching to 32 bit or 64 bit mode.

As you have a 64 bit kernel running, its clear that booting into 64 bit mode works.

```
[    0.000000] BIOS-e820: [mem 0x00000000000a0000-0x00000000000bffff] reserved
```

This is a bit odd but it probably doesn't matter.

Expansion BIOS ROM goes at 0xa0000 to 0xeffff followed by the BIOS itself from  0xf0000 to 0xfffff but Apple never made a BIOS based system, they were all EFI, so there is no reason to have backwards compatibility with BIOS systems.  However, at startup, Intel CPUs fetch their first instruction from 0xffff0, which appears not be in ROM. That's hard wired into the CPU.  

```
[    0.000000] BIOS-e820: [mem 0x00000000000c0000-0x000000007f7d9fff] usable
```

That's almost the first 2G RAM. 

Then there is some reserved regions

```
[    0.000000] BIOS-e820: [mem 0x000000007f7da000-0x000000007f7effff] type 20

[    0.000000] BIOS-e820: [mem 0x000000007f7f0000-0x000000007f8c2fff] usable

[    0.000000] BIOS-e820: [mem 0x000000007f8c3000-0x000000007f8effff] reserved

[    0.000000] BIOS-e820: [mem 0x000000007f8f0000-0x000000007fa9ffff] usable

[    0.000000] BIOS-e820: [mem 0x000000007faa0000-0x000000007fb73fff] ACPI NVS

[    0.000000] BIOS-e820: [mem 0x000000007fb74000-0x000000007fb8afff] usable

[    0.000000] BIOS-e820: [mem 0x000000007fb8b000-0x000000007fbb3fff] ACPI data

[    0.000000] BIOS-e820: [mem 0x000000007fbb4000-0x000000007fbb4fff] reserved

[    0.000000] BIOS-e820: [mem 0x000000007fbb5000-0x000000007fbfffff] usable

[    0.000000] BIOS-e820: [mem 0x000000007fc00000-0x000000007fffffff] reserved
```

What happens at 0x0000000080000000-0x00000000fff8ffff], that's another 2G region?

[    0.000000] BIOS-e820: [mem 0x00000000fff90000-0x00000000fffbffff] reserved[/code]

[    0.000000] BIOS-e820: [mem 0x00000001 0000 0000-0x00000001 7fff ffff] usable

That's 4G to 6G, so your firmware is only reporting approximately 4G of RAM to any operating system, which is what we see

```
[    0.011704] Initmem setup node 0 [mem 0x0000000000001000-0x000000017fffffff]
```

Notice that your 32 bit EFI reports 2G of RAM installed above the end of the 32 bit address space, so I don't think its a 32 bit EFI issue.

You say you have 2x Xeon X5365 and 16GB installed ram. Here's a theory to test.

If your system uses Non Uniform Memory Architecture (NUMA) and you don't have NUMA support on in the kernel (you don't) you might only see the RAM attached to node 0.

If this is true, node 0 only has 4G RAM attached and node 1 will have the missing 12G.

To test, rebuild your kernel with 

```
# CONFIG_NUMA is not set
```

turned on.

If this gets you all 16G, you may want to consider moving RAM around because using the RAM on another node is slower than accessing the RAN on the local node in a NUMA system.

When you reboot into your new kernel, run 

```
uname -a
```

The date/time shown are the build date/time of the running kernel.

Its important to check that you are running the kernel you think you are before you report that nothing has changed.

----------

## eccerr0r

Unfortunately I don't have and thus never studied apple hardware, but does look like the BIOS-E820 memory map is only reporting ~4GB of memory and Gentoo is doing the right thing based on that data.

I don't know if there's another way to know where your memory is when your machine is booted in that manner.

----------

## NeddySeagoon

If a NUMA aware kernel doesn't help, There is the emergency manual override.

Start reading at 

```

        mem=nn[KMG]     [KNL,BOOT] Force usage of a specific amount of memory

                        Amount of memory to be used when the kernel is not able

                        to see the whole system memory or for test.

                        [X86] Work as limiting max address. Use together

                        with memmap= to avoid physical address space collisions.

                        Without memmap= PCI devices could be placed at addresses

                        belonging to unused RAM.
```

Several parameters are required.

The hard bit is getting the real physical memory map to be able to tell the kernel all about it.

Try booting another distro shat shows all 16G and extracting the memory map from the top of dmesg.

----------

## Anon-E-moose

I'm curious what the bios says about the ram. Have you booted into the bios when you first power up and look at what it says.

----------

## Jaglover

I asked for output of dmidecode and my post was ignored. I don't understand people who come here for help and then display total lack of manners.

----------

## genoneplusone

Hi guys

So so so sorry that I wasted your time because of a stupid mistake.

Problem was because of a hardware failure, even Mac could not see all rams.

I changed the position of rams and now Gentoo sees 32GB rams.

Again and again sorry.

----------

## genoneplusone

 *NeddySeagoon wrote:*   

> genoneplusone,
> 
> You say you have 2x Xeon X5365 and 16GB installed ram. Here's a theory to test.
> 
> If your system uses Non Uniform Memory Architecture (NUMA) and you don't have NUMA support on in the kernel (you don't) you might only see the RAM attached to node 0.
> ...

 

Exactly, that was the issue.

I didn't build new kernel but moved rams(and actually filled all the slats, so I have now 32 GB) and it's running fine and Gentoo shows 32GB now and its correct 8x4GB.

Thanks.

I owe you.

Living in Copenhagen now, will be happy to invite you to a beer if ever u come to DK.

Thank you so much and sorry I wasted your time.

----------

## genoneplusone

 *Jaglover wrote:*   

> I asked for output of dmidecode and my post was ignored. I don't understand people who come here for help and then display total lack of manners.

 

Sorry  Jaglover.

It wasn't because of lack of manner.

I tried with dmidecode, but it says command not found, so I tried to solve that problem, it took time to find out what should I emerge to could get dmidecode to work.

I am at work about 10 hours a day and just have time after midnight.

I apologize.

And thanks to all of you that helped me to solve the problem.

As I wrote before, the problem was because of a hardware failure.

Sorry again.

----------

## joanandk

 *genoneplusone wrote:*   

> So so so sorry that I wasted your time because of a stupid mistake.
> 
> Problem was because of a hardware failure, even Mac could not see all rams.
> 
> I changed the position of rams and now Gentoo sees 32GB rams.

 

Glad you made it work!

BR

----------

