Sample Header Ad - 728x90

How my VM overcommit memory using hugetlbfs

0 votes
0 answers
35 views
I am trying to reproduce the experiments in this paper.《Progressive Memory Adjustment with Performance Guarantee in Virtualized Systems》. It is said "For example, we use hugetlbfs to limit the available memory in the host to 100GB, but the memory size requested by all VMs is 120GB, and the memory overcommitment rate value at this scenario is (120 − 100)/100 = 20%." This is what i have done. I try to boot two VM with "-m 6G" and only allocate 10G to hugetlbfs, which means 20% overcommitment rate. I have to use "prealloc=off,reserve=off" because if not the qemu would error I have not enough memory to boot the second vm. qemu-system-x86_64 \ -m 6G\ -object memory-backend memfd,id=mem1,size=6G,hugetlb=on,hugetlbsize=2M,share=on,prealloc=off,reserve=off \ -numa node,memdev=mem1 \ ...... Then, i try to make VM1 use 6GB memory, and make VM2 use 6GB memory when VM1 release memory. In my idea, the VM2 should allocate memory faster than VM1 release, so in a few seconds, the VM1 should have no hugepages to allocate and wait. This worsen the performance of VM1, which is what i want. Therefore, i can test another better algorithm that VM1 release memory faster than normal algorithm(which is FreePageReporting). My problem is, VM2 would just broke when the hugetlbfs have zero hugepages left. It should be right as is said in "If no huge page exists at page fault time, the task is sent a SIGBUS and often dies an unhappy death. ". But it is not what i want. because I want the VM2 to wait or use memory from swap zone. I have enable the swapfile but it is just not used at all. Could anyone help? i have been stuck here for 2 months and my due is coming. PLEASE!
Asked by qi chen (1 rep)
Feb 21, 2025, 07:42 AM