vmware mmu

18
VMWare MMU Ranjit Kolkar

Upload: fleta

Post on 24-Feb-2016

72 views

Category:

Documents


0 download

DESCRIPTION

VMWare MMU. Ranjit Kolkar. Designed for efficient use of resources. ESX uses high-level resource management policies to compute a target memory allocation for each virtual machine (VM) based on the current system load and parameter settings for the virtual machine - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: VMWare  MMU

VMWare MMU

Ranjit Kolkar

Page 2: VMWare  MMU

• Designed for efficient use of resources.• ESX uses high-level resource management

policies to compute a target memory allocation for each virtual machine (VM) based on the current system load and parameter settings for the virtual machine

• Dynamic Adjustment of Memory.

Page 3: VMWare  MMU

Classification

Page 4: VMWare  MMU

• Paging• Usage• Advantage to Programmers.

• The hypervisor adds an extra level of address translation that maps the guest physical address to the host physical address.

• Hypervisor provides the mapping from guest to host physical memory

Page 5: VMWare  MMU

Memory

• The hypervisor adds an extra level of address translation that maps the guest physical address to the host physical address.•Hypervisor provides the mapping from guest to host physical memory

Page 6: VMWare  MMU

• Application: An application starts and uses the interfaces provided by the operating system to explicitly allocate or deallocate the virtual memory during the execution.

• Guest Operating System: The operating system establishes the definitions of “allocated” or “free” physical memory. They maintain allocated and deallocated list.

• Hypervisor: The hypervisor also creates the definitions of “allocated” and “free” host memory in its own data structures. The hypervisor intercepts the virtual machine’s memory accesses and allocates host physical memory for the virtual machine on its first access to the memory.

Page 7: VMWare  MMU

• first memory access from the virtual machine to a host physical memory will cause a page fault that can be easily captured by the hypervisor.

• However, it is difficult for the hypervisor to know when to free host physical memory upon virtual machine memory deallocation because the guest operating system free list is generally not publicly accessible.

Page 8: VMWare  MMU

• VM’s host memory usage <= VM’s guest memory size + VM’s overhead memory

• memory overcommitment: host memory is overcommitted when the total amount of guest physical memory of the running virtual machines is larger than the amount of actual host memory.

Page 9: VMWare  MMU

• ESX supports Overcommitment.– Higher Memory Utilization.– Higher Consolidation Ration.

Page 10: VMWare  MMU

Memory reclamation techniques

• Transparent page sharing• Ballooning• Host swapping.

Page 11: VMWare  MMU

Transparent page sharing

Page 12: VMWare  MMU

Transparent page sharing

• hash value is generated based on the candidate guest physical page’s content

• If the hash value of the candidate guest physical page matches an existing entry, a full comparison of the page contents is performed to exclude a false match.

• remapping is invisible to the virtual machine and inaccessible to the guest operating sytem

Page 13: VMWare  MMU

– standard copy-on-write(CoW): handle writes to the shared host physical pages.

Page 14: VMWare  MMU

Balloninng•Ballooning makes the guest operating system aware of the low memory status of the host.•Balloon driver is loaded into the guest operating system

Page 15: VMWare  MMU

• Releases the hypervisor pressure but induces the guess pressure.

• The genius of ballooning is that it allows the guest operating system to intelligently make the hard decision about which pages to be paged out without the hypervisor’s involvement

• guest operating system must install and enable the balloon driver

Page 16: VMWare  MMU

Hypervisor swapping

• Same as paging in general perpose– Difficulties• Hypervisor cannot identify those guest kernel pages,

So it may swap but it is critical to ensure guest’s performance.• Double swapping• Performance penalty.

Page 17: VMWare  MMU

• When to reclaim host memory?• ESX maintains four host free memory states:

high, soft, hard, and low, which are reflected by four thresholds: 6 percent, 4 percent, 2 percent, and 1 percent of host memory respectively.

Page 18: VMWare  MMU

• In the high state, No reclamation is needed. No ballooning or swapping

• If host free memory drops towards the soft threshold, the hypervisor starts to reclaim memory using ballooning.

• If ballooning is not sufficient to reclaim memory or the host free memory drops towards the hard threshold, the hypervisor starts to use swapping in addition to using ballooning. Through swapping, the hypervisor should be able to quickly reclaim memory and bring the host memory state back to the soft state

• host free memory drops below the low threshold, the hypervisor continues to reclaim memory through swapping, and additionally blocks the execution of all virtual machines that consume more memory than their target memory allocations