1 Paging
Paging.java
Paging
Operating Systems
Lab Class 8 – Model Solutions
1
PageTable.java
TLB.java
5. The hit rate represents the percentage of time that the page number of interest is found in the TLB. An 80-percent hit rate, for example, means that we find the desired page number in the TLB 80 percent of the times. We get better performance if the hit rate is high (see the answer of the Extra question below).
6. Extra question: Case 1: when the page number is in the TLB, then a mapped-memory access takes 100 nanoseconds. Case 2: when the page number is not in the TLB, then we must first access memory for the page table and frame number (100 nanoseconds), and then access the desired byte in memory (100 nanoseconds), for a total of 200 nanoseconds. If the hit rate equals 0.8, then the effective access-time can be calculated as follows:
Effective access-time = 0.8 × 100 + 0.2 × 200 = 120 nanoseconds
In this example, we suffer a 20-percent slowdown in average memory-access time (from 100
to 120 nanoseconds). For a 99-percent hit ratio, which is much more realistic, we have Effective access-time = 0.99 × 100 + 0.01 × 200 = 101 nanoseconds