Bug 706385 - pending THP improvements for RHEL6.2
Summary: pending THP improvements for RHEL6.2
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel
Version: 6.2
Hardware: All
OS: Linux
medium
low
Target Milestone: rc
: ---
Assignee: Andrea Arcangeli
QA Contact: Caspar Zhang
URL:
Whiteboard:
: 679997 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-20 10:56 UTC by Andrea Arcangeli
Modified: 2018-11-26 18:20 UTC (History)
4 users (show)

Fixed In Version: kernel-2.6.32-156.el6
Doc Type: Bug Fix
Doc Text:
In Red Hat Enterprise Linux 6.2, Transparent Huge Pages are now supported in several places of the kernel: The system calls of mremap, mincore, and mprotect /proc tunable parameters: /proc/<pid>/smaps and /proc/vmstat Additionally, Transparent Huge Pages add some compaction improvements.
Clone Of:
Environment:
Last Closed: 2011-12-06 13:32:17 UTC
Target Upstream Version:


Attachments (Terms of Use)
mincore.c (522 bytes, patch)
2011-11-01 10:10 UTC, Caspar Zhang
no flags Details | Diff
mprotect.c (481 bytes, text/plain)
2011-11-01 10:11 UTC, Caspar Zhang
no flags Details
mremap.c (727 bytes, text/plain)
2011-11-01 10:12 UTC, Caspar Zhang
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:1530 0 normal SHIPPED_LIVE Moderate: Red Hat Enterprise Linux 6 kernel security, bug fix and enhancement update 2011-12-06 01:45:35 UTC

Description Andrea Arcangeli 2011-05-20 10:56:30 UTC
Description of problem: transparent hugepages weren't natively supported by several places in the kernel, this adds transparent hugepage native support to several places (mremap, mincore, mprotect, /proc/<pid>/smaps, /proc/vmstat) and adds some compaction improvement


Version-Release number of selected component (if applicable): RHEL6.2


How reproducible: 


Steps to Reproduce:
1. grep Anon /proc/self/smaps and verify AnonHugePages is present
2. grep thp /proc/vmstat and verify several thp stats are visible
3. run mprotect, mincore, mremap on a THP mapping and verify thp_split doesn't increase in /proc/vmstat
  
Actual results: AnonHugePages missing in /proc/self/smaps, /proc/vmstat thp_* stats missing, mprotect/mincore/mremap splitting hugepages even if 2M alignments aren't altered.


Expected results: AnonHugePages present in /proc/self/smaps, thp_* stats present in /proc/vmstat, mprotect/mincore/mremap not splitting hugepages if 2M alignments aren't broken


Additional info: The mremap patch significantly optimize the kernel even when THP are not used because being used on file mappings, or when THP is disabled, by reducing the SMP IPIs to 1 per vma, instead of 1 per 4k page. The mremap patch is also the most risky of the series, but it's also one that can provide the biggest boost to JVM or other applications using mremap (especially on THP but also without).

Shak tested a kernel with these patches and the result was:

[root@perf34 SPECjbb2005]# grep throughput r6_*perf34*.txt
Static huge pages:
r6_131_perf34_80cpu_huge.txt:           throughput =     721564.06
SPECjbb2005 bops

THP - 2.6.32-131 - RHEL6.1 snap5
r6_131_perf34_80cpu_thtp.txt:           throughput =     749127.42
SPECjbb2005 bops

THP - Andrea's 2.6.32-140thp
r6_140thp_perf34_80cpu_thtp.txt:           throughput =     761363.25
SPECjbb2005 bops

Comment 2 Andrea Arcangeli 2011-05-20 11:10:39 UTC
Build with these patches based on -151:

https://brewweb.devel.redhat.com/taskinfo?taskID=3339439

19 patches posted to rhkernel-list on the thread with Message-Id: <20110520110640.655593797>.

Comment 3 Qian Cai 2011-05-24 03:33:42 UTC
*** Bug 679997 has been marked as a duplicate of this bug. ***

Comment 4 Andrea Arcangeli 2011-05-26 17:29:55 UTC
Patch number 2/19 has been obsoleted for an (harmless) double accounting in /proc/vmstat and new replacement patch 2/19 is submitted to rhkernel-list with Message-ID: <20110526172833.GP19505>

Comment 5 Andrea Arcangeli 2011-05-26 22:03:49 UTC
A replacement patch for 15/19 has been posted to rhkernel-list with Message-ID: <20110526220056.GR19505>. Patch 15/19 was developed before 29 Mar, but after that date the RHEL6 kernel uses walk_page_range in memcontrol.c too so it now requires two liner additions to the the memcontrol.c file compared to the previous version originally backported to an older codebase. Thanks to Johannes for noticing.

Comment 7 RHEL Program Management 2011-06-16 03:30:01 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux maintenance release. Product Management has 
requested further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed 
products. This request is not yet committed for inclusion in an Update release.

Comment 9 Andrea Arcangeli 2011-07-06 15:21:13 UTC
Posted an incremental patch to fix bug in patch 11/19: Message-ID: <20110706152029.GD2820>

Comment 13 Aristeu Rozanski 2011-08-04 12:50:12 UTC
Patch(es) available on kernel-2.6.32-177.el6

Comment 16 Aristeu Rozanski 2011-08-11 20:08:37 UTC
Patch(es) available on kernel-2.6.32-156.el6

Comment 19 Linda Wang 2011-08-21 17:35:34 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
In RHEL6.2, Transparent Hugepages adds natively supported in
several places of the kernel such as to the syscalls of mremap, mincore, mprotect; /proc tunable paremeters:  /proc/<pid>/smaps, /proc/vmstat, and adds some compaction improvement

Comment 20 Caspar Zhang 2011-11-01 10:10:42 UTC
Created attachment 531100 [details]
mincore.c

simple test program to check mincore thp support

Comment 21 Caspar Zhang 2011-11-01 10:11:47 UTC
Created attachment 531101 [details]
mprotect.c

Comment 22 Caspar Zhang 2011-11-01 10:12:13 UTC
Created attachment 531102 [details]
mremap.c

Comment 24 Martin Prpič 2011-11-10 12:26:36 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,2 +1,6 @@
-In RHEL6.2, Transparent Hugepages adds natively supported in
+In Red Hat Enterprise Linux 6.2, Transparent Huge Pages are now supported in several places of the kernel:
-several places of the kernel such as to the syscalls of mremap, mincore, mprotect; /proc tunable paremeters:  /proc/<pid>/smaps, /proc/vmstat, and adds some compaction improvement+
+    The system calls of mremap, mincore, and mprotect
+    /proc tunable parameters: /proc/<pid>/smaps and /proc/vmstat 
+
+Additionally, Transparent Huge Pages add some compaction improvements.

Comment 25 errata-xmlrpc 2011-12-06 13:32:17 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2011-1530.html


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