Total amount of memory discrepancy

book

Article ID: 168012

calendar_today

Updated On:

Products

XOS

Issue/Introduction

CPM and Linux report different amounts of memoryAfter a CPM reboot, the system can start incorrectly reporting and using the total amount of memory due to a BIOS startup read failure.

# free -m
total used free shared buffers cached
Mem: 499 367 131 0 86 135
-/+ buffers/cache: 145 354
Swap: 494 0 494

# cat /proc/meminfo
total: used: free: shared: buffers: cached:
Mem: 523509760 385241088 138268672 0 90726400 142213120
Swap: 518053888 0 518053888
MemTotal: 511240 kB
MemFree: 135028 kB
...
Buffers: 88600 kB
Cached: 138880 kB
<removed>

CBS# show module status cp2 memory
NA = Not Available, DP = Data Plane, CP = Control Plane
cp = Control Processor, ap = Application Processor, np = Network Processor


Slot 14:
SDRAM 1 size 1048576(KB)
SDRAM 2 size 0(KB)
SDRAM 3 size 0(KB)
SDRAM 4 size 0(KB)
Total memory 511240(KB)
Used memory 376188(KB)
Free memory 135052(KB)
Shared memory 0(KB)
Buffers memory 88600(KB)
Cached memory 138880(KB)

The output above indicates that the SDRAM has 1GB of physical memory but the CLI (Total memory) and Linux tools (free and /proc/meminfo) only recognize 512MB.

Cause

This can happen if the BIOS-e820 facility, used to read memory during startup and pass it to the kernel, reports an incorrect value to kernel during the boot process.

The BIOS-e820 reports the amount of memory (address range) that can be used by the kernel and the address range (amount of memory) reserved for the BIOS.

Below are 2 examples of this situation. In the first case the memory is correctly informed and in the second one the BIOS-e820 reports it incorrectly.

Messages were extracted from /var/log/messages but can also be seeing using dmesg tool.

BIOS-e820 reports right amount of memory during startup
##############################################

Jan 14 23:02:54 cbs kernel: BIOS-provided physical RAM map:
Jan 14 23:02:54 cbs kernel: BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
Jan 14 23:02:54 cbs kernel: BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
Jan 14 23:02:54 cbs kernel: BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
Jan 14 23:02:54 cbs kernel: BIOS-e820: 0000000000100000 - 0000000040000000 (usable)
Jan 14 23:02:54 cbs kernel: BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
Jan 14 23:02:54 cbs kernel: BIOS-e820: 00000000ffb00000 - 0000000100000000 (reserved)
Jan 14 23:02:54 cbs kernel: 128MB HIGHMEM available.
Jan 14 23:02:54 cbs kernel: 896MB LOWMEM available.
Jan 14 23:02:54 cbs kernel: On node 0 totalpages: 262144
Jan 14 23:02:54 cbs kernel: zone(0): 4096 pages.
Jan 14 23:02:54 cbs kernel: zone(1): 225280 pages.
Jan 14 23:02:54 cbs kernel: zone(2): 32768 pages.
Jan 14 23:02:54 cbs kernel: Page-cache hash table entries: 262144 (order: 8, 1024 KB)
Jan 14 23:02:54 cbs kernel: Page-pin hash table entries: 65536 (order: 6, 256 KB)
Jan 14 23:02:54 cbs kernel: Dentry cache hash table entries: 131072 (order: 8, 1024 KB)
Jan 14 23:02:54 cbs kernel: Inode cache hash table entries: 65536 (order: 7, 512 KB)
Jan 14 23:02:54 cbs kernel: Buffer cache hash table entries: 65536 (order: 6, 256 KB)
Jan 14 23:02:54 cbs kernel: Memory: 1023416k/1048576k available (1952k kernel code, 21572k reserved, 1404k data, 172k init, 131072k highmem)

BIOS-e820 reports wrong amount of memory during startup
################################################

Aug 18 21:36:52 cbs kernel: BIOS-provided physical RAM map:
Aug 18 21:36:52 cbs kernel: BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
Aug 18 21:36:52 cbs kernel: BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
Aug 18 21:36:52 cbs kernel: BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
Aug 18 21:36:52 cbs kernel: BIOS-e820: 0000000000100000 - 0000000020000000 (usable)
Aug 18 21:36:52 cbs kernel: BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
Aug 18 21:36:52 cbs kernel: BIOS-e820: 00000000ffb00000 - 0000000100000000 (reserved)
Aug 18 21:36:52 cbs kernel: 0MB HIGHMEM available.
Aug 18 21:36:52 cbs kernel: 512MB LOWMEM available.
Aug 18 21:36:52 cbs kernel: On node 0 totalpages: 131072
Aug 18 21:36:52 cbs kernel: zone(1): 126976 pages.
Aug 18 21:36:52 cbs kernel: zone(2): 0 pages.
Aug 18 21:36:52 cbs kernel: Page-cache hash table entries: 131072 (order: 7, 512 KB)
Aug 18 21:36:52 cbs kernel: Page-pin hash table entries: 32768 (order: 5, 128 KB)
Aug 18 21:36:52 cbs kernel: Dentry cache hash table entries: 65536 (order: 7, 512 KB)
Aug 18 21:36:52 cbs kernel: Inode cache hash table entries: 32768 (order: 6, 256 KB)
Aug 18 21:36:52 cbs kernel: Buffer cache hash table entries: 32768 (order: 5, 128 KB)
Aug 18 21:36:52 cbs kernel: Memory: 508892k/524288k available (1952k kernel code, 12832k reserved, 1404k data, 172k init, 0k highmem)

The first thing that the BIOS-e820 does is to detect low memory, which is 640KB in all x86 architecture.

Jan 14 23:02:54 cbs kernel: BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
Aug 18 21:36:52 cbs kernel: BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)

0x09fc00 is the amount of memory that can be used by the kernel. In decimal format it represents 640KB.

After that, the BIOS-e820 reads the upper memory.

Jan 14 23:02:54 cbs kernel: BIOS-e820: 0000000000100000 - 0000000040000000 (usable)

0x040000000 is the amount of memory that can be used by the kernel; in decimal format it represents 1GB.

Below is the line with the incorrect value.

Aug 18 21:36:52 cbs kernel: BIOS-e820: 0000000000100000 - 0000000020000000 (usable)

0x020000000 is the amount of memory that can be used by the kernel; in decimal format it represents 512MB.

Resolution

In rare cases the BIOS can incorrectly report total amount of memory in any hardware platform, but this incorrect reporting doesn't necessarily mean faulty hardware. Reboot CPM and check it again before you return the blade to Crossbeam using the RMA process.

If the BIOS-e820 incorrectly reports the total amount of memory over several reboot operations, contact Crossbeam Customer Support.

Workaround

N/A