Operating System《操作系统》ch09-Virtual Memory-70.ppt
文本预览下载声明
Other Issues – Program Structure Program structure Int[128,128] data; Each row is stored in one page Program 1 for (j = 0; j 128; j++) for (i = 0; i 128; i++) data[i,j] = 0; 128 x 128 = 16,384 page faults Program 2 for (i = 0; i 128; i++) for (j = 0; j 128; j++) data[i,j] = 0; 128 page faults Other Issues – I/O interlock I/O Interlock – Pages must sometimes be locked into memory Consider I/O - Pages that are used for copying a file from a device must be locked from being selected for eviction by a page replacement algorithm Reason Why Frames Used For I/O Must Be In Memory Operating System Examples Windows XP Solaris Windows XP Uses demand paging with clustering. Clustering brings in pages surrounding the faulting page. Processes are assigned working set minimum and working set maximum Working set minimum is the minimum number of pages the process is guaranteed to have in memory A process may be assigned as many pages up to its working set maximum When the amount of free memory in the system falls below a threshold, automatic working set trimming is performed to restore the amount of free memory Working set trimming removes pages from processes that have pages in excess of their working set minimum Solaris Maintains a list of free pages to assign faulting processes Lotsfree – threshold parameter (amount of free memory) to begin paging Desfree – threshold parameter to increasing paging Minfree – threshold parameter to being swapping Paging is performed by pageout process Pageout scans pages using modified clock algorithm Scanrate is the rate at which pages are scanned. This ranges from slowscan to fastscan Pageout is called more frequently depending upon the amount of free memory available Solaris 2 Page Scanner End of Chapter 9 Optimal Algorithm Replace page that will not be used for longest period of time 4 frames example 1, 2, 3, 4, 1,
显示全部