RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1189868 - Disabling Transparent Hugepages persistently via kernel boot command line not working
Summary: Disabling Transparent Hugepages persistently via kernel boot command line not...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: tuned
Version: 7.2
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: 7.2
Assignee: Jaroslav Škarvada
QA Contact: Tereza Cerna
URL:
Whiteboard:
: 1195656 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-05 16:52 UTC by rlopez
Modified: 2015-11-19 12:21 UTC (History)
7 users (show)

Fixed In Version: tuned-2.5.0-1.el7
Doc Type: Bug Fix
Doc Text:
Cause: Previously the transparent_hugepages wasn't handled the optimal way in Tuned. Consequence: If user explicitly specified transparent_hugepage settings in kernel command line, the settings could be overwritten by Tuned. Fix: Handling of transparent_hugepages was improved in Tuned. Result: Kernel boot command line is now checked by Tuned and if transparent_hugepage settings is specified there, the setting from Tuned profile is ignored. Also transparent_hugepages was removed from the throughput-performance profile, because it is now not needed there. Finally support for 'madvise' transparent_hugepages setting was added into Tuned.
Clone Of:
Environment:
Last Closed: 2015-11-19 12:21:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2375 0 normal SHIPPED_LIVE tuned bug fix and enhancement update 2015-11-19 10:51:42 UTC

Description rlopez 2015-02-05 16:52:13 UTC
Description of problem:
Disabling transparent huge pages persistently across reboots by adding to the kernel boot command line within the /etc/default/grub and adding 'transparent_hugepage=never' within the GRUB_CMDLINE_LINUX is not working.

my grub file:

cat /etc/default/grub 
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.lvm.lv=myvg/swap rd.lvm.lv=myvg/usr vconsole.font=latarcyrheb-sun16 rd.lvm.lv=myvg/root crashkernel=auto  vconsole.keymap=us rhgb quiet transparent_hugepage=never"
GRUB_DISABLE_RECOVERY="true"

grub2-mkconfig -o /boot/grub2/grub.cfg 
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-123.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-123.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-123.6.3.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-123.6.3.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-17255126fcb14a469742d9f2ba9a1088
Found initrd image: /boot/initramfs-0-rescue-17255126fcb14a469742d9f2ba9a1088.img
done

Reboot the system, once the system is back up

cat /sys/kernel/mm/transparent_hugepage/enabled 
[always] madvise never

How reproducible:
100%

Am I doing something wrong? This is my understanding on persistently setting transparent hugepages off persistently

Comment 2 Peter Jones 2015-03-12 17:59:53 UTC
Can you show us /proc/cmdline after you've done this?  If that option is there, then this is probably a kernel problem rather than a grub2 related issue.

