Each segment broken up into pages address translation

This preview shows page 16 - 26 out of 93 pages.

each segment broken up into pages address Translation do segment translation translate that address using paging some internal fragmentation at the end of each segment Segmentation
Image of page 16

Subscribe to view the full document.

BYU CS 345 Virtual Memory 17 So… O.S. policy decisions support virtual memory? paging, segmentation, or both? Windows 3.1 – Uses both Windows 95/Linux Use paging for virtual memory Use segments only for privilege level (segment = address space) which memory management algorithm?
Image of page 17
BYU CS 345 Virtual Memory 18 Virtual Memory Paged memory combined with disk swapping Processes reside in main/secondary memory Demand Paging could also be termed as lazy swapping bring pages into memory only when accessed allows us to over allocate What about at context switch time? could swap out entire process restore page state as remembered anticipate which pages are needed Virtual Memory
Image of page 18

Subscribe to view the full document.

BYU CS 345 Virtual Memory 19 Decisions about Virtual Memory Fetch Policy When to bring a page in? When needed or in anticipation of need? Placement Where to put it? Unused page? Replacement What to unload to make room for a new page? Resident Set Management How many process pages to keep in memory? Fixed or variable? Reassign pages to other processes? Cleaning Policy When is a page written to disk? Load Control
Image of page 19
BYU CS 345 Virtual Memory 20 Page Replacement Frame replacement – two page transfers select a frame (victim) write the victim frame to disk read in new frame from disk update page tables restart process Reduce overhead using dirty bit dirty bit is set whenever a page is modified if dirty, write page, else just throw it out
Image of page 20

Subscribe to view the full document.

BYU CS 345 Virtual Memory 21 Page 0 Page 1 Page 2 Page 3 0 1 2 3 4 5 6 7 Page fault is generated when an invalid page is accessed 0:m1 1:v0 2:m3 3:v1 Page 2 Page 0 Page 1 Page 3 Page Fault
Image of page 21
BYU CS 345 Virtual Memory 22 Memory References Check internal table valid or invalid frame (page fault) new or swapped page Find a free frame get from frame pool unload a frame If page defined, read in from disk Update the page table Restart the instruction process restarts from exact location state unchanged (as if not interrupted)
Image of page 22

Subscribe to view the full document.

BYU CS 345 Virtual Memory 23 Paging Implementation Extreme case start a process with no pages in memory pure demand paging What about overhead of paging? locality thrashing Hardware support page table secondary memory
Image of page 23
BYU CS 345 Virtual Memory 24 Paging Implementation (continued…) Must be able to restart a process at any time instruction fetch operand fetch operand store (any memory reference) Consider simple instruction (VLIW or CISC) Add C,A,B (C = A + B) All operands on different pages Instruction not in memory 4 possible page faults )-: slooooow :-(
Image of page 24

Subscribe to view the full document.

BYU CS 345 Virtual Memory 25 Paging Performance Paging Time… Disk latency 8 milliseconds Disk seek 15 milliseconds
Image of page 25
Image of page 26
You've reached the end of this preview.
  • Winter '12
  • EricMercer
  • Virtual memory, main memory, page faults, BYU CS

{[ 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