Placement Policies
Tom Kelliher, CS 240
Apr. 24, 2000
Homework questions?
Read 8.1--3.
Replacement policies: FIFO, Optimal, LRU.
- Implementing LRU. Second chance FIFO.
- Placement policies.
I/O.
- Maintain frame list as a ``stack.'' Implementation?
- Timestamp page table entry on each access. Implementation?
- Simulating the time stamp through recording and concatenation of
reference bits.
- Implementation: system daemon and timer interrupt.
- How often to record?
- How many bits?
AKA clock algorithm.
- Maintain process' frame list in a circular queue.
- The ``victim'' pointer.
- Victim page referenced: skip over, resetting reference bit.
- All pages referenced: pure FIFO.
- Enhancement: examine (reference bit, dirty bit):
- Four combinations --- priorities?
- Possibly several passes through the queue.
How are frames allocated to processes?
Issues:
- Minimum # of frames.
- Static vs. dynamic policies.
- Global vs. local.
- Thrashing.
- Optimizations.
- Interaction with I/O subsystem.
Must have sufficient frames in memory to execute an instruction.
Requirements:
- Instruction fetch: One or two frames.
- Operand fetch/store: One or two frames per operand.
- Massive indirection?
- Equal allocation.
- How realistic?
- Proportional allocation.
- Allocated space according to need.
- Process i needs
pages.
- Total need is
pages.
- Memory broken into m frames.
- Process i granted
frames.
- How realistic?
- Can be generalized to priority schemes.
Problems with static policies.
Suppose we re-adjusted proportional at intervals. Any improvement?
If a victim page must be selected, what is the candidate pool?
- Local: page frames of only the faulting process.
Process' fault rate not dependent on other process' behavior.
- Global: any page frame.
- Frame stealing.
- Interdependence of processes.
- Combined policy (prioritized).
- Effect of CPU utilization on degree of multiprogramming.
- Effect of degree of multiprogramming on frame distribution.
- Effect of frame distribution on page fault rate.
- Effect of page fault rate on CPU utilization.

CPU utilization low due to paging, so more processes started, making memory
situation worse, leading to more paging, lowering CPU utilization, so more
processes started, ...
Attempt to adapt to process behavior.
Action on memory over-commitment?
Idea:
- ``Locality.''
- Number of pages for each locality.
- This is the working set.

How do we determine the working set?
-
: working set window.
-
: working set interval.
- Every
time units, examine last
references and
determine number of unique references. That number is the working set
size.
- How do we implement this?
- System daemon and timer interrupt.
- Concatenate a few reference bits.
- What happens if the window straddles two localities, etc.? (Working
set aliasing)
- Ultimate goal: maintain each process' page fault rate within some
target region.
- Implementation: Track each process' fault rate
- If above target region: allocate more frames to process.
- If below target regions: de-allocate frames.
- Implementation?
Thomas P. Kelliher
Mon Apr 24 08:12:00 EDT 2000
Tom Kelliher