Comment 3 rlopez 2015-03-13 13:33:49 UTC
(In reply to Peter Jones from comment #2)
> Can you show us /proc/cmdline after you've done this?  If that option is
> there, then this is probably a kernel problem rather than a grub2 related
> issue.

Peter,

After reboot,

# cat /sys/kernel/mm/transparent_hugepage/enabled 
[always] madvise never

# cat /proc/cmdline 
BOOT_IMAGE=/vmlinuz-3.10.0-123.el7.x86_64 root=UUID=32e374f8-83ba-479e-a4bb-80d4f34516a7 ro rd.lvm.lv=myvg/rootvol vconsole.keymap=us vconsole.font=latarcyrheb-sun16 crashkernel=auto rhgb quiet transparent_hugepage=never

Comment 4 rlopez 2015-03-13 13:39:08 UTC
(In reply to rlopez from comment #3)
> (In reply to Peter Jones from comment #2)
> > Can you show us /proc/cmdline after you've done this?  If that option is
> > there, then this is probably a kernel problem rather than a grub2 related
> > issue.
> 
> Peter,
> 
> After reboot,
> 
> # cat /sys/kernel/mm/transparent_hugepage/enabled 
> [always] madvise never
> 
> # cat /proc/cmdline 
> BOOT_IMAGE=/vmlinuz-3.10.0-123.el7.x86_64
> root=UUID=32e374f8-83ba-479e-a4bb-80d4f34516a7 ro rd.lvm.lv=myvg/rootvol
> vconsole.keymap=us vconsole.font=latarcyrheb-sun16 crashkernel=auto rhgb
> quiet transparent_hugepage=never

To add, I have another system with RHEL 7.1 and I see it there too. See below.

# cat /sys/kernel/mm/transparent_hugepage/enabled 
[always] madvise never

# cat /proc/cmdline 
BOOT_IMAGE=/vmlinuz-3.10.0-229.el7.x86_64 root=/dev/mapper/myvg-rootvol ro rd.lvm.lv=myvg/rootvol vconsole.keymap=us vconsole.font=latarcyrheb-sun16 crashkernel=auto rhgb quiet transparent_hugepage=never LANG=en_US.UTF-8

Comment 5 Jeremy Eder 2015-03-13 15:51:45 UTC
This is because of RHEL7's default tuned profile "throughput-performance".

Removing it from the tuned profile would prevent tuned from overriding the kernel cmdline option as specified by the user.

This change will have no performance impact, as the kernel's default is transparent_hugepages=always and all we are fixing here is to have tuned not override cmdline setting if it were set by the user.  Since the kernel enables THP by default, transparent_hugepage=always is redundant in tuned.

Verifying there really is only one profile that should be fixed:

# rpm -q tuned
tuned-2.4.1-1.el7.noarch

# grep -ri transparent /usr/lib/tuned/*/*conf
/usr/lib/tuned/network-latency/tuned.conf:transparent_hugepages=never
/usr/lib/tuned/throughput-performance/tuned.conf:transparent_hugepages=always

It's only the throughput-latency profile that we need to fix, because we specifically want THP disabled for network latency sensitive workloads.

Patch against upstream tuned:

# git diff
diff --git a/profiles/throughput-performance/tuned.conf b/profiles/throughput-performance/tuned.conf
index 42473a9..4d6c607 100644
--- a/profiles/throughput-performance/tuned.conf
+++ b/profiles/throughput-performance/tuned.conf
@@ -7,9 +7,6 @@ governor=performance
 energy_perf_bias=performance
 min_perf_pct=100
 
-[vm]
-transparent_hugepages=always
-
 [disk]
 readahead=>4096





Until we ship an errata, the workaround is to create a tuned profile like so:

# cat /etc/tuned/thp/tuned.conf 
[main]
include=throughput-performance

[vm]
transparent_hugepages=never

# systemctl restart tuned

# cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.10.0-229.el7.x86_64 root=/dev/mapper/vg0-root ro rd.md=0 rd.dm=0 rd.lvm.lv=vg0/swap console=ttyS0,115200 rd.lvm.lv=vg0/root rd.luks=0 vconsole.keymap=us vconsole.font=latarcyrheb-sun16 audit=0 transparent_hugepage=never

# cat /sys/kernel/mm/transparent_hugepage/enabled 
[always] madvise never

# tuned-adm profile thp
# cat /sys/kernel/mm/transparent_hugepage/enabled 
always madvise [never]

Comment 8 Jeremy Eder 2015-04-17 12:51:49 UTC
*** Bug 1195656 has been marked as a duplicate of this bug. ***

Comment 9 Jaroslav Škarvada 2015-06-26 11:56:19 UTC
Upstream commit fixing this issue:
https://git.fedorahosted.org/cgit/tuned.git/commit/?id=e2f86d412f598838630b30350a08e5befbad7ea3

It removes transparent_hugepages from throughput-performance profile.

It adds check for kernel boot cmdline, if there is transparent_hugepage already set, profile settings are ignored.

And finally it adds support for 'madvise' transparent_hugepages setting.

Comment 12 errata-xmlrpc 2015-11-19 12:21: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.

https://rhn.redhat.com/errata/RHBA-2015-2375.html


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