anonymous memory Pages modified in memory but not yet written back to the file

Anonymous memory pages modified in memory but not yet

This preview shows page 21 - 31 out of 78 pages.

anonymous memory Pages modified in memory but not yet written back to the file system Mobile systems Typically don’t support swapping Instead, demand page from file system and reclaim read-only pages (such as code)
Image of page 21
10.22 Silberschatz, Galvin and Gagne ©2018 Operating System Concepts 10 th Edition Copy-on-Write Copy-on-Write (COW) allows both parent and child processes to initially share the same pages in memory If either process modifies a shared page, only then is the page copied COW allows more efficient process creation as only modified pages are copied In general, free pages are allocated from a pool of zero-fill-on-demand pages Pool should always have free frames for fast demand page execution Don’t want to have to free a frame as well as other processing on page fault Why zero-out a page before allocating it? vfork() variation on fork() system call has parent suspend and child using copy-on-write address space of parent Designed to have child call exec() Very efficient
Image of page 22
10.23 Silberschatz, Galvin and Gagne ©2018 Operating System Concepts 10 th Edition Before Process 1 Modifies Page C
Image of page 23
10.24 Silberschatz, Galvin and Gagne ©2018 Operating System Concepts 10 th Edition After Process 1 Modifies Page C
Image of page 24
10.25 Silberschatz, Galvin and Gagne ©2018 Operating System Concepts 10 th Edition What Happens if There is no Free Frame? Used up by process pages Also in demand from the kernel, I/O buffers, etc How much to allocate to each? Page replacement find some page in memory, but not really in use, page it out Algorithm terminate? swap out? replace the page? Performance want an algorithm which will result in minimum number of page faults Same page may be brought into memory several times
Image of page 25
10.26 Silberschatz, Galvin and Gagne ©2018 Operating System Concepts 10 th Edition Page Replacement Prevent over-allocation of memory by modifying page- fault service routine to include page replacement Use modify ( dirty ) bit to reduce overhead of page transfers only modified pages are written to disk Page replacement completes separation between logical memory and physical memory large virtual memory can be provided on a smaller physical memory
Image of page 26
10.27 Silberschatz, Galvin and Gagne ©2018 Operating System Concepts 10 th Edition Need For Page Replacement
Image of page 27
10.28 Silberschatz, Galvin and Gagne ©2018 Operating System Concepts 10 th Edition Basic Page Replacement 1. Find the location of the desired page on disk 2. Find a free frame: - If there is a free frame, use it - If there is no free frame, use a page replacement algorithm to select a victim frame - Write victim frame to disk if dirty 3. Bring the desired page into the (newly) free frame; update the page and frame tables 4. Continue the process by restarting the instruction that caused the trap Note now potentially 2 page transfers for page fault increasing EAT
Image of page 28
10.29 Silberschatz, Galvin and Gagne ©2018 Operating System Concepts 10 th Edition Page Replacement
Image of page 29
10.30 Silberschatz, Galvin and Gagne ©2018 Operating System Concepts 10 th Edition Page and Frame Replacement Algorithms Frame-allocation algorithm determines
Image of page 30
Image of page 31

You've reached the end of your free preview.

Want to read all 78 pages?

  • Fall '14
  • Hamilton
  • Virtual memory, Gagne, Galvin

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture