5

Browsing the linux kernel output dmesg on 6 different systems (4 server, and for the sake of comparison also 2 laptops) I am shocked by the large amount of BIOS/UEFI reserved RAM

Three servers systems have this output

3 x server with 128GiB RAM show this
[    0.000000] Memory: 5491432k/136314880k available (7668k kernel code, 2636180k absent, 2440136k reserved, 6052k data, 1876k init)
=> ~2.5GiB RAM "BIOS-reserverd"    

1 x server with 512GiB RAM show this:
[    5.892498] Memory: 527942676K/536409480K available (10252K kernel code, 1241K rwdata, 3320K rodata, 1592K init, 2272K bss, 8466804K reserved, 0K cma-reserved)
=> ~8.5GiB "lost to BIOS"

1 x latop with this info
[    0.086548] Memory: 16115288K/16583384K available (14339K kernel code, 1524K rwdata, 7928K rodata, 1660K init, 2928K bss, 467840K reserved, 0K cma-reserved)
=> ~450MiB reserved (256 is VGA, but still 200MB out of 16GiB is )

1 x laptop (thinkpad x200s no uefi) yields: 
[    0.432824] Memory: 8022988K/8282140K vailable (14339K kernel code, 1524K rwdata, 7912K rodata, 1660K init, 2928K bss, 258892K reserved, 0K cma-reserved) 
=> 258 MiB (however this being almost entirely the graphic 256MiB)

I can understand, that some memory is retained by the firmware (UEFI/BIOS), however the loss of 8.5GiB or ECC RAM seems not easy to understand.

I wonder how I should think about the reseverd -and hence lost- RAM.

To me it seems that the EFI systems have a tendency to take roughly 1.5% of total physical RAM.

Can those values be corroborated?

Can there be an explanation why the UEFI uses so much RAM? (8.5GiB is more than most laptop systems I ran a full flagged desktop multi media system on, have used).

fraleone
  • 171
  • 3

1 Answers1

0

Those type of losses are rarely due to the machine or BIOS actually using actually RAM, but rather, allocating some of the address space for purposes other than RAM.

For example, before having over 2 gigabytes of RAM was popular, many manufactors just decided that any address with a "1" in the first bit was for hardware use other than RAM, and there went the other 2-gigs right there.

I'm not too familiar with modern larger address buses, but the point is that every thing that goes over the bus using DMA (direct memory access) or similar, grabs pretty much what it wants to in terms of address space. A RS-232 serial card might only need under 100 addresses, but they manufactor can decided to spend a small amount of time and money to make it grab just what it need, but can also just decide to grab 32k, 32meg or whatever else they feel like grabbing for address space. There a lots of things on your motherboard that use up address space as well.

Bottom line is, that also some things just grab the address space and you ussually can't do much to change that. So if this is your problem (it may or may not be) there's not much you can other than live with it or change the hardware. Try to use utilities that show you what address space ranges your hardware uses... maybe there something there you can get rid of. Hypothetically speaking, your server might have, for example, a secondary set of sound chips on the motherboard that are pigging out for reason. Turning off unused stuff in the BIOS might help, but I wouldn't expect much.

Again, I'm not really sure how the modern larger address buses work, but getting a larger one is probably the way to go. If you get a machine that can accept 2 or 4 or even 16 times as much RAM as actually need, that will mean that it also has (unless stuff has changed it's implimentations) 2, 4, or 16 times as much address space as you need for RAM (or "DRAM" or whatever) so your hardware should then be able to waste 75% or more of your biggest address space without causing that problem. :-)

Android 3
  • 1
  • 1
  • Do you know any command or kernel flag that can prove this for a given system, possibly even pinpoint the particular bus/device that caused the excessive RAM reservation? – anx Nov 27 '22 at 21:39
  • There is information is littered about in all sorts of hardware reporting messages. On Microsoft Windows, almost any "Device" in the "Device Manager" that has a "Memory Range" listed on the "Resources" tab will list it's reserved space there. When using FreeBSD a huge list of devices is listed by default upon bootup, and then again in X's log if you use X. They're almost always listed as just two large Hexadecimal numbers with a dash between them. Subtract the first number from the second number in each range, and you'll know they're grabbing at least that much. Also check you BIOS. – Android 3 Nov 28 '22 at 02:18