linux kernel virtual space , lowmem , highmem , RAM size

1

I need some help understanding the exact relations between the linux kernel virtual space , specifically LOWMEM area , and the available RAM size as seen by the kernel.

after reading this article: https://lwn.net/Articles/75174/ and some other users threads' i have come to the following connections:

  1. As we all know , the 32bit virtual address space (4GB) is divided into user space address and kernel space address usually by ratio of 3GB/1GB or 2GB/2GB.

  2. Inside the kernel space address we can find the kernel image itself , vmalloc area and some other staff.. the one that interesting me is the LOWMEM area.

3.LOWMEM is an area of kernel's virtual addresses which mapped directly into physical RAM for efficiency without using "mid level" translations.

  1. For this question I'm ignoring the HIGHMEM area since its not exists in my system (turned it off by menuconfig).

  2. The system have 1.5GB RAM. When the virtual address space got split between the user and the kernel by ratio of 3/1 , the kernel recognized only 768MB (or something close to that) of TotalMem.

Allegedly the explanation for that is the kernel had 1 GB of virtual address space , from that we need to subtract the kernel image itself, vmalloc area and some other components and than we left with 768 MB of LOWMEM which apparently for some reason is also the amount of total memory that I have in my system.

when I changed the ratio to 2GB/2GB , the LOWMEM area increased and then I saw a TotalMem of 1.5GB (again , almost 1.5GB for the same reasons)

so the mid conclusion is that the size of kernel's LOWMEM area is the size of the TotalMem I have in the system.

I know that I'm missing something here because there is no way its true.

  1. Why do I need to increase the LOWMEM area to get more visible RAM size? the data structures for managing the memory are not that big..

  2. How this affects the applications in user space? why increasing the LOWMEM area have any impact at all on the other 3GB/2GB of user space addresses?

thanks!

hutcruchi

Posted 2019-09-11T06:55:27.317

Reputation: 11

Don't forget that most of those apply to a 32-bit system, which are rare today. Do you need this for a 32-bit system? Any reason you can't switch to a 64-bit kernel? – dirkt – 2019-09-11T08:52:53.337

yes. It's part of the system design and requirements. can't change that. – hutcruchi – 2019-09-11T11:42:09.163

No answers