Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do Kernel pages get swapped out?

Pertaining to the Linux kernel, do "Kernel" pages ever get swapped out ? Also, do User space pages ever get to reside in ZONE_NORMAL ?

like image 321
TheLoneJoker Avatar asked Dec 26 '10 20:12

TheLoneJoker


People also ask

Why is kernel memory not swappable?

By "kernel memory is not page-able" folks mean that the memory owned by the kernel is physical RAM and is not capable of paging to disk i.e. swap. There is no fundamental reason that kernel memory must not be page-able, but many kernels, including Linux, don't page kernel memory as the complexity outweighs the benefit.

What is swapped out when page faults occur?

The process of writing pages out to disk to free memory is called swapping-out. If later a page fault is raised because the page is on disk, in the swap area rather than in memory, then the kernel will read back in the page from the disk and satisfy the page fault.

Does Linux use swapping?

Swap space in Linux is used when the amount of physical memory (RAM) is full. If the system needs more memory resources and the RAM is full, inactive pages in memory are moved to the swap space. While swap space can help machines with a small amount of RAM, it should not be considered a replacement for more RAM.

Can kernel run out of memory?

1: Setting the variable to 1 means that kernel will always overcommit. This is a risky setting because the kernel will always overcommit the memory to processes. This can lead to kernel running out of memory because there is a good chance that processes can end up using the memory committed by the kernel.


2 Answers

No, kernel memory is unswappable.

like image 172
user502515 Avatar answered Sep 21 '22 22:09

user502515


  1. Kernel pages are not swappable. But it can be freed.

  2. UserSpace Pages can reside in ZONE_NORMAL. Linux System Can be configured either to use HIGHMEM or not. If ZONE_HIGHMEM is configured , then the userspace processes will get its memory from the HIGHMEM else userspace processes will get memory from ZONE_NORMAL.

like image 44
Prabagaran Avatar answered Sep 18 '22 22:09

Prabagaran