THRASHING


THRASHING:

--------------for two marks----------------------------------------------------

1.DEFINITION:

If the process does not have number of frames it needs to support pages in active use, it will quickly page-fault. The high paging activity is called thrashing.
----------------------for 5 marks or 10 marks---------------------------------
  • Thrashing occurs when a system spends more time processing page faults than executing transactions.
  • As the page fault rate increases, more transactions need processing from the paging device. The queue at the paging device increases, resulting in increased service time for a page fault .
  • While the transactions in the system are waiting for the paging device, CPU utilization, system throughput and system response time decrease, resulting in below optimal performance of a system .
  • Thrashing becomes a greater threat as the degree of Multiprogramming of the system increases.
  • Strategy work set model and page fault frequency are used to avoid thrashing
2.CAUSE OF THRASHING:

It result in severe performance problems.

1) If CPU utilization is too low then we increase the degree of multiprogramming by introducing a new process to the system. A global page replacement algorithm is used. The CPU scheduler sees the decreasing CPU utilization and increases the degree of multiprogramming.

2) CPU utilization is plotted against the degree of multiprogramming.

3) As the degree of multiprogramming increases, CPU utilization also increases.

4) If the degree of multiprogramming is increased further, thrashing sets in and CPU utilization drops sharply.

5) So, at this point, to increase CPU utilization and to stop thrashing, we must decrease the degree of multiprogramming.

3.STRATEGY FOR PREVENTING THRASHING:

We must provide a process with as many frames as it needs. Several techniques are used.

The Working of Set Model (Strategy) It starts by looking at how many frames a process is actually using. This defines the locality model.

Locality Model It states that as a process executes, it moves from locality to locality.

A locality is a set of pages that are actively used together.

A program is generally composed of several different localities which overlap.

4.WORKSET MODEL:
  • based on the assumption of locality
  • Δ defines the working-set window: some # of memory references
  • examine the most recent Δ page references
  • the set of pages in the most recent Δ is the working set or an approximation of the program's locality.
  • the accuracy of the working set depends on the selection of Δ
  • if Δ is too small, it will not encompass the entire locality
  • if Δ is too large, it may overlap several localities
  • if Δ is ∞, the working set is the set of all pages touched during process execution
  • WSSi is working set size for process pi
  • D = Σ WSSi, where D is the total Demand from frames
  • if D > m, then thrashing will occur, because some processes will not have enough frames

    Using the working-set strategy is simple:

  • the OS monitors the working set of each process
  • and allocates to that working set enough frames to provide it with its working-set size
  • if there are enough extra frames, a new process can be initiated
  • if the sum of the working set sizes increases, exceeding the total number of available frames, the OS selects a process to suspend
  • the working set strategy prevents thrashing while keeping the degree of multiprogramming as high as possible and optimizes CPU utilization.

5.PAGE FAULT FREQUENCY:

working set model is successful but keeping track of the working set can become complex
  • using page-fault frequency (PFF) is a more direct approach to prevent thrashing
  • if PFF is too high, we know the process needs more frames
  • if PFF is too low, then we know the process has too many frames

No comments:

Post a Comment