CS 3733 Operating Systems
Lecture 13 [2/11/98]: Paging
Reading: SG Section 8.5.1
Paging
- Method of choice on most systems.
- Programs do not have to be loaded contiguously.
- Physical memory is divided into fixed-size blocks called frames.
- The logical memory of the programs is broken into fixed-size blocks
called pages.
- A logical address generated by the CPU is divided into a page number
(p) and a page offset (d).
- The page number is used as an index into the page table which contains
the frame number of the actual page in memory.
- The page offset gives the position within the page. If the page size
is 2n, the offset will be n bits long.
- When a process enters the system, the required number of pages is
allocated from the free list of pages.
- There is no external fragmentation.
- There is a small amount of internal fragmentation because frames are
allocated as units.
Paging Implementation
- The page table is usually kept in main memory, so the address translation
will take two memory references rather than just one. This effectively
doubles the memory access time.
- To make paging more efficient, part of the page table is kept
in a fast memory which is content or key addressable (translation lookaside buffer).
- The percentage of times that a page number is found in the associative
memory is called the hit ratio.
Example
If the associative memory access time is 50 ns, the main memory access time
is 250 ns and the hit ratio is 80%, calculate the effective memory access
time.
Revision Date: 2/11/98