1 / 13

Case Study: Virtual Memory in UNIX

Case Study: Virtual Memory in UNIX. Reference – Maurice J.Bach , The Design of the UNIX Operating System Terminology - Physical Memory (Main Memory) Secondary Memory (H.Disk) Virtual Memory Swap File. Region. Virtual space of a process Stack , Data , Text – are regions of every process.

Download Presentation

Case Study: Virtual Memory in UNIX

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Case Study: Virtual Memory in UNIX • Reference – Maurice J.Bach , The Design of the UNIX Operating System Terminology - • Physical Memory (Main Memory) • Secondary Memory (H.Disk) • Virtual Memory • Swap File

  2. Region • Virtual space of a process • Stack , Data , Text – are regions of every process

  3. Per Process Region Table - pregion • For every region – • Starting virtual address • Number of pages in this region • Access mode • Pointer to the Page Table (page table for every region)

  4. Page Table

  5. Page Table Entry • Demand paging fields • Valid • Reference • Modify • Copy on Write (COW) • Age • Modify , Reference -handle by the hardware

  6. More tables • Page frame data table (pfdata) • One table • Mapping all physical frames to disk • Tells how many process are using this frame • List of free frames • Hash from disk address to frame • Swap-use • For every swap device • Tells how many frames points to the same disk address

  7. Using the Copy on Write in fork()

  8. Kernel process for Virtual Memory • Pager • Every time the OS needs to swap a virtual page to the physical memory • Get the first frame from the list of free pages , if the Modify bit is set write it’s data to the disk. • Load the page to this frame • Set the valid bit • Resume the waiting process • Page Stealer (page daemon) • Every period of time • Enter old frames to the list of free pages • Update the age of every valid frame if the reference bit is 0 • Put 0 in the the reference bit • => LRU with second chance

  9. Page Fault Page Frames Page Table Entries Disk Block • Some of the possibilities : • The page is in the swap file • The page is in the list of free pages After Swapping Page into Memory

  10. Event - Page Daemon done Event – Proc A reads from Pg2 Event – Proc A call to fork()

  11. Event – Proc A reads from Pg1 Event – Proc B write to Pg6 Event – Page Daemon done

  12. Event – Proc B reads from Pg2 & Pg5 Event – Page Daemon done Event – Proc A ends

More Related