You are not logged in.

#1 2017-05-12 17:48:52

phunni
Member
From: Bristol, UK
Registered: 2003-08-13
Posts: 768

Only 15Gb of memory available, despite there being 32Gb

On a new build, I have 32Gb of memory, but the kernel only appears to be seeing 15Gb:

# free -g
              total        used        free      shared  buff/cache   available
Mem:             15           0          13           0           1          14
Swap:             0           0           0

The BIOS is reporting 32Gb of memory, so it's not something as simple as the memory sticks not being installed properly - they're in OK and visible, but, as far as I can see, not to Linux.

The system is an AMD Ryzen 7 1700x on a Gigabyte AB350-Gaming-3 motherboard and Gskill Ripjaws V series memory - 4 x 8Gb.

# lshw -short | grep 'System\ Memory'
/0/27                         memory      32GiB System Memory 

Further demonstrating that the memory is visible.

I did see (and prematurely post on) this post, which seemed to suggest a motherboard issue, but I'm running on a completely different system/motherboard, so it seems unlikely to be related - despite the similarity of symptoms.

Offline

#2 2017-05-12 18:09:32

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: Only 15Gb of memory available, despite there being 32Gb

Likely it's the same BIOS emulation bug again. Your machine might be different but hardware vendors don't write their own firmware, they buy it from others and only add tweaks.

Post

dmesg |grep e820

If you don't want to reinstall, try some UEFI live cd and see if it works better.

Offline

#3 2017-05-12 18:14:10

phunni
Member
From: Bristol, UK
Registered: 2003-08-13
Posts: 768

Re: Only 15Gb of memory available, despite there being 32Gb

Thanks for the reply.

# dmesg |grep e820
[    0.000000] e820: BIOS-provided physical RAM map:
[    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009d3ff] usable
[    0.000000] BIOS-e820: [mem 0x000000000009d400-0x000000000009ffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000000e0000-0x00000000000fffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000000100000-0x0000000009cfffff] usable
[    0.000000] BIOS-e820: [mem 0x0000000009d00000-0x0000000009ffffff] reserved
[    0.000000] BIOS-e820: [mem 0x000000000a000000-0x00000000dbe26fff] usable
[    0.000000] BIOS-e820: [mem 0x00000000dbe27000-0x00000000dbfb8fff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000dbfb9000-0x00000000dc0affff] usable
[    0.000000] BIOS-e820: [mem 0x00000000dc0b0000-0x00000000dc48efff] ACPI NVS
[    0.000000] BIOS-e820: [mem 0x00000000dc48f000-0x00000000dcfd0fff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000dcfd1000-0x00000000deffffff] usable
[    0.000000] BIOS-e820: [mem 0x00000000df000000-0x00000000dfffffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000f8000000-0x00000000fbffffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fdf00000-0x00000000fdffffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fea00000-0x00000000fea0ffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000feb80000-0x00000000fec01fff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fec10000-0x00000000fec10fff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fec30000-0x00000000fec30fff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fed00000-0x00000000fed00fff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fed40000-0x00000000fed44fff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fed80000-0x00000000fed8ffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fedc2000-0x00000000fedcffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fedd4000-0x00000000fedd5fff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fee00000-0x00000000feefffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000ff000000-0x00000000ffffffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000041f37ffff] usable
[    0.000000] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
[    0.000000] e820: remove [mem 0x000a0000-0x000fffff] usable
[    0.000000] e820: last_pfn = 0x41f380 max_arch_pfn = 0x400000000
[    0.000000] e820: update [mem 0xdf000000-0xffffffff] usable ==> reserved
[    0.000000] e820: last_pfn = 0xdf000 max_arch_pfn = 0x400000000
[    0.000000] e820: [mem 0xe0000000-0xf7ffffff] available for PCI devices
[    1.410432] e820: reserve RAM buffer [mem 0x0009d400-0x0009ffff]
[    1.410433] e820: reserve RAM buffer [mem 0x09d00000-0x0bffffff]
[    1.410433] e820: reserve RAM buffer [mem 0xdbe27000-0xdbffffff]
[    1.410434] e820: reserve RAM buffer [mem 0xdc0b0000-0xdfffffff]
[    1.410434] e820: reserve RAM buffer [mem 0xdf000000-0xdfffffff]
[    1.410435] e820: reserve RAM buffer [mem 0x41f380000-0x41fffffff]

Offline

#4 2017-05-12 18:19:40

loqs
Member
Registered: 2014-03-06
Posts: 17,321

Re: Only 15Gb of memory available, despite there being 32Gb

@mich41 so if phunni boots the live media in EFI mode all the memory should be available if it is the same issue?

Offline

#5 2017-05-12 18:55:12

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: Only 15Gb of memory available, despite there being 32Gb

[    0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000041f37ffff] usable

There we go, 0x41f37ffff is roughly 16GB and this is the end of memory ranges reported by BIOS.

Yes, booting in UEFI mode worked for the last guy so it should help here too if it's the same problem.

Offline

