CS 3733 Operating Systems
Lecture 17 [2/20/98]: Page Replacement in Real Systems
Read SG 19.7
- Working set of a process:
The logical pages that a process needs to execute. All page replacement
policies try to keep the working set of the processes in real memory.
- Global versus local allocation
- Global allocation
- All of the frames are candidates for replacement.
- A process real memory allocation can grow at the expense of others.
- Good memory utilization.
- Local allocation
- The replaced page belongs to the faulting process.
- A process works within its allocation and can't affect others.
- In real schemes local replacement is used with medium-term
memory allocation to give a process experiencing a lot of page faults
more frames to work with. This variation is called
dynamic local allocation.
- VAX VMS Memory Management:
- Keep a system list of free frames in a FIFO queue.
- Keep a significant number of frames in the free list.
- When a process must give up a page for replacement, the page is
- put at the end of the system FIFO free list and the actual replaced page
comes from the front of the list.
- If a process references a page which it released to the free list,
- it can get it back. Hence, the FIFO queue acts like a cache for
the free pages.
- Periodically the system uses the page fault rate of a process to
increase or decrease the number of pages allocated to a particular
process (within authorized limits).
- UNIX BSD 4.2
- Old versions just had swapping
- BSD 4.3 uses demand paging
- A page marked invalid by the page replacement process, but still
in table can be gotten back. (See below)
- Replacement algorithm is Global Clock Least Recently Used.
- Non-kernel memory is swept in circular fashion by a software clock
hand.
- When clock hand reaches a given frame, page table entry is located:
- If already free, nothing is done.
- If used by an I/O operation in progress, nothing is done.
- If bit marked invalid in page table entry, page is freed.
- If bit marked valid in page table entry, it is marked invalid, but
reclaimable.
- The LRU clock is the pagedaemon (process 2). It spends most of
its time sleeping, but is awakened if the number of free frames
falls below the threshold, lotsfree.
- If load is too great, swapper swaps things out.
- Windows NT
- Uses demand paging with clustering.
When a thread gets a fault, the page manager loads the page plus a
small number in the vicinity.
- NT uses a dynamic local page allocation policy.
- NT uses a FIFO page replacement policy. However, it caches
the replaced pages in memory so that if they are referred to
for a while after they are replaced, they can be gotten back.
Skill: Understand how paging might actually be implemented.
Revision Date: 2/18/98