# Valid-invalid bit in a process page table

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

-

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.