#6 2017-05-12 19:46:16

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: Only 15Gb of memory available, despite there being 32Gb

The other guy had this here:

[    0.000000] BIOS-e820: [mem 0x0000000100000000-0x00000003ab35efff] usable
[    0.000000] BIOS-e820: [mem 0x00000003ab35f000-0x000000085dffffff] reserved

It saw all RAM, but for some reason most of it was put as "reserved" in that listing. Those numbers there are 15,757,340,672 and 35,936,796,671.

Offline

#7 2017-05-12 20:23:00

phunni
Member
From: Bristol, UK
Registered: 2003-08-13
Posts: 768

Re: Only 15Gb of memory available, despite there being 32Gb

Does the installer boot in UEFI mode? If so, that's not the issue since I only had 15Gb during the install, but I hoped it might be better in the installed system. My mobo definitely supports UEFI boot.

Offline

#8 2017-05-12 20:28:21

loqs
Member
Registered: 2014-03-06
Posts: 17,321

Re: Only 15Gb of memory available, despite there being 32Gb

The installer is a hybrid it can boot in either BIOS or EFI mode.  Which your firmware decided to use is usually determined by firmware settings such as legacy boot.
Did you install the system as an EFI system or a BIOS system?

Offline

#9 2017-05-12 20:50:58

phunni
Member
From: Bristol, UK
Registered: 2003-08-13
Posts: 768

Re: Only 15Gb of memory available, despite there being 32Gb

I installed the system as a BIOS system - simply because it was familiar, to be honest.

I did, however, boot into the installer and double checked it had booted via EFI by running "ls /sys/firmware" and confirming that there was an EFI directory in there.  I also confirmed that I still only have 15Gb of memory in the installer, which, I assume, means that this isn't an issue with BIOS/EFI?

Offline

#10 2017-05-12 21:24:50

loqs
Member
Registered: 2014-03-06
Posts: 17,321

Re: Only 15Gb of memory available, despite there being 32Gb

The workaround of switching to EFI is not working in this case.  So it is either a firmware issue both on EFI and BIOS supplying bad mappings to the linux kernel or the linux kernel has a bug in it reading valid mappings.
There are various kernel parameters that can influence the mappings for instance add_efi_memmap,  firmware settings plus firmware updates as well may resolve it.

Offline

#11 2017-05-13 08:30:32

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: Only 15Gb of memory available, despite there being 32Gb

Is the memory correctly reported otherwise, eg. in https://www.archlinux.org/packages/extr … emtest86+/ ?

Offline

#12 2017-05-13 08:51:58

max.bra
Member
From: Bologna - Italy
Registered: 2008-06-02
Posts: 93

Re: Only 15Gb of memory available, despite there being 32Gb

if present in your firmware can you confirm:

memory hole: disabled
memory remapping (this name is only similar platform by platform): enabled

then:

1) add this two kernel boot parameters:

enable_mtrr_cleanup mtrr_spare_reg_nr=0

2) dmesg text something similar but, please can you post output of (before and after previous kernel params):

cat /proc/mtrr

Last edited by max.bra (2017-05-13 08:57:56)

Offline

#13 2017-05-13 17:03:19

phunni
Member
From: Bristol, UK
Registered: 2003-08-13
Posts: 768

Re: Only 15Gb of memory available, despite there being 32Gb

@max.bra - I'm afraid I can't find those settings in the bios.  The only memory settings I can find are: System memory multiplier, memory frequency, memory timing mode, profile DDR voltage, channel interleaving, rank interleaving and sub-timings for channel A & B. Before adding the kernel params cat /proc/mtrr returns:

reg00: base=0x000000000 (    0MB), size= 2048MB, count=1: write-back
reg01: base=0x080000000 ( 2048MB), size= 1024MB, count=1: write-back
reg02: base=0x0c0000000 ( 3072MB), size=  512MB, count=1: write-back
reg03: base=0x0df000000 ( 3568MB), size=   16MB, count=1: uncachable

After adding the kernel parameters:

reg00: base=0x000000000 (    0MB), size= 4096MB, count=1: write-back
reg01: base=0x0df000000 ( 3568MB), size=   16MB, count=1: uncachable
reg02: base=0x0e0000000 ( 3584MB), size=  512MB, count=1: uncachable

Last edited by phunni (2017-05-13 17:46:50)

Offline

#14 2017-05-13 21:03:58

max.bra
Member
From: Bologna - Italy
Registered: 2008-06-02
Posts: 93

Re: Only 15Gb of memory available, despite there being 32Gb

this is my mtrr (w/o cleanup) with my 16GB sticks

reg00: base=0x000000000 (    0MB), size= 2048MB, count=1: write-back
reg01: base=0x080000000 ( 2048MB), size= 1024MB, count=1: write-back
reg02: base=0x0c0000000 ( 3072MB), size=  512MB, count=1: write-back
reg03: base=0x100000000 ( 4096MB), size= 4096MB, count=1: write-back
reg04: base=0x200000000 ( 8192MB), size= 8192MB, count=1: write-back
reg05: base=0x400000000 (16384MB), size=  512MB, count=1: write-back
reg06: base=0x41f000000 (16880MB), size=   16MB, count=1: uncachable

