I am puzzled by LWN again.
Huge pages, slow drives, and long delays -- LWN.net, 2011
It is a rare event, but it is no fun when it strikes. Plug in a slow storage device - a USB stick or a music player, for example - and run something like rsync to move a lot of data to that device. The operation takes a while, which is unsurprising; more surprising is when random processes begin to stall...
A process (that web browser, say) is doing its job when it incurs a page fault ... If the transparent huge pages feature is built into the kernel (and most distributors do enable this feature), the page fault handler will attempt to allocate a huge page.
I can see that on Red Hat Enterprise Linux, transparent hugepages are enabled as described by LWN.
How to use, monitor, and disable transparent hugepages in Red Hat Enterprise Linux 6 and 7?
Transparent Huge Pages (THP) are enabled by default in RHEL 6 for all applications...
For RHEL 7 see How to disable transparent hugepages (THP) on Red Hat Enterprise Linux 7. For RHEL 8 see How to disable transparent hugepages (THP) on Red Hat Enterprise Linux 8. [Links to content for subscribers only].
However, I looked on my Fedora Workstation 29 laptop, and I see transparent hugepages are not enabled "for all applications".
$ cat /sys/kernel/mm/transparent_hugepage/enabled
always [madvise] never
$ uname -r
4.19.13-300.fc29.x86_64
I also checked in some VMs: I see the same on Ubuntu Desktop 18.04 (kernel 4.15.0-43-generic), and on a Debian 9 Desktop install (kernel 4.9.0-8-amd64). (And I don't believe Debian has a "Server" install, spin, or package. It just has a few different "tasks" to install the most common server softwares. So I don't think there is any one place in Debian that could be enabling a server-specific configuration).
- Does Fedora Server 29 enable transparent hugepages for all apps?
- Does Ubuntu Server 18.04 enable transparent hugepages for all apps?
- Did a different version number of one of these distributions enable transparent hugepages for all apps, e.g. around 2011?
[By implication: was LWN.net correct here, or not? And if it was correct to say that most distributors enabled transparent hugepages, and imply that it affected some common "desktop" (or laptop) setups, do we know why current versions of Fedora Workstation, Debian, and Ubuntu Desktop are not enabling transparent hugepages for all?]
madvise
is still enabled. But it's not "system wide". See https://www.kernel.org/doc/Documentation/vm/transhuge.txtFYI, I just checked my ubuntu server on AWS and it is also set to
– Philip Couling Jan 21 '19 at 16:43madvise
.