Sunil Bojanapally
Sunil Bojanapally

Reputation: 12688

Is Kernel Virtual Memory pages are swappable

Like each user level process has its own Virtual memory space whose pages are swapped out/in, does Linux Kernel's Virtual memory pages are swappable ?

Upvotes: 2

Views: 922

Answers (2)

askb
askb

Reputation: 6784

Kernel space pages don't get page-{in,out} by design and are pinned to memory. The pages in the kernel can usually be trusted from a security point of view, while the user space pages should NOT be trusted.

For this reason you don't have to worry about accessing kernel buffers directly in your code. While its not the same the user space buffers, without worrying about handling page faults.

Kernel space pages cannot page-out by design, as you may want to consider what would your application do when the page containing the instructions for handling a page fault gets page-out!

Upvotes: 1

caf
caf

Reputation: 239371

No, kernel memory is not swapped on Linux.

Upvotes: 1

Related Questions