Allocation of Frames - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Allocation of Frames

Description:

... 6 pages to handle MVC instruction (move up to 256 characters from one location to another) ... The block of characters to move can straddle 2 pages. ... – PowerPoint PPT presentation

Number of Views:91
Avg rating:3.0/5.0
Slides: 11
Provided by: marily214
Category:

less

Transcript and Presenter's Notes

Title: Allocation of Frames


1
Allocation of Frames
  • Each process needs a minimum number of frames.
  • Must have enough frames to hold all the pages
    that any single instruction can reference
  • Example IBM 370 needs 6 pages to handle MVC
    instruction (move up to 256 characters from one
    location to another)
  • The instruction is 6 bytes, can straddle 2 pages.
  • The block of characters to move can straddle 2
    pages.
  • The area to be moved to can straddle 2 pages.

2
Allocation Algorithms
  • How to allocate m frames to n processes?
  • Equal allocation each process gets m/n frames
  • May waste frames
  • Proportional allocation allocate according to
    the size of each process

3
Global vs. Local Allocation
  • Local replacement each process selects from
    only its own set of allocated frames
  • Number of frames allocated to a process is
    constant over time
  • Global replacement a process can select a
    replacement frame from the set of all frames
  • Process may grow and shrink over time
  • Greater system throughput, more commonly used

4
Thrashing
  • Thrashing ? high page-fault rate
  • Cause of thrashing degree of multiprogramming is
    too high so that processes do not have enough
    frames ( actively used pages gt allocated
    frames)
  • Consequence of thrashing system throughput
    plunges
  • CPU utilization drops when thrashing sets in
  • OS increases the degree of multiprogramming to
    increase CPU utilization.
  • The new process causes more page faults, CPU
    utilization drops even further
  • Solution to thrashing decrease degree of
    multiprogramming by swapping out some processes

5
Thrashing
6
Prevention of Thrashing
  • Working-set strategy provide a process as many
    frames as it needs
  • Page-fault frequency strategy control the page
    fault rate

7
Working-Set Model
  • Locality model as a process executes, it moves
    from locality to locality
  • Locality a set of pages actively used together.
  • E.g., a C/C function defines a locality
  • Thrashing occurs when allocated frames lt size of
    the current locality
  • Working set the set of pages in the most recent
    ? page references
  • Pages in the working set are in active use
  • The working set is an approximation of the
    programs locality
  • ? too small not encompass entire locality.
  • ? too large encompass several localities.

8
Example of Working Set
?10
9
Working-Set Model
  • Number of frames needed by process Pi WSSi
    working-set size of Pi
  • D ? WSSi is total demand for frames
  • m total number of available frames
  • D gt m ? Thrashing
  • The policy
  • if D gt m, swap out a process
  • if D lt m, start a new process
  • The working-set strategy prevents thrashing while
    keeping the degree of multiprogramming as high as
    possible

10
Page-Fault Frequency Strategy
  • Establish acceptable page-fault rate.
  • If actual rate too low, remove a frame from
    process
  • If actual rate too high, allocate a frame to
    process if no free frame, swap out the process
Write a Comment
User Comments (0)
About PowerShow.com