# All memory not detected in 2.6.17 kernel [SOLVED]

## Ast0r

I recently upgraded one of our server to the 2.6.17-r7 kernel (from 2.6.15-r1) and now all of my memory does not show up!

This is a 32-bit setup on a Xeon Irwindale with 4GB of installed RAM (in 4 sticks). I have the 4GB memory option set in the kernel and I had no problems with the kernel seeing all of my RAM until I upgraded to 2.6.17. The kernel now sees 3370232k of RAM instead of the full 4GB.

Here is the relevant config information, pulled from /proc/config.gz:

```
CONFIG_HIGHMEM4G=y

# CONFIG_HIGHMEM64G is not set

CONFIG_PAGE_OFFSET=0xC0000000

CONFIG_HIGHMEM=y

CONFIG_ARCH_FLATMEM_ENABLE=y

CONFIG_ARCH_SPARSEMEM_ENABLE=y

CONFIG_ARCH_SELECT_MEMORY_MODEL=y

CONFIG_SELECT_MEMORY_MODEL=y

CONFIG_FLATMEM_MANUAL=y

# CONFIG_DISCONTIGMEM_MANUAL is not set

# CONFIG_SPARSEMEM_MANUAL is not set

CONFIG_FLATMEM=y

CONFIG_FLAT_NODE_MEM_MAP=y

CONFIG_SPARSEMEM_STATIC=y

CONFIG_SPLIT_PTLOCK_CPUS=4

```

Is there something set wrong, should I check somewhere else? This is kind of a big deal because this is a production system and I really need the other ~700MB that is missing, not to mention the fact that I am about to add another processor and another 4GB of memory! I  suppose I can downgrade the kernel is I need to, but I'd rather use that as a last resort.

Any ideas?Last edited by Ast0r on Thu Sep 21, 2006 9:53 am; edited 1 time in total

----------

## Voltago

Tried to set 64GB of high memory?

----------

## Ast0r

 *Voltago wrote:*   

> Tried to set 64GB of high memory?

 

I was under the impression that it would not boot if I enabled 64G high memory unless I had more than 4GB of RAM. Perhaps someone can disabuse me of that notion if it is incorrect.

Unfortunately this is a production system sitting in a datacenter. If there is a relatively sure solution then it's ok to have a little downtime (the 5 minutes that it takes to restart) to get everything right, but I can't afford to go down there and try booting kernels that might not boot in hopes that enough memory will show up. I wish that I had that luxury, but I don't.  :Sad: 

----------

## Voltago

 *Ast0r wrote:*   

>  *Voltago wrote:*   Tried to set 64GB of high memory? 
> 
> I was under the impression that it would not boot if I enabled 64G high memory unless I had more than 4GB of RAM. Perhaps someone can disabuse me of that notion if it is incorrect.
> 
> Unfortunately this is a production system sitting in a datacenter. If there is a relatively sure solution then it's ok to have a little downtime (the 5 minutes that it takes to restart) to get everything right, but I can't afford to go down there and try booting kernels that might not boot in hopes that enough memory will show up. I wish that I had that luxury, but I don't. 

 

Well, I'm pretty sure that the 64GB-kernel will boot with any amount of memory (SuSE used to have them by default). But I'm not sure at all if this will solve your problem, sorry.

For what it's worth: When I got my new laptop with 1GB of memory, only 860MB or so showed up. I had to select 4GB high mem to take full advantage of my memory. Perhaps you're seeing something similar.

----------

## Ast0r

Well, it worked before I upgraded the kernel, so I don't see how than can be it, unless that changed in 2.6.17.

----------

## TerminalJack

Voltago, thanks for including the 'for what it's worth' tidbit.  My system has 1GB of memory but the OS only saw 865MB.  (I actually never noticed until just then--I just switched to Gentoo about a week ago.)

After reading your post I changed my kernel configuration and now it sees 1012MB!   :Very Happy: 

The help in menuconfig regarding High Memory Support is a little misleading.  Having exactly 1GB, I followed instructions and compiled the kernel with the option off.

Thanks again!

----------

## Ast0r

I see to have found the missing ~800MB of memory! I just noticed that dmesg says this

```
BIOS-provided physical RAM map:

 BIOS-e820: 0000000000000000 - 0000000000097000 (usable)

 BIOS-e820: 0000000000097000 - 00000000000a0000 (reserved)

 BIOS-e820: 00000000000e4000 - 0000000000100000 (reserved)

 BIOS-e820: 0000000000100000 - 00000000cff70000 (usable)

 BIOS-e820: 00000000cff70000 - 00000000cff78000 (ACPI data)

 BIOS-e820: 00000000cff78000 - 00000000cff80000 (ACPI NVS)

 BIOS-e820: 00000000cff80000 - 00000000d0000000 (reserved)

 BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved)

 BIOS-e820: 00000000fec00000 - 00000000fec10000 (reserved)

 BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)

 BIOS-e820: 00000000ff800000 - 00000000ffc00000 (reserved)

 BIOS-e820: 00000000fffffc00 - 0000000100000000 (reserved)

 BIOS-e820: 0000000100000000 - 0000000130000000 (usable)

Warning only 4GB will be used.

Use a PAE enabled kernel.

3200MB HIGHMEM available.

896MB LOWMEM available.

```

