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 ?
Asked
Active
Viewed 875 times
2
-
possible duplicate of [Do Kernel pages get swapped out?](http://stackoverflow.com/questions/4535379/do-kernel-pages-get-swapped-out) – nos Jan 14 '15 at 09:47
-
FWIW, Some systems, other than Linux, have both pageable and non-pageable system memory. – user3344003 Jan 16 '15 at 19:04
2 Answers
1
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!

askb
- 6,501
- 30
- 43
-
Hi askb, kernel can also use virtual memory right? If so, how come swapping never happens on kernel? – Michael Jan 16 '19 at 09:10