Linux – Where is page table stored in Linux

linuxlinux-kernelvirtual-memory

I want know where Linux stores page tables. Is it in kernel virtual memory?


It seems like this has to do with virtual memory system. but I'm new to it, so if I'm in the wrong direction please let me know. And in order to answer the question myself I read some lines from a book says:

(23.2 page 8)

… Linux virtual address space consists of user portion and kernel portion…

… the kernel portion is the same across processes.

So the address space provided by kernel is in a sense a space for processes to share something? So if the page tables are put in kernel virtual memory would this mean processes can share their page tables?


The book I read: http://www.ostep.org

Best Answer

Yes, the page tables are stored in the kernel address space. Each process has its own page table structure, which is set up so that the kernel portion of the address space is shared between processes. The kernel address space is not accessible from user space, however. The user space code communicates with the kernel in a controlled manner using system calls. After a successful system call the processor enters a privileged state in which the kernel address space is available.

Related Question