Can anyone explain what this means? I see that it says that 896MB of "LOWMEM" is available with 3200MB of "HIGHMEM" but what does this mean? Is the LOWMEM unavailable for use by the system? Does the kernel use that to it's own ends? It this non-optimal? Should I change something?

I just read an article about kernel memory mapping and I understood part of it. I understood the jist of it to be that the kernel can only directly map the first 896MB of RAM and that everything past that is virtually mapped. Said virtually mapped memory addresses are translated by the MMU in the CPU into real memory addresses, etc.

This server runs Postgres and Apache + mod_php5 and I need a lot of RAM available for these services (I currently have Postgres allocating about 2GB of shared memory plus some other memory for pg_autovacuum buffers, etc ). Is it disadvantageous having so much memory (896MB) dedicated to the kernel LOWMEM? It seems like it would be better to have more available for the postgres and apache daemons than reserved for OS I/O buffers and such, but maybe I am wrong.

Anyone?

----------

## x22

You may use

```
cat /proc/meminfo
```

to see how much lowmem/highmem is in use.

But the real problem should be here:

```
BIOS-e820: 0000000100000000 - 0000000130000000 (usable) 
```

This is above 4GB!

BIOS and ACPI uses some of the <4GB address space so some real memory (768MB) is remapped above 4GB. You have to use PAE (the 64GB option) to use it.

----------

## Ast0r

 *x22 wrote:*   

> You may use
> 
> ```
> cat /proc/meminfo
> ```
> ...

 

Ok, that is the answer that I was looking for. I am going to be adding another processor and another 4GB of RAM in the new couple weeks and I was planning on enabling PAE at that time (I actually already built the kernel, it's just a matter of booting it). It can wait until then!

Thank you very much.  :Smile: 

----------

## hasenhei

 *x22 wrote:*   

> You may use
> 
> ```
> cat /proc/meminfo
> ```
> ...

 

I guess that's what I did:

```

CONFIG_HIGHMEM64G=y

CONFIG_PAGE_OFFSET=0xC0000000

CONFIG_HIGHMEM=y

CONFIG_X86_PAE=y

CONFIG_ARCH_FLATMEM_ENABLE=y

CONFIG_ARCH_SPARSEMEM_ENABLE=y

CONFIG_ARCH_SELECT_MEMORY_MODEL=y

CONFIG_SELECT_MEMORY_MODEL=y

CONFIG_FLATMEM_MANUAL=y

# CONFIG_DISCONTIGMEM_MANUAL is not set

# CONFIG_SPARSEMEM_MANUAL is not set

CONFIG_FLATMEM=y

CONFIG_FLAT_NODE_MEM_MAP=y

CONFIG_SPARSEMEM_STATIC=y

CONFIG_SPLIT_PTLOCK_CPUS=4

CONFIG_RESOURCES_64BIT=y

```

but still dmesg says

```

[    0.000000] Linux version 2.6.18-gentoo-r2 (root@muitl001) (gcc version 4.1.1 (Gentoo 4.1.1)) #3 SMP Thu Nov 16 18:03:18 CET 2006

[    0.000000] BIOS-provided physical RAM map:

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

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

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

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

[    0.000000]  BIOS-e820: 00000000bfff0000 - 00000000bfffe000 (ACPI data)

[    0.000000]  BIOS-e820: 00000000bfffe000 - 00000000c0000000 (ACPI NVS)

[    0.000000]  BIOS-e820: 00000000fec00000 - 00000000fec03000 (reserved)

[    0.000000]  BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)

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

[    0.000000] Warning only 4GB will be used.

[    0.000000] Use a PAE enabled kernel.

[    0.000000] 3200MB HIGHMEM available.

[    0.000000] 896MB LOWMEM available.

[    0.000000] found SMP MP-table at 000ff780

[    0.000000] On node 0 totalpages: 1048576

[    0.000000]   DMA zone: 4096 pages, LIFO batch:0

[    0.000000]   Normal zone: 225280 pages, LIFO batch:31

[    0.000000]   HighMem zone: 819200 pages, LIFO batch:31

[    0.000000] DMI 2.3 present.

```

and I only see 3035 MB out of my 4 GB of memory....

any ideas ?

----------

## Ast0r

 *hasenhei wrote:*   

>  *x22 wrote:*   You may use
> 
> ```
> cat /proc/meminfo
> ```
> ...

 

Switching to a 64G kernel fixed my missing RAM issue. I added 4GB, added another processor, rebooted with the 64G kernel and now it sees all 8GB.

----------

## hasenhei

Thx for your feedback Ast0R.

 *Ast0r wrote:*   

> 
> 
> Switching to a 64G kernel fixed my missing RAM issue. I added 4GB, added another processor, rebooted with the 64G kernel and now it sees all 8GB.

 

Well, I believe I am using a 64G kernel, but still I have the same problems...

Has anybody got a hint ?

----------

