views:

34

answers:

1

Does page table per Process or per System ?. Is KERNEL maintain entire single shared page table for all process ?

+1  A: 

Most OS's allocate the page table for each process and store the pointer of the table in the register and include it in the PCB

jknair
Then how Operating System handles Shared pages ( for shared libraries i.e.. Linux .So files and same .so can be loaded by two or more processes . )
siva
@siva: there seems to be a useful paper on this topic here: http://www.kernel.org/doc/ols/2003/ols2003-pages-315-320.pdf (for further reference, I found that using these keywords: `linux shared page table`)
Piskvor
@siva a complete guide about linux memory management http://tldp.org/LDP/tlk/mm/memory.html
jknair
@siva: Shared pages just mean that an entry in one page table maps to the same page frame as an entry in another page table.
caf
@caf, @Piskvof, @jknair, Does process maintain complete page table or part of page table ? . Assume 32-bit operating system and 4 KB page size, then complete page table size is 4 MB ( if 100 processes are there, then 4000 MB memory for page tables information).
siva
If every process maintain their own page table( I am assuming process use partial (or part of) Page table), then why we need Multi Level page tables ?
siva
@siva: Yes, every process has its own page table. However, the two-level structure (on IA32) means that there can be "holes" in the address space where the Page Directory has an empty entry, and the uppermost portion of the page table (corresponding to the kernel's mapped addresses) is also common to all processes. Together this means that the memory required for a process's page table is less than the theoretical maximum 4MB. You can see how much memory is globally being used for page tables in `/proc/meminfo`.
caf