Emerging Non-volatile memory technologies promise high density,low cost and DRAM-like performance,at the expense of limited write endurance and high write energy consumption.Hybrid memory architecture is widely used in academia to balance the performance and energy consumption of DRAM and NVM.However,the existing hypervisors have no notion of memory heterogeneity,and result in high management complexity,limited scalability,and heavy optimization overhead due to asymmetry access features of DRAM and NVM.In this paper,we propose HMvisor,a lightweight hypervisor and virtual machine coordinated hybrid memory management mechanism to optimize performance and energy efficiency.HMvisor exposes the memory heterogeneity to VMs by mapping virtual NUMA nodes to different physical NUMA nodes.Furthermore,we develop NVM-aware balloon technology to adjust hybrid memory.We also propose a DRAM-NVM resource trading mechanism to perform Inter-VM memory adjustments based on dynamic memory demands.We develop a lightweight page hotness tracking mechanism in the hypervisor,which coordinates the guest OS to perform intra-VM page migrations without disrupting the VMs.The page migration mechanism of HMvisor ensures the consistency of VMs' heterogeneous memory,and can be seamlessly coordinated with NVM-aware balloon technology to achieve both Inter-VM and Intra-VM opitimizations.We implemented our prototype system based on QEMU/KVM and evaluate it with several benchmarks.Experiment results show that hotness-tracking algorithm of HMvisor performs better than CMQ algorithm,HMvisor improves performance by 30%.HMvisor can reduce 50% of write traffic to NVM with less than 5% performance overhead.Moreover,the hybrid memory adjustment scheme in HMvisor can significantly improve application performance by up to 30 X. |