Search code examples
memory-managementoperating-systempagingpage-tables

Why does the entry in a multi-level Page Table contain less bits than required to address main memory?


I've heard that a in-between page table contains the address of the other page table. But, I've seen it contains less number of bits than those actually required to address the main memory. But, these number of bits are less than the bits required to address physical address space. So, does that mean, some bits are padded with 0s ? So would that imply every page will start at some xxxx(some number of 0s) ?


Solution

  • Since pages have a minimum size and alignment the lower bits of a pointer to a page will always be zero and do not need to be stored.

    For example, with a page size of 4096 (0x1000) bytes, addresses to these pages will be always be a multiple of 4096 bytes (e.g. 0x1000, 0x2000, 0x728373000). Notice that the bottom 12 bits are always zero!