Bug 530762 - hugetlbfs support doesn't work
Summary: hugetlbfs support doesn't work
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Daniel Veillard
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-10-24 19:34 UTC by Sven Lankes
Modified: 2009-10-29 17:16 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2009-10-25 23:27:50 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Sven Lankes 2009-10-24 19:34:22 UTC
https://fedoraproject.org/wiki/Features/KVM_Huge_Page_Backed_Memory

contains this checklist to get hugetlbfs to work:

1. mount -t hugetlbfs hugetlbfs /dev/hugepages

  I have done this - /dev/hugepages didn't exist - I created it

2. Reserve some memory for huge pages - sysctl vm.nr_hugepages=516

  Done - I created 600 pages to fit a 1024 MB vm (on amd64):

  (from meminfo):

  HugePages_Total:     600
  HugePages_Free:      600
  HugePages_Rsvd:        0
  HugePages_Surp:        0

3. Run an existing KVM guest with libvirt

  done (I also restarted libvirtd)

4. Confirm the guest has booted correctly

  done

5. Confirm the guest is using hugepages by checking HugePages_Free in /proc/meminfo

  it doesn't - HugePages_Free is still 600

Selinux is disabled, my kvm-commandline:

/usr/bin/qemu-kvm -S -M pc-0.11 -m 1024 -smp 1 -name f11-x86_64 -uuid 61563594-3d8f-17c8-1b87-7d727689a9a0 -monitor unix:/var/lib/libvirt/qemu/f11-x86_64.monitor,server,nowait -boot c -drive file=,if=ide,media=cdrom,index=2 -drive file=/var/lib/libvirt/images/f1164.img,if=virtio,index=0,boot=on -net nic,macaddr=00:16:36:74:aa:8f,vlan=0,model=virtio,name=virtio.0 -net tap,fd=17,vlan=0,name=tap.0 -serial pty -parallel none -usb -usbdevice tablet -vnc 127.0.0.1:0 -vga cirrus

Comment 1 Daniel Berrangé 2009-10-25 23:27:50 UTC
Hugepages are not enabled by default for guests, so merely mounting hugetlbfs won't make them be used. You need to add the following to the guest

  <memoryBacking>
    <hugepages/>
  </memoryBacking>

To enable use of hugepages for RAM allocation.

Comment 2 Mark McLoughlin 2009-10-29 17:16:50 UTC
Sven, thanks for the report - I've added a note to "How to test" section in the wiki


Note You need to log in before you can comment on or make changes to this bug.