Advanced OS L03b: Memory Virtualization
26 Questions
1 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What does the guest OS directly use to request device access from the Hypervisor?

  • A software interrupt
  • A Hypercall (correct)
  • An I/O request
  • A control signal
  • How does the Hypervisor manage the delivery of event notifications to the guest OS?

  • Through polling mechanisms
  • Through hardware interrupts
  • Through software interrupts (correct)
  • Through direct memory access
  • What method does Xen use to facilitate packet transmission for each guest OS?

  • Immediate delivery to I/O devices
  • Enqueuing packet descriptors in a transmission ring (correct)
  • Notifications to the Hypervisor
  • Direct copying of packets
  • Which scheduling method does Xen employ to allocate transmission services to guest OSs?

    <p>Round Robin scheduling</p> Signup and view all the answers

    What mechanism does Xen use to manage buffers and interrupts for guest OSs?

    <p>Asynchronous I/O rings</p> Signup and view all the answers

    What best describes the role of the Hypervisor regarding page tables for guest OSs?

    <p>It does not have information about the page tables maintained by guest OSs.</p> Signup and view all the answers

    In a fully virtualized environment, how does an OS update its page table?

    <p>By generating a trap that is caught by the Hypervisor.</p> Signup and view all the answers

    What defines the concept of a shadow page table (S-PT)?

    <p>It provides the mapping between physical page numbers and real machine page numbers.</p> Signup and view all the answers

    How do guest OSs handle non-contiguous physical memory in a paravirtualization setting?

    <p>They use Hypercalls to allocate and manage hardware page frames.</p> Signup and view all the answers

    Which statement is true regarding the memory regions perceived by a guest OS?

    <p>They are mapped contiguously even though they're stored non-contiguously.</p> Signup and view all the answers

    What happens when a process generates a virtual address in a fully virtualized setting?

    <p>The virtual address is translated directly by the Hypervisor to a machine address.</p> Signup and view all the answers

    What is the primary function of a Hypercall in a paravirtualized environment?

    <p>To provide guest OSs a method to request services from the Hypervisor.</p> Signup and view all the answers

    What is a significant characteristic of the virtual address space of a process?

    <p>It is not contiguous in physical memory despite being perceived that way.</p> Signup and view all the answers

    What does ballooning in virtualization refer to?

    <p>The Hypervisor requesting a guest OS to voluntarily release memory.</p> Signup and view all the answers

    Which memory allocation policy allows for quick adjustments to resource allocation based on usage?

    <p>Dynamic idle-adjusted shares approach</p> Signup and view all the answers

    What mechanism does the Hypervisor use to enable sharing of memory pages between guest OSs?

    <p>Copy-on-write pages</p> Signup and view all the answers

    In CPU virtualization, how does the Hypervisor allocate CPU time to each VM?

    <p>Proportional to the processes running within each VM</p> Signup and view all the answers

    What is the primary challenge when virtualizing devices in a guest OS?

    <p>Ensuring guest OS believes it owns the I/O devices</p> Signup and view all the answers

    What action is taken by the Hypervisor when a guest OS tries to execute a privileged instruction?

    <p>A trap is issued to the Hypervisor</p> Signup and view all the answers

    How does the Hypervisor maintain memory efficiency when different instances of the same application run on separate OSs?

    <p>By implementing copy-on-write and hash table mapping</p> Signup and view all the answers

    Which of the following is a disadvantage of sharing memory across virtual machines?

    <p>Potential security risks</p> Signup and view all the answers

    What does the term 'fair share' refer to in CPU allocation?

    <p>Giving each VM an equal share of CPU resources</p> Signup and view all the answers

    What does the Hypervisor utilize to search for page content matches among guest OSs?

    <p>Content hash table</p> Signup and view all the answers

    What happens during the inflation of a Balloon in a guest OS?

    <p>The guest OS pages out to disk to free up memory</p> Signup and view all the answers

    What occurs if a guest OS's privileged instruction fails silently in a fully virtualized environment?

    <p>The Hypervisor must rewrite the instructions in binary</p> Signup and view all the answers

    What is the function of the Balloon driver during memory pressure situations?

    <p>It requests the guest OS to free some memory for redistribution.</p> Signup and view all the answers

    Study Notes

    Memory Virtualization

    • Memory hierarchy is critical for virtualization, significantly impacting performance when multiple operating systems (OSs) operate on the same hardware (HW).
    • Each process has its own hardware address space, and a page table maps virtual to physical addresses; virtual address spaces may not be contiguous in physical memory.
    • Guest OSs maintain their own page tables without Hypervisor knowledge, leading to perceived contiguous memory that is actually non-contiguous in physical memory.

    Shadow Page Table

    • The guest OS maintains a page table mapping virtual page numbers (VPN) to physical page numbers (PPN).
    • The Hypervisor maintains a shadow page table (S-PT) mapping PPN to real machine page numbers (MPN), introducing an additional layer of indirection.
    • Address translation efficiency is improved in full virtualization by a trap generation on page table updates, allowing the Hypervisor to manage translations.

    Para Virtualization

    • In para virtualization, guest OSs recognize their memory isn't contiguous, shifting some responsibilities to them.
    • Guest OSs can issue “Hypercalls” to allocate page frames or switch page tables, allowing them to manage their page tables more actively.

    Dynamically Increasing Memory

    • Hypervisor can reallocate memory from one guest OS to another based on demand, which may cause unexpected behavior if the original OS depends on the reclaimed memory.

    Ballooning Technique

    • Ballooning involves a driver in the guest OS (the Balloon) that requests memory from the OS to give back to the Hypervisor when needed.
    • The Balloon inflates to request more memory, requiring the guest OS to page out to disk, allowing it to return memory to the Hypervisor when pressures are resolved.

    Sharing Memory across VMs

    • Sharing memory maximizes physical resource utilization but may compromise protection.
    • Pages can be made copy-on-write, allowing multiple guest OSs to reference the same physical page if content matches, managed by hashing for comparison.
    • The Hypervisor maintains a reference count to track shared pages without needing changes to guest OSs.

    Memory Allocation Policies

    • Various policies govern resource allocation:
      • Pure share-based: control over all resources, regardless of use.
      • Working-set based: resources allocated based on current need.
      • Dynamic idle-adjusted shares: reallocate unused resources while accommodating sudden demand increases.

    CPU & Device Virtualization

    • Virtualization of CPU and devices aims to create an illusion of ownership for guest OSs, requiring careful management by the Hypervisor.
    • CPU time is allocated to VMs based on different policies, and the Hypervisor rewards guest OSs for sharing CPU time.

    Handling Program Discontinuities

    • Discontinuities like external interrupts are managed by the Hypervisor, which translates privileged instructions and traps, potentially rewriting binary instructions for compatibility.

    Device Virtualization

    • Full virtualization creates the illusion of device ownership, while para virtualization allows guest OS to see the actual devices managed through Hypercalls.
    • Data transfer occurs via shared buffers to optimize pass-through without copying, balancing system demands across multiple VMs.

    Network and Disk I/O Virtualization

    • Xen implements asynchronous I/O rings shared with guest OSs for efficient request and response management.
    • Each guest OS maintains two separate I/O rings for transmitting and receiving data, utilizing pointers for efficient data transfer and implementing a round-robin scheduler for fairness.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Description

    This quiz focuses on the critical concept of memory virtualization within operating systems. It covers the importance of memory hierarchy, the handling of multiple operating systems on the same hardware, and the management of virtual and physical address mapping via page tables. Test your understanding of how these elements affect system performance.

    More Like This

    Computer Memory and Virtualization Quiz
    3 questions
    Memory Virtualization in Para virtualization
    10 questions
    Virtualization Memory Management Quiz
    43 questions
    Use Quizgecko on...
    Browser
    Browser