Kernel cannot detect the full memory

Bug #2039382 reported by Chan Jui Huang
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux-signed-hwe-6.2 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Hi ubuntu,
I use ubuntu22.04 in my laptop. When I open the laptop, sometimes ubuntu cannot detect all memory.
My laptop has 16GB memory, sometimes ubuntu detect 2.5GB.

I already use memtest86 test the health of the memory. It doesn’t show any error.
I think this problem is from the OS. Please help me!

Thank you very much
Ray

PS.
uname -a:
Linux ubuntu 6.2.0-34-generic #34~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 7 13:12:03 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

lshw -C memory:
  *-firmware
       description: BIOS
       vendor: Dell Inc.
       physical id: 0
       version: 1.26.0
       date: 06/13/2023
       size: 64KiB
       capacity: 16MiB
       capabilities: pci pnp upgrade shadowing cdboot bootselect edd int13floppynec int13floppy1200 int13floppy720 int13floppy2880 int5printscreen int9keyboard int14serial int17printer acpi usb smartbattery biosbootspecification netboot uefi
  *-memory
       description: System Memory
       physical id: 41
       slot: System board or motherboard
       size: 16GiB
     *-bank:0
          description: DIMM [empty]
          physical id: 0
          slot: ChannelA-DIMM0
     *-bank:1
          description: SODIMM DDR4 Synchronous Unbuffered (Unregistered) 2400 MHz (0.4 ns)
          product: HMA82GS6AFR8N-UH
          vendor: Hynix Semiconductor (Hyundai Electronics)
          physical id: 1
          serial: 4247000D
          slot: DIMM B
          size: 16GiB
          width: 64 bits
          clock: 2400MHz (0.4ns)
  *-cache:0
       description: L1 cache
       physical id: 45
       slot: L1 Cache
       size: 256KiB
       capacity: 256KiB
       capabilities: synchronous internal write-back unified
       configuration: level=1
  *-cache:1
       description: L2 cache
       physical id: 46
       slot: L2 Cache
       size: 1MiB
       capacity: 1MiB
       capabilities: synchronous internal write-back unified
       configuration: level=2
  *-cache:2
       description: L3 cache
       physical id: 47
       slot: L3 Cache
       size: 6MiB
       capacity: 6MiB
       capabilities: synchronous internal write-back unified
       configuration: level=3
  *-memory UNCLAIMED
       description: Memory controller
       product: Sunrise Point-LP PMC
       vendor: Intel Corporation
       physical id: 1f.2
       bus info: pci@0000:00:1f.2
       version: 21
       width: 32 bits
       clock: 33MHz (30.3ns)
       configuration: latency=0
       resources: memory:df42c000-df42ffff

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: linux-image-6.2.0-34-generic 6.2.0-34.34~22.04.1
ProcVersionSignature: Ubuntu 6.2.0-34.34~22.04.1-generic 6.2.16
Uname: Linux 6.2.0-34-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Sun Oct 15 17:53:09 2023
InstallationDate: Installed on 2023-10-08 (7 days ago)
InstallationMedia: Ubuntu 22.04.3 LTS "Jammy Jellyfish" - Release amd64 (20230807.2)
SourcePackage: linux-signed-hwe-6.2
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Chan Jui Huang (ray-huanggggg) wrote :
Revision history for this message
Chan Jui Huang (ray-huanggggg) wrote :

the dmesg log

Revision history for this message
Chan Jui Huang (ray-huanggggg) wrote :

the report from the lspci -vvnn

affects: ubuntu → linux-signed-hwe-6.2 (Ubuntu)
Revision history for this message
Matthew Ruffell (mruffell) wrote :

Hi Ray,

Your dmesg log shows 16gb of usable memory.

[ 0.159452] Memory: 16117124K/16648596K available (20480K kernel code, 4152K rwdata, 12720K rodata, 4764K init, 17540K bss, 531212K reserved, 0K cma-reserved)

Could you please wait until you happen to get a boot where you get less memory than expected and attach a dmesg log? I'll compare the two and see if there are any differences.

Thanks,
Matthew

Revision history for this message
Chan Jui Huang (ray-huanggggg) wrote :

Hi Matthew,
Thank you for your response. I reappear this problem.
Please see the attachment!

Thank you very much.
Ray

PS.

There is the free command to show.
               total used free shared buff/cache available
Mem: 2616340 1126524 488304 48016 1001512 1216636
Swap: 0 0 0

Revision history for this message
Matthew Ruffell (mruffell) wrote :
Download full text (3.4 KiB)

Hi Ray,

I can see the difference:

