1
votes

In Linux OS, after enable page table, kernel will only map PTEs belong to kernel space once and never remap them again ? This action is opposite with PTEs in user space, which need to remap every time process switch happening ?

So, I want know the difference in management of PTEs in kernel and user space.

This question is a extended part from the question at: Page table in Linux kernel space during boot

Regards,

Thang Le

1
Linux self-map for page directory, Linux Virtual memory, Kernel Doc on MM, PIC for SO. The user space mapping may remain the same between processes for some entries; In particular shared libraries. If this is the case, VIVT caches can remain un-flushed for those regions.artless noise
Very thanks artless noise :)Thang Le
If you understand those links, each task has a different PGD, but PTE values maybe shared between processes, so large chunks of memory can be mapped the same for each process; only the top-level directory (CR3 on x86, per CL) is updated.artless noise

1 Answers

3
votes

Each process has its own page tables (although the parts that describe the kernel's address space are the same and are shared.)

On a process switch, the CPU is told the address of the new table (this is a single pointer which is written to the CR3 register on x86 CPUs).