0
$\begingroup$

I am having a bit of a tough time grasping whether a computer system contains several page tables or just one page table.

Some sources speak of page tables in plural others in singular.

Intuitively it makes most sense to me that there is only one Page table containing all the physical addresses especially considered these addresses are to change over time. But I am not sure?

$\endgroup$
2
$\begingroup$

Each process has a different page table (since each process has a different address space). Each processor (or core if you want to be specific) can only have one active page table at a time, but the processor switches which table is used when it switches between processes.

I am also simplifying here because there are more tables used for IOMMU and hardware assisted virtualization.

$\endgroup$
  • $\begingroup$ So every time it switches between processes it clears out the entire Physical Memory(DRAM) and restores the specifics of the new page table to be used? $\endgroup$ – Nulle Jan 15 '18 at 15:42
  • $\begingroup$ I mean Page table 1 and Page table 2 can't possibly agree on what data is in physical memory at the moment. So that will have to be synchronized some how? $\endgroup$ – Nulle Jan 15 '18 at 15:46
  • $\begingroup$ Yes the page tables have to be synchronized because the physical space is shared between all processes. However the picture becomes even more complicated when you take into account thing like page-sharing (two processes can share physical memory, eithers to communicate or to save memory for libraries), memory-mapped files and swapping, where the OS can clear part of the RAM to make space for other things, and restore them on demand. $\endgroup$ – Amaury Pouly Jan 15 '18 at 16:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.