Bug 864123 - QEMU will only use THP if it's enabled system wide
QEMU will only use THP if it's enabled system wide
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Luiz Capitulino
Virtualization Bugs
Depends On:
  Show dependency treegraph
Reported: 2012-10-08 12:21 EDT by Luiz Capitulino
Modified: 2014-06-18 04:51 EDT (History)
7 users (show)

See Also:
Fixed In Version: qemu 1.3
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-06-13 05:31:38 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Luiz Capitulino 2012-10-08 12:21:10 EDT
Description of problem:

QEMU will only use transparent huge pages if it's enabled system wide. This happens because QEMU doesn't call MADV_HUGEPAGE for ram allocations.

Version-Release number of selected component (if applicable): QEMU 1.2 and earlier

How reproducible:

Steps to Reproduce:
1. Enable THP only for MADV_HUGEPAGE:

  # echo madvise > /sys/kernel/mm/transparent_hugepage/enabled

2. Start a QEMU process (a reasonable amount of RAM, say 1G, should be better)

3. Check QEMU's huge page usage

  # grep AnonHugePages /proc/qemu-pid/smaps
Actual results:

All lines is:

AnonHugePages:         0 kB

Meaning that huge pages are not used.

Expected results:

Some lines should have > 0 results, eg:

AnonHugePages:    276480 kB

Additional info:
Comment 1 Luiz Capitulino 2012-10-08 12:22:48 EDT
Posted patch upstream:

Comment 2 Luiz Capitulino 2012-10-23 11:41:38 EDT
Patch merged on qemu upstream, commit: ad0b5321f1f797274603ebbe20108b0750baee94
Comment 4 Shaolong Hu 2014-01-17 00:46:40 EST
Verified on qemu-kvm-rhev-1.5.3-31.el7.x86_64:

[root@localhost ~]# grep AnonHugePages /proc/21914/smaps
AnonHugePages:         0 kB
AnonHugePages:         0 kB
AnonHugePages:    530432 kB
AnonHugePages:         0 kB
Comment 5 Ludek Smid 2014-06-13 05:31:38 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

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