Does every process have its own page table or does it simply add it's page entries into one big page table?
Yes every process has its own pagetables. They might be shared with the parent process(copy on write) or with other processes(shared memory).
There is only one kernel page table (including page directory) but each process would need a separate one to be able to address virtual space.
If a process calls clone() to create a new process, but requests that the two processes share the same page table, then you effectively have a thread as both processes see the same underlying physical memory. You can also see now how copy on write is done.
And yes, to your question, entries from #768 to #1023 in pgd are the same and are duplicated by each process. But this is only a very small part. The second level page table for kernel are still shared across all processes.
Yes every process has its own pagetables. They might be shared with the parent process(copy on write) or with other processes(shared memory). But in general every process has its own.
Yes, unless you use an inverted page table see this answer. Because an inverted page table is global, each entry must also contain which process it belongs to.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With