[Bug 1315402] Re: No easy way to use hugetlbfs with QEMU

Serge Hallyn 1315402 at bugs.launchpad.net
Wed May 7 22:46:53 UTC 2014


** Description changed:

+ =====================================
+ Impact: ksm not enabled, users cannot easily use hugepages, and on older kernels the kvm_{amd,intel}.ko won't get mounted 
+ Test case: cat /sys/kernel/mm/ksm/run
+ Regression potential: this upstart job was always installed up through near the end of trusty cycle, so there should be no regression potential
+ =====================================
+ 
  In previous releases (tested with Saucy), if one wanted to use hugetlbfs
  for a VM, the needed procedure was:
  
  1) Add "vm.nr_hugepages" to /etc/sysctl.d/60-hugepages.conf
  2) start procps
  3) Set KVM_HUGEPAGES=1 in /etc/default/qemu-kvm
  4) restart qemu-kvm
  5) Enable "<memoryBacking> <hugepages/></memoryBacking>" in the libvirt guest definition
  6) Restart the guest
  
  Now with Trusty, this doesn't work anymore as there is no (obvious?) way
  to have the hugetlbfs mounted where QEMU expects it.
  
  
  On Saucy, the upstart job for qemu-kvm contains this:
  
  	# mount hugepages if available and requested
  	if [ "$KVM_HUGEPAGES" -eq "1" ]; then
  		if ! grep -q hugetlbfs /proc/filesystems; then
  			logger -t qemu-kvm "Error: hugepages not available in the kernel!"
  		elif grep -q /run/hugepages/kvm /proc/mounts; then
  			logger -t qemu-kvm "/run/hugepages/kvm already mounted"
  		elif ! grep -q kvm /etc/group; then
  			logger -t qemu-kvm "Error: group kvm does not exist!"
  		else
  			kvmgid=`grep kvm /etc/group | cut -d: -f 3`
  			mkdir -p /run/hugepages/kvm
  			mount -t hugetlbfs hugetlbfs-kvm -o mode=775,gid=$kvmgid /run/hugepages/kvm
  		fi
  	fi
  
  But it seems there is nothing similar in Trusty and manually mounting
  the hugetlbfs doesn't help as qemu cannot find it there.
  
  
  Host information:
  
  $ lsb_release -rd
  Description:	Ubuntu 14.04 LTS
  Release:	14.04
  $ apt-cache policy qemu-system-x86 libvirt-bin
  qemu-system-x86:
    Installed: 2.0.0+dfsg-2ubuntu1
    Candidate: 2.0.0+dfsg-2ubuntu1
    Version table:
   *** 2.0.0+dfsg-2ubuntu1 0
          500 http://archive.ubuntu.com/ubuntu/ trusty-proposed/main amd64 Packages
          100 /var/lib/dpkg/status
       2.0.0~rc1+dfsg-0ubuntu3.1 0
          500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
          500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
       2.0.0~rc1+dfsg-0ubuntu3 0
          500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
  libvirt-bin:
    Installed: 1.2.2-0ubuntu13.1
    Candidate: 1.2.2-0ubuntu13.1
    Version table:
   *** 1.2.2-0ubuntu13.1 0
          500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
          100 /var/lib/dpkg/status
       1.2.2-0ubuntu13 0
          500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
  
  ProblemType: Bug
  DistroRelease: Ubuntu 14.04
  Package: qemu-system-common 2.0.0+dfsg-2ubuntu1
  ProcVersionSignature: Ubuntu 3.13.0-24.46-generic 3.13.9
  Uname: Linux 3.13.0-24-generic x86_64
  ApportVersion: 2.14.1-0ubuntu3
  Architecture: amd64
  CurrentDesktop: Unity
  Date: Fri May  2 10:05:18 2014
  InstallationDate: Installed on 2014-01-26 (95 days ago)
  InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Alpha amd64 (20140124)
  SourcePackage: qemu
  UpgradeStatus: No upgrade log present (probably fresh install)

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to qemu in Ubuntu.
https://bugs.launchpad.net/bugs/1315402

Title:
  No easy way to use hugetlbfs with QEMU

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1315402/+subscriptions



More information about the Ubuntu-server-bugs mailing list