LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Linux always reserves a portion of memory? (https://www.linuxquestions.org/questions/linux-newbie-8/linux-always-reserves-a-portion-of-memory-4175706602/)

ciel 01-18-2022 07:09 PM

Linux always reserves a portion of memory?
 
Hello everyone! I've been using Linux for sometime now and always had this question that hopefully someone more familiar with it can help clarify:

Seems that Linux always reserves memory proportional to the total amount of RAM installed?

This can not be explained by MMIO address ranges (such as 0xfee0000 for the APIC, it is also questionable whether MMIO address ranges masks out any RAM, as the RAM can be remapped by the firmware), firmware reserved RAM (such as the ACPI ranges), or RAM stolen by the integrated GPU.

You can see it reserving memory from this line in dmesg output:

Quote:

Memory: 3937300K/4193784K available (... , 256484K reserved, ...)
Dividing the reserved size (256484k in this case) by the total size (4193784k in this case) will get you the percentage of reserved memory.

Since the MMIO ranges, the firmware reserved ranges and the integrated GPU stolen ranges shouldn't scale linearly with amount of RAM in the system, machines with lots of RAM (such as servers) should have a very low percentage of reserved RAM. However, I've never seen a dmesg log that shows a percentage of reserved RAM lower than 1.5% (for x86_64) or 1.0% (for 32bit pae kernels).

Do you guys see the same or does your system show a lower percentage of reserved RAM than 1.5%? If so would you please share the config (arch, kernel version, maybe distro also matters?) and the total and reserved sizes in dmesg?

Another question: Is there a way to find out for what purposes is this memory reserved for?

frankbell 01-18-2022 07:57 PM

Your question is well above my head, but you may find the documentation at kernel.org helpful.

pan64 01-19-2022 01:08 AM

Quote:

Originally Posted by ciel (Post 6319768)
Seems that Linux always reserves memory proportional to the total amount of RAM installed?

How do you know that?

fatmac 01-19-2022 04:13 AM

Probably to help prevent sudden crashes when running out of physical memory, allowing enough for a warning to be issued(?).

sundialsvcs 01-19-2022 08:16 PM

Since "reserved memory" appears to be related to device drivers, also this: https://xilinx-wiki.atlassian.net/wi...eserved+Memory


All times are GMT -5. The time now is 04:46 AM.