diff --git a/dmesg_working.log b/dmesg_broken.log
index 79e34be..de76884 100644
--- a/dmesg_working.log
+++ b/dmesg_broken.log
@@ -59,7 +59,7 @@ reserve setup_data: [mem 0x00000000fee00000-0x00000000fee00fff] reserved
-efi: ACPI=0xba282000 ACPI 2.0=0xba282000 SMBIOS=0xf0000 SMBIOS 3.0=0xf0020 TPMFinalLog=0xbabbe000 ESRT=0xbb0ca698 MEMATTR=0xb3db3018 MOKvar=0xbb29d000 RNG=0xba281018 TPMEventLog=0xa916b018
+efi: ACPI=0xba282000 ACPI 2.0=0xba282000 SMBIOS=0xf0000 SMBIOS 3.0=0xf0020 TPMFinalLog=0xbabbe000 ESRT=0xbb0ca698 MEMATTR=0xb4ee8018 MOKvar=0xbb29d000 RNG=0xba281018 TPMEventLog=0xa916b018
@@ -140,7 +140,7 @@ ACPI: Reserving DMAR table memory at [mem 0xba2b9290-0xba2b935b]
-NODE_DATA(0) allocated [mem 0x43f7d5000-0x43f7fffff]
+NODE_DATA(0) allocated [mem 0xb4ebc000-0xb4ee6fff]
@@ -218,7 +218,7 @@ Dentry cache hash table entries: 2097152 (order: 12, 16777216 bytes, linear)
-Memory: 16117124K/16648596K available (20480K kernel code, 4152K rwdata, 12720K rodata, 4764K init, 17540K bss, 531212K reserved, 0K cma-reserved)
+Memory: 2505280K/16648596K available (20480K kernel code, 4152K rwdata, 12720K rodata, 4764K init, 17540K bss, 14143056K reserved, 0K cma-reserved)
@@ -283,6 +283,7 @@ x86/fpu: xstate_offset[4]: 896, xstate_sizes[4]: 64
+efi: memattr: Failed to map EFI Memory Attributes table @ 0xb4ee8018

When everything works, you get your full 16gb:

-Memory: 16117124K/16648596K available (20480K kernel code, 4152K rwdata, 12720K rodata, 4764K init, 17540K bss, 531212K reserved, 0K cma-reserved)

and when it fails, you only get 2.5gb:

+Memory: 2505280K/16648596K available (20480K kernel code, 4152K rwdata, 12720K rodata, 4764K init, 17540K bss, 14143056K reserved, 0K cma-reserved)

The rest seems to be stuck in "reserved", but I looked at the e820 memory mapping and they were all the same. Very strange.

When it doesn't work, we see:

efi: memattr: Failed to map EFI Memory Attributes table @ 0xb4ee8018

If you look at 0xb4ee8018, that is on the EFI provided line:

+efi: ACPI=0xba282000 ACPI 2.0=0xba282000 SMBIOS=0xf0000 SMBIOS 3.0=0xf0020 TPMFinalLog=0xbabbe000 ESRT=0xbb0ca698 MEMATTR=0xb4ee8018 MOKvar=0xbb29d000 RNG=0xba281018

which differs from 0xb3db3018 when things work correctly.

It doesn't seem that you are alone either, these users also have the same issue, all with laptops:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1944019
https://www.reddit.com/r/openSUSE/comments/12besqn/tumbleweed_sometimes_the_system_only_recognizes/
https://askubuntu.com/questions/1365324/ubuntu-reports-significantly-less-ram-that-i-actually-have

They all had the same "efi: memattr: Failed to map EFI Memory Attributes table @ 0xb4ee8018" error.

I checked your BIOS version, and it seems to be the latest, at version 1.26.0:

[ 0.000000] DMI: Dell Inc. Latitude 3590/09GV6M, BIOS 1.26.0 06/13/2023

https://www.dell.com/support/home/en-nz/product-support/product/latitude-15-3590-laptop/drivers

One of the users in the bug report ran a system diagnostic from the BIOS. Could you boot into that and run it? It might do a memory check and maybe tweak the EFI memory layout to work.

One of the other users found t...

Read more...

Revision history for this message
Chan Jui Huang (ray-huanggggg) wrote :

Hi Matthew,
I appreciate your help. I try to repair this problem.

First, I diagnostic from the BIOS but it doesn't work.

Second, I try to unplug my wireless mouse then reboot the laptop more than five times.
The memory allocation looks good. Maybe the bug comes from the bios.

Do you have any suggestions to deal with this bug?

Tank you very much.
Ray

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.