HPCA Assignment

)Hierarchical Page Table(
: Submitted by Indranil Nandy MTech,2006 Roll no. : 06CS6010

?How does Hierarchical Page Table help
The modern computers offer a large virtual address space to the processes, resulting millions of pages for each process causing millions of page table entries for each process. This causes the problem of storing huge page tables in memory all the time. .Hierarchical Page Table solves this The main secret behind hierarchical page table is that in a running process often the top-most parts and bottom-most parts of virtual memory are used – the top is used for text and data segment and the bottom is used as stack segment, with free memory in .between

Relationship between pages addressed by virtual address and the frames in physical memory within a simple address space scheme The multilevel page table may keep a few of the smaller page tables to cover just the .top and bottom parts of memory and create new ones when only strictly necessary For example, for a 32-bit virtual address we can have three partitions – 10-bit field for level1, 10-bit for level2 and 12-bit for offset. So, the top level (level1) page table has 1024 entries each pointing to a 2nd level page table containing 4M virtual address space; each of 1024 entries in the 2nd level page table contains the page frame number of a 4KB page. Entry 0 of the top level page table points to text segment, entry 1 .points to the data segment and entry 1023 points to the stack segment Then suppose we have a process of 12MB containing text,(0M to 4M) data(4M to 8M) and stack(bottom 4M) segments. Although the address space contains over a million pages only four page tables are actually needed to be in the main memory – the top level table, the 2nd level tables for 0 to 4M for text, 4M to 8M for data and the .bottom 4M for stack

If the secret behind the hierarchical page table was not used, then for each TLB miss we would have to go first to the main memory to find the page frame number and as total number of pages is much higher, memory could not contain all the pages and so the frequency of page fault (to know only the page frame number, not even for accessing the page) would be much higher though that can be avoided as most of the references would be to the text, data and stack segment corresponding to which the page frame numbers could be stored in the main memory by storing only 4 blocks of .page table Thus hierarchical page table actually reduces the page fault to find the page frame .number of the virtually addressed page : References http://en.wikipedia.org/wiki/Page_table#Multilevel_page_table http://www.research.ibm.com/K42/white-papers/MemoryMgmt.pdf