北京大学学报(自然科学版)

使用缓存的虚拟机内存扩展

钮艳,杨春,夏虞斌,程旭   

  1. 北京大学微处理器研究开发中心, 北京 100871;
  • 收稿日期:2010-02-05 出版日期:2011-03-20 发布日期:2011-03-20

Extending Virtual Machine Memory with Hypervisor Exclusive Cache

NIU Yan, YANG Chun, XIA Yubin, CHENG Xu   

  1. Microprocessor Research and Development Center, Peking University, Beijing 100871;
  • Received:2010-02-05 Online:2011-03-20 Published:2011-03-20

摘要: 针对虚拟机内存需求预测困难及内存分配不足时性能严重下降的问题, 提出在虚拟机监视器中加入一个缓存 HECache。HECache 预先保留部分内存, 运行在同一台物理主机上的所有虚拟机共享该部分内存, 且对 HECache中内存的使用申请都可以立即得到满足。通过预先牺牲少量内存的方法, 所有的虚拟机都获得了更多的可用内存。实验结果表明, 将内存保留在 HECache 中与直接分配给虚拟机相比开销很低。HECache 对应用程序透明, 与现有的其他内存机制( 例如 ballooning, page-sharing, hotplug) 等兼容。

关键词: 虚拟机, 内存资源管理, 独占缓存, Xen

Abstract: It is hard to accurately predict the memory demand of a virtual machine. Moreover, it is not reliable to request other virtual machines to release memory. Under-provision of memory will lead to severe performance degradation. To mitigate the impact, a hypervisor exclusive cache (HECache) is developed to extend the available memory of a virtual machine. A certain amount of memory is preserved as HECache in advance. The failed memory access in the VM is forwarded to HECache. All virtual machines running on the physical machine share HECache and can use it immediately. Through donating a little memory, all virtual machines can use more memory. The experiments conducted with both micro-benchmarks and real applications show that HECache can achieve up to 7. 9 times better performance, and the overhead is not significant compared with allocating the same amount of memory directly to a virtual machine. In addition, HECache is transparent to applications, and is complementary to the existing techniques such as ballooning, page-sharing, hotplug, etc.

Key words: virtual machine, memory resource management, exclusive cache, Xen

中图分类号: