Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ZONE_NORMAL association with kernel/user-pages

alt text

Above is presented a case where I have only 512 MB of physical memory. What I have read up so far, is that ZONE_NORMAL is mapped to the kernel virtual address space as shown. Essentially I have a 512 MB physical memory, out of which 496 MB worth of ZONE_NORMAL is mapped to the kernel virtual space. Based on this understanding, following are my question:

  • Does, ZONE_NORMAL consists of only kernel space pages ?
  • If ZONE_NORMAL consists only of kernel pages and is mapped completely to the kernel space virtual address range, where do the user space pages get located ?? There does not seem to be any room for user space pages in physical memory.

I am totally mixed up of the case where the physical memory is less than 4GB as shown in this case that I have put forth. Have I "missed" out on the ZONE_HIGHMEM here ? How does it get determined, how much of the physical memory goes to ZONE_NORMAL and how much goes to ZONE_HIGHMEM ?

Would really appreciate if someone can throw light on this.

like image 451
TheLoneJoker Avatar asked Sep 15 '26 20:09

TheLoneJoker


1 Answers

Does, ZONE_NORMAL consists of only kernel space pages ?

=== NO.

ZONE_NORMAL means it is linearly mapped into the physical memory. The offset between the virtual address and the corresponding physical address is a constant value (normally, it is 0xc000,0000). For example, if the virtual address is 0xc123,0000, then its physical address is 0x0123,0000.

Pages in ZONE_NORMAL can be used either by the kernel or the user level processes, as long as they are not conflict with each other.

ZONE_HIGHMEM only exist when the physical memory is larger than 896MB.

like image 139
Jiang Avatar answered Sep 17 '26 18:09

Jiang