lecture8 - CSCC69H Lecture 8 Dan Zingaro Fetch Policy When...

Info icon This preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
CSCC69H Lecture 8 Dan Zingaro June 28, 2010
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Fetch Policy I When is a page assigned to a page frame? I Could create all mappings when a process starts running, but this causes slow startup I Demand paging: create mapping for each page in response to a page fault I Prepaging: on a page fault, attempt to anticipate future page use by reading additional pages I Demand paging is particularly appropriate when process exhibits limited spatial locality, and when cost of page fault is low I Linux uses demand paging for zero-filled pages, and prepaging for files mapped into virtual memory
Image of page 2
Replacement Policy I Chooses a page to evict every time a page is fetched with all page frames in use I OS typically performs some eviction in advance of actual demand, to keep an inventory of free page frames I Can do this when the hardware is otherwise idle I May be able to write several dirty pages back to disk in one operation I In the time between being freed and reused, a page frame can retain a copy of the page it most recently held (so the page can be mapped-in again without going to disk)
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Replacement Policy... I Local replacement: keeps rate of page evictions and page fetches balanced individually for each process I If a process incurs many page faults, it relinquishes its own page frames, rather than pushing other processes’ pages out of their frames I Excessive demand for memory prevents allocation policy from allocating a reasonable number of frames to each process I Global replacement: keeps rate of page evictions and page fetches balanced only on a system-wide basis I If a process incurs many page faults, other processes’ pages may be evicted I Process cannot control its own page fault rate I Excessive demand for memory causes thrashing (constantly paging)
Image of page 4
Replacement: LRU I If OS knew all future virtual memory accesses, it could replace the page that has its next use furthest in the future I This is optimal replacement, but unimplementable I
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern