libvirt-bin support for hugepages: apparmor needs a rule for hugetlbfs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libvirt (Ubuntu) |
Expired
|
Medium
|
Unassigned |
Bug Description
Firstly, transparent hugepages can be enabled with:
# echo always > /sys/kernel/
they are nice and easy to get working, but do not survive memory pressure on the host. I/O pressure on the host breaks the 2M pages back to 4k pages, and therefore renders transparent hugepages useless for long-lived processes, as nothing will reassemble the 4k pages back to 2M pages after memory pressure has ceased. So, kvm should be set up using explicit hugetlbfs support for now.
Firstly, kvm is very irritating in that it tends to silently use ordinarily backed memory if hugepage support fails to work, so for a while I thought things were fine despite I had just wasted >8 GB of memory on unused hugepages. This is, however, something to fix within kvm itself rather, and it may be that this is how kvm maintainers prefer it to work. I personally disagree, but it is possible to cat /proc/meminfo and observe if kvm is using hugepages or not: HugePages_Free value equals HugePages_Total when nobody is using hugepages.
I chose to mount hugetlbfs at /hugepages, which makes the directory for kvm's memory pages /hugepages/
However, apparmor still denies access to the hugepage mount point by default. I added a line such as "/hugepages/
I would suggest that libvirt-aa-helper should detect hugepages usage from the domain configuration file (<memoryBacking
$ lsb_release -rd
Description: Ubuntu 12.04 LTS
Release: 12.04
$ apt-cache policy libvirt-bin
libvirt-bin:
Installed: 0.9.8-2ubuntu17.1
Candidate: 0.9.8-2ubuntu17.1
Version table:
*** 0.9.8-2ubuntu17.1 0
500 http://
100 /var/lib/
0.
500 http://
Changed in libvirt (Ubuntu): | |
importance: | Undecided → Medium |
Please see
http:// wiki.debian. org/Hugepages
and
http:// www.linux- kvm.com/ content/ get-performance -boost- backing- your-kvm- guest-hugetlbfs
for more info on how to use hugepages. In particular, if you need exactly
4400 pages (8.8G) for your guest, then do reserve some extra pages for
overhead.
Unless that solves your problem for you, could you please have your system
provide some debugging information using
sudo apport-collect 1001584
on the server?