You are not logged in.

#1 2016-04-30 22:36:42

da99
Member
Registered: 2011-08-30
Posts: 17

[Solved] Why doesn't "grub" settings work for transparent_hugepage?

I tried disabling transparent hugepage using grub, but it didn't work.
Using the "tmpfiles.d" approach does work:

From: https://bbs.archlinux.org/viewtopic.php?pid=1624102

# /etc/tmpfiles.d/local.conf
w /sys/kernel/mm/transparent_hugepage/enabled - - - - never
w /sys/kernel/mm/transparent_hugepage/defrag - - - - never

Any idea why the grub solution (below) didn't work?

# add to /etc/default/grub: GRUB_CMDLINE_LINUX_DEFAULT="transparent_hugepage=never"
sudo grub-mkconfig -o /boot/grub/grub.cfg
sudo reboot 

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

Last edited by da99 (2016-04-30 23:47:09)

Offline

#2 2016-04-30 22:57:56

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,911
Website

Re: [Solved] Why doesn't "grub" settings work for transparent_hugepage?

Setting transparent_hugepage=never on the kernel cmdline should work:

From /usr/lib/modules/4.5.1-1-ARCH/build/Documentation/vm/transhuge.txt:

== Boot parameter ==

You can change the sysfs boot time defaults of Transparent Hugepage
Support by passing the parameter "transparent_hugepage=always" or
"transparent_hugepage=madvise" or "transparent_hugepage=never"
(without "") to the kernel command line.

So does that GRUB_CMDLINE_LINUX_DEFAULT setting actually alter the kernel command line? What does

cat /proc/cmdline

show? Are you sure you're booting with grub? What's in your /boot/grub/grub.cfg after running grub-mkconfig?


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2016-04-30 23:27:54

da99
Member
Registered: 2011-08-30
Posts: 17

Re: [Solved] Why doesn't "grub" settings work for transparent_hugepage?

I couldn't find any other boot loader installed except for grub. 

After running "grub-mkconfig" , the lines are inserted into /boot/grub/grub.cfg:

	linux	/vmlinuz-linux root=UUID=b.. rw  default splash transparent_hugepage=never
		linux	/vmlinuz-linux root=UUID=b... rw  default splash transparent_hugepage=never
		linux	/vmlinuz-linux root=UUID=b...rw  default splash transparent_hugepage=never

"cat /proc/cmdline" is:

initrd=\initramfs-linux.img root=/dev/sda2	rw

So you're right, the changes are not being added.

I'm going to try using "systemd-boot" approach from:
https://wiki.archlinux.org/index.php/kernel_parameters

Last edited by da99 (2016-04-30 23:32:23)

Offline

#4 2016-04-30 23:45:56

da99
Member
Registered: 2011-08-30
Posts: 17

Re: [Solved] Why doesn't "grub" settings work for transparent_hugepage?

Using the "systemd-boot" approach worked:

cat /sys/kernel/mm/transparent_hugepage/enabled 
  #  always madvise [never]
cat /sys/kernel/mm/transparent_hugepage/defrag
  #  [always] madvise never
cat  /proc/cmdline
  # initrd=\initramfs-linux.img root=/dev/sda2	rw splash transparent_hugepage=never

Does it matter if ../defrag is enabled? According to this answer, it doesn't seem important as long as ../enabled is [never]: http://stackoverflow.com/a/33497495:

Therefore, the fix to this bug is to first look at transparent_hugepage/enabled, and if it is never, don't bother looking at the irrelevant transparent_hugepage/defrag setting.

Last edited by da99 (2016-04-30 23:55:18)

Offline

Board footer

Powered by FluxBB