You are not logged in.

#1 2016-03-23 00:21:52

piknik
Member
Registered: 2016-03-13
Posts: 8

Dynamic/transparent hugepages for VMs

Hello,

I have successfully got hugepages to work with my VMs, but now even though my VMs are off (which they usually are) the hugepages take up my memory quite a bit (4GB for 1 VM). Is there some existing mechanism to modify the number of hugepages based on the amount of memory used in the VM, or will I have to modify /proc/sys/vm/nr_hugepages with VM autostart scripts?

Offline

#2 2016-03-28 23:31:49

piknik
Member
Registered: 2016-03-13
Posts: 8

Re: Dynamic/transparent hugepages for VMs

Well, since I haven't received any help on this topic, I assume this is a non-existant feature. So for now, I just added qemu hooks to add/remove the entire hugepages size like this, maybe it will help someone else out:

if [ "${1}" = "win10" ]; then
	if [ "${2}" = "start" ]; then
		echo 2050 > /proc/sys/vm/nr_hugepages
		xrandr --output HDMI1 --off
	elif [ "${2}" = "stopped" ]; then
		echo 0 > /proc/sys/vm/nr_hugepages
		xrandr --output HDMI1 --auto
		xrandr --output HDMI1 --right-of HDMI2
	fi
fi

Offline

Board footer

Powered by FluxBB