1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes...
-
date post
21-Dec-2015 -
Category
Documents
-
view
215 -
download
1
Transcript of 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes...
![Page 1: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/1.jpg)
1
Chapter 8Virtual Memory
• Real memory– Main memory, the actual RAM, where a process
executes
• Virtual memory is a storage allocation scheme in which secondary memory can be addressed as though it were part of main memory– Size is limited by the amount of secondary memory
available
• Virtual address is the address assigned to a location in virtual memory
![Page 2: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/2.jpg)
2
Keys to Virtual Memory
1) Memory references are logical addresses that are dynamically translated into physical addresses at run time– A process may be swapped in and out of main
memory, occupying different regions at different times during execution
2) A process may be broken up into pieces (pages or segments) that do not need to be located contiguously in main memory
![Page 3: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/3.jpg)
3
Breakthrough in Memory Management
• If both of those two characteristics are present, – then it is not necessary that all of the pages or
all of the segments of a process be in main memory during execution.
• If the next instruction and the next data location are in memory then execution can proceed
![Page 4: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/4.jpg)
4
Execution of a Process
• OS brings into main memory a few pieces of the program– Resident set: portion of process that is in
main memory
• Execution proceeds smoothly as long as all memory references are to locations that are in the resident set
• An interrupt (memory access fault) is generated when an address is needed that is not in main memory
![Page 5: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/5.jpg)
5
Execution of a Process
• OS places the process in a blocking state
• Piece of process that contains the logical address is brought into main memory– OS issues a disk I/O Read request– Another process is dispatched to run while the
disk I/O takes place– An interrupt is issued when disk I/O complete
which causes OS to place the affected process in the Ready state
![Page 6: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/6.jpg)
6
Implications of this new strategy
• More efficient processor utilization – More processes may be maintained in main
memory because only load in some of the pieces of each process
– More likely a process will be in the Ready state at any particular time
• A process may be larger than main memory– This restriction in programming is lifted– OS automatically loads pieces of a process into
main memory as required
![Page 7: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/7.jpg)
7
Thrashing
• A condition in which the system spends most of its time swapping pieces rather than executing instructions.• It happens when OS frequently throws out a
piece just before it is used
• To avoid this, OS tries to guess, based on recent history, which pieces are least likely to be used in the near future.
![Page 8: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/8.jpg)
8
Principle of Locality
• Program and data references within a process tend to cluster only a few pieces of a process will be needed over a short period of time
• It is possible to make intelligent guesses about which pieces will be needed in the future, which avoids thrashing
• This suggests that virtual memory may work efficiently
![Page 9: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/9.jpg)
9
Performance of Processes in VM Environment
• During the lifetime of the process, references are confined to a subset of pages.
![Page 10: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/10.jpg)
10
Support Needed for Virtual Memory
• Hardware must support paging and
segmentation
• OS must be able to manage the
movement of pages and/or segments
between secondary memory and main
memory
![Page 11: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/11.jpg)
11
Paging
• Each process has its own page table
• Each page table entry contains the frame number of the corresponding page in main memory
• Two extra bits are needed to indicate:– P(resent): whether the page is in main
memory or not– M(odified): whether the contents of the page
has been altered since it was last loaded
![Page 12: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/12.jpg)
12
Paging Table
• It is not necessary to write an unmodified page out when it comes to time to replace the page in the frame that it currently occupies
![Page 13: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/13.jpg)
13
Address Translation
The page no. is used to index the page table and look up the frame no.
The frame no. is combined with the offset to produce the real address
![Page 14: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/14.jpg)
14
Page Tables
• Page tables can be very large– Consider a system that supports 231=2Gbytes
virtual memory with 29=512-byte pages. The number of entries in a page table can be as many as 222
• Most virtual memory schemes store page tables in virtual memory
• Page tables are subject to paging
![Page 15: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/15.jpg)
15
Two-Level Hierarchical Page Table
is composed of 220 4-kbyte (212) pages
Composed of 220 4-byte page table entries, occupying 210 pages
Composed of 210 4-byte page table entries
![Page 16: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/16.jpg)
16
Address Translation for Hierarchical page table
The root page always remains in main memory
![Page 17: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/17.jpg)
17
Translation LookasideBuffer
• Each virtual memory reference can cause two physical memory accesses– One to fetch the page table– One to fetch the data
• To overcome this problem a high-speed cache is set up for page table entries– Called a Translation Lookaside Buffer (TLB)– Contains page table entries that have been
most recently used
![Page 18: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/18.jpg)
18
Translation Lookaside Buffer
![Page 19: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/19.jpg)
19
TLB operation
TLB hit
TLB miss
By the principle of locality, most virtual memory references will be to locations in recently used pages. Therefore, most references will involve page table entries in the cache.
![Page 20: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/20.jpg)
20
Page Size• Page size is an important hardware
design decision• Smaller page size
less amount of internal fragmentation more pages required per process
larger page tablessome portion of page tables must be in
virtual memorydouble page fault (first to bring in the
needed portion of the page table and second to bring in the process page)
![Page 21: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/21.jpg)
21
Page Size
• Large page size is better because
– Secondary memory is designed to efficiently
transfer large blocks of data
![Page 22: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/22.jpg)
22
Further complications to Page Size
• Small page size
a large number of pages will be available in main memory for a process
as time goes on during execution, the pages in memory will all contain portions of the process near recent references
low page fault rate
![Page 23: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/23.jpg)
23
• Increased page size
causes pages to contain locations further from any recent reference
the effect of the principle of locality is weakened
page fault rate rises
Further complications to Page Size
![Page 24: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/24.jpg)
24
Example Page Size
•The design issue of page size is related to the size of physical main memory and program size.
•At the same time that main memory is getting larger, the address space used by applications is also growing.
architectures that support multiple page sizes
![Page 25: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/25.jpg)
25
Segmentation
• Segmentation allows the programmer to view memory as consisting of multiple address spaces or segments.
• Segments may be of unequal size.• Each process has its own segment table.
![Page 26: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/26.jpg)
26
Segment Table
• A bit is needed to determine if segment is already in main memory, if present,– Segment base is the starting address of the
corresponding segment in main memory– Length is the length of the segment
• Another bit is needed to determine if the segment has been modified since it was loaded in main memory
![Page 27: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/27.jpg)
27
Address Translation in Segmentation
The segment no. is used to index into the segment table and look up the segment base
The segment base is added to the offset to produce the real address
![Page 28: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/28.jpg)
28
Combined Paging and Segmentation
• A user’s address space is broken up into a number of segments and each segment is broken into fixed-size pages
• From the programmer’s point of view, a logical address still consists of a segment number and a segment offset.
• From the system’s point of view, the segment offset is viewed as a page number and page offset
![Page 29: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/29.jpg)
29
Combined Paging and Segmentation
• The base now refers to a page table.
![Page 30: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/30.jpg)
30
Address Translation
The segment no. is used to index into the segment table to find the page table for that segment
The page no. is used to index the page table and look up the frame no.
The frame no. is combined with the offset to produce the real address
![Page 31: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/31.jpg)
31
Key Design Elements
• Fetch policy
• Placement policy
• Replacement policy
• Cleaning policy
• Key aim: Minimise page faults– No definitive best policy
![Page 32: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/32.jpg)
32
Fetch Policy
• Determines when a page should be brought into memory
• Demand paging– only brings pages into main memory when a reference
is made to a location on the page– many page faults when process first started
• Prepaging – pages other than the one demanded by a page fault
are brought in. – more efficient to bring in pages that reside
contiguously on the disk
![Page 33: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/33.jpg)
33
Placement Policy
• Determines where in real memory a
process piece is to reside
• Important in a segmentation system such
as best-fit, first-fit, and etc are possible
alternatives
• Irrelevant for pure paging or combined
paging with segmentation
![Page 34: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/34.jpg)
34
Replacement Policy
• When all of the frames in main memory are occupied and it is necessary to bring in a new page, the replacement policy determines which page currently in memory is to be replaced.
• But, which page is replaced?
![Page 35: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/35.jpg)
35
Replacement Policy
• Page removed should be the page least likely to be referenced in the near future – How is that determined?
• Most policies predict the future behavior on the basis of past behavior
• Tradeoff: the more sophisticated the replacement policy, the greater the overhead to implement it
![Page 36: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/36.jpg)
36
Replacement Policy Frame Locking
• Frame Locking– If frame is locked, it may not be replaced– Kernel of the operating system– Key control structures– I/O buffers– Associate a lock bit with each frame which
may be kept in a frame table as well as being included in the current page table
![Page 37: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/37.jpg)
37
Optimal policy
• Selects for replacement that page for which the time to the next reference is the longest
• Results in the fewest number of page faults but it is impossible to have perfect knowledge of future events
• Serves as a standard to judge real-world algorithms
![Page 38: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/38.jpg)
38
Optimal Policy Example
• The optimal policy produces three page faults after the frame allocation has been filled.
![Page 39: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/39.jpg)
39
Least Recently Used (LRU)
• Replaces the page that has not been referenced for the longest time
• By the principle of locality, this should be the page least likely to be referenced in the near future
• Difficult to implement– One approach is to tag each page with the
time of last reference. – This requires a great deal of overhead.
![Page 40: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/40.jpg)
40
LRUExample
• The LRU policy does nearly as well as the optimal policy.– In this example, there are four page faults
![Page 41: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/41.jpg)
41
First-in, first-out (FIFO)
• Treats page frames allocated to a process as a circular buffer
• Pages are removed in round-robin style– Simplest replacement policy to implement
• Page that has been in memory the longest is replaced– But, these pages may be needed again very
soon if it hasn’t truly fallen out of use
![Page 42: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/42.jpg)
42
FIFOExample
• The FIFO policy results in six page faults.– Note that LRU recognizes that pages 2 and 5
are referenced more frequently than other pages, whereas FIFO does not.
![Page 43: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/43.jpg)
43
Clock Policy
• Uses an additional bit called a “use bit”• When a page is first loaded in memory or
referenced, the use bit is set to 1• When it is time to replace a page, the OS scans
the set flipping all 1’s to 0• The first frame encountered with the use bit
already set to 0 is replaced.• Similar to FIFO, except that, any frame with a
use bit of 1 is passed over by the algorithm.
![Page 44: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/44.jpg)
44
Clock PolicyExample
incoming page 727
![Page 45: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/45.jpg)
45
Clock PolicyExample
• Note that the clock policy is adept at protecting frames 2 and 5 from replacement.
An asterisk indicates that the corresponding use bit is equal to 1.The arrow indicates the current position of the pointer.
![Page 46: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/46.jpg)
46
Replacement PolicyComparison
Two conflicting constraints:1. We would like to have a small page fault rate in order to run efficiently, 2. We would like to keep asmall frame allocation.
![Page 47: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/47.jpg)
47
Page Buffering
• Replacing a modified page is more costly than unmodified page because the former must be written to secondary memory
• Solution: page buffering + FIFO– Replaced page remains in memory (only the
entry in the page table for this page is removed) and is added to the tail of one of two lists
• Free page list if page has not been modified• Modified page list if it has
![Page 48: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/48.jpg)
48
Page Buffering
• The free page list is a list of page frames available for reading in pages.
• When a page is to be read in, the page frame at the head of the list is used, destroying the page that was there.
• The important aspect is that the page to be replaced remains in memory.– If the process references that page, it is returned to
the resident set of that process at little cost. – In effect, the free and modified page lists act as a
cache of pages.
![Page 49: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/49.jpg)
49
Cleaning Policy
• A cleaning policy is concerned with determining when a modified page should be written out to secondary memory.
• Demand cleaning– A page is written out only when it has been
selected for replacement– Minimizes page writes– A process that suffers a page fault may have
to wait for two page transfers before it can be unblocked decrease processor utilization
![Page 50: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/50.jpg)
50
Cleaning Policy
• Precleaning– Pages are written out in batches (before they
are needed)
– Reduces the number of I/O operations
– Pages written out may have been modified again before they are replaced waste of I/O operations with unnecessary cleaning operations
![Page 51: 1 Chapter 8 Virtual Memory Real memory –Main memory, the actual RAM, where a process executes Virtual memory is a storage allocation scheme in which secondary.](https://reader037.fdocuments.in/reader037/viewer/2022110207/56649d6b5503460f94a49d77/html5/thumbnails/51.jpg)
51
Cleaning Policy
• Better approach: incorporates page buffering• Cleans only pages that are replaceable
– decouples the cleaning and replacement operations
• Pages in the modified list are periodically written out in batches and moved to the free list– significantly reduces the number of I/O operations
and therefore the amount of disk access time
• Pages in the free list are either reclaimed if referenced again or lost when its frame is assigned to another page