3.3.2

Assume

PS = 213 means the offset is 13 bits. So with demand paging (or simple paging) P# is 32-13=19 bits so approx 1/2 million pages.

Each page is 1000 (really 1024) times the size of its PTE.

Hence PT is too small to worry about.

But!! Pages are virtual memory; not all of them are in memory.

So maybe PT significant compared to resident pages.

But even if only 1/10 are resident PT is still only 1/100 the size of the resident pages, so still too small to worry about.

A new trend is huge virtual address space (say 48 bits), which means a 248 B = 256 terabyte virtual address space. Again each PTE is about 1/1000 the size of a page. But that would still mean a 256 GB REAL memory page table.

Often with of the 256 terabytes of VA only about a few gigabytes are used so would be resident in frames. Hence the page table is much bigger that the program! This is unacceptable.

3.3.3

Since, with a huge virtual address the page table is much too big, and only a tiny fraction of it is used, we demand page the page table.

Pagesize = 213 B means offset is 13-bits. With 48-bit virtual addr, p# = 48-13=35 bits so there are 235 total PTEs.

Each pte = 8B = 23 B. So when we break the (2nd level) page table into pages (of size 213) there are 213 / 23 = 210 = 1024 ptes in each page of the second level page table. So we need a 10-bit quantity to specify the PTE given we know the page of the 2nd level table.

We call this 10-bit quantity p#2 it is used to index one of the 2nd level tables. But which one?

That is specified by p#1 it is 48-13-10=25 bits.

What happens when you reference a 48-bit virtual address?

   break into 25   10   13
              p#1  p#2  off

use p#1 to select one of the pages of the 2nd level table go to that table and use p#2 to reference the frame use offset to find the word/byte desired

allan gottlieb