Take the 2-minute tour ×
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It's 100% free, no registration required.

Valid-invalid bit is used to indicate whether a page in a process’s page table is valid or not. Why is it needed?

Does that mean that each page table has a certain minimum size, i.e. it can accommodate minimum of n references to pages and if the number of pages being referenced by the process is less than n, then this bit is required to tell that only few entries are valid in the page table?

If the page table is built and populated dynamically, then the page table will only have as many entries as needed by process and there will no need for this bit, as all entries will be valid.

Other tags are page-table, valid-invalid bit

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Typically the page table is a tree of fixed size pages. So each node of the page table contains a fixed number of entries. Here's the picture of a 32-bit x86 multi-level page table from Wikipedia:

Wikipedia 32-bit x86 page table picture

Each page on x86 is $2^{12}=4096$ bytes. Each page table entry is 4 bytes = 32 bits, and contains a pointer to the beginning of another page. Each page table page contains exactly $2^{10}=1024$ page table entries. Since the pages are aligned we know that the bottom 12 bits of the pointer would all be zeros, so we use those bits for status bits (including the invalid bit). The invalid bit is necessary if you want to make the table sparse in any way.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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