as you can see, the memory ranges are listed up to 16GB.
where are yours???

i'm with mich41, definitely. very bad bios emulation. have you F6 firmware revision yet?
you should completely disable bios/legacy mode booting, reinstall arch in uefi mode (or an efi live cd test), and open a gigabyte support ticket.

p.s.: (if feasible) "secure booted" win10 amount of ram?

Offline

#15 2017-05-13 22:15:24

phunni
Member
From: Bristol, UK
Registered: 2003-08-13
Posts: 768

Re: Only 15Gb of memory available, despite there being 32Gb

do have F6 - I installed it before installing arch.  I'll reinstall arch, although doesn't the fact that I still only saw 15 GB when I booted into the installer in efi mode show that isn't the problem?

Offline

#16 2017-05-14 06:13:30

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: Only 15Gb of memory available, despite there being 32Gb

And this is mine from a 32GB machine, MTRRs aren't really that important as they have been superseded by PAT.

reg00: base=0x000000000 (    0MB), size= 2048MB, count=1: write-back
reg01: base=0x080000000 ( 2048MB), size= 1024MB, count=1: write-back
reg02: base=0x0c0000000 ( 3072MB), size=  256MB, count=1: write-back
phunni wrote:

do have F6 - I installed it before installing arch.  I'll reinstall arch, although doesn't the fact that I still only saw 15 GB when I booted into the installer in efi mode show that isn't the problem?

And are you really sure you booted in UEFI mode? The board is speced up to 64GB and hopefully they tested it, so it should work.

Try this add_efi_memmap somebody suggested.

Maybe paste complete dmesg or at least the initial part with 0.000000 timestamps.

Offline

#17 2017-05-15 23:10:35

phunni
Member
From: Bristol, UK
Registered: 2003-08-13
Posts: 768

Re: Only 15Gb of memory available, despite there being 32Gb

I'm as sure I can be that I booted into the installer in EFI mode - /sys/firmware/efi existed, which google tells me is the way to tell...

Is it possible to switch to EFI without a complete reinstall? Does it need both the EFI partition and the tiny GPT partition? I already have the latter, but not the former.

Don't know if it's relevant, but memtest thinks I only have 16gb of memory, although the BIOS system information definitely says 32gb...

Last edited by phunni (2017-05-15 23:11:45)

Offline

#18 2017-05-15 23:50:10

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: Only 15Gb of memory available, despite there being 32Gb

About how to switch to UEFI:

You wrote you already use GPT. You just need to add an EFI partition. You should be able to do this live with GParted. You'd shrink a partition to make room, create a partition with FAT32 filesystem, give it the EFI partition attribute (in the "manage flags" dialog, flag it "boot" and "esp"). You mount the new EFI partition as /boot, reinstall the kernel package to create the kernel image and initramfs in the new /boot, then install systemd's bootloader with "bootctl install". This "bootctl install" wants to see efi variables in /sys/firmware/efi, but you could still just try it while booted through BIOS as it might copy its files before complaining, and the files alone should be enough for UEFI to boot it. You then add a config file for the kernel you use in /boot/loader/entries/.

Last edited by Ropid (2017-05-15 23:54:12)

Offline

#19 2017-05-16 12:46:17

phunni
Member
From: Bristol, UK
Registered: 2003-08-13
Posts: 768

Re: Only 15Gb of memory available, despite there being 32Gb

Interesting - I already have a /boot partition (I've given it a separate partition for years as a matter of course) of about 200M. Presumably, I just have to reformat it as FAT32 (it's currently EXT4), reinstall the kernel and install systemd's bootloader, add those flags you mentioned and then I'm golden?

Offline

#20 2017-05-18 21:51:45

monochrome
Member
Registered: 2016-12-01
Posts: 1

Re: Only 15Gb of memory available, despite there being 32Gb

I just want to chime in since I relatively recently did a BIOS->UEFI conversion myself, and it was pretty painless. Here are the steps I followed:

  • Copy the contents of my ext4 /boot to a temporary directory

  • Re-format /boot as FAT32, mark as EFI partition, and restore all the files to it. I think you can re-install your old bootloader at this point to ensure BIOS still works as a backup if things go south.

  • Install and configure systemd's bootloader. Since you are not in EFI mode as you do this, the install process will fail to register itself as a boot target, but all the necessary files will be written. Remember that you do need to manually configure systemd's bootloader, it won't auto-detect your system.

  • Reboot, and use the BIOS to manually boot that specific drive in UEFI mode. The UEFI firmware will find the EFI partition and boot a specific fallback file in that partition which bootctl will have created.

  • Now that you are in EFI mode, re-run bootctl install, which will now 'officially' add systemd-boot as a UEFI boot target, and you should be done.

  • Once you confirm it works, you can remove the old BIOS bootloader files from /boot (was syslinux in my case)

Hope that helps.

Offline

Board footer

Powered by FluxBB