Skip to content

Instantly share code, notes, and snippets.

@2E0PGS
Last active April 14, 2025 10:53
Show Gist options
  • Save 2E0PGS/2560d054819843d1e6da76ae57378989 to your computer and use it in GitHub Desktop.
Save 2E0PGS/2560d054819843d1e6da76ae57378989 to your computer and use it in GitHub Desktop.
Fixing khugepaged CPU usage VMware Workstation

If you run VMware Workstation 11 or above you may encounter high CPU usage from process khugepaged on Ubuntu 15.04+

The fix is to disable transparent hugepages. It seems Ubuntu has it enabled by default.

You can check the current status on your system by running:

cat /sys/kernel/mm/transparent_hugepage/enabled

cat /sys/kernel/mm/transparent_hugepage/defrag

Fedora outputs: always [madvise] never but Ubuntu outputs: [always] madvise never

Fedora seems to not be effected but I havn't tested it myself.

So I suggest not using madvise and just disable it totally.

To disable it run the following commands as root:

echo never > /sys/kernel/mm/transparent_hugepage/enabled

echo never > /sys/kernel/mm/transparent_hugepage/defrag

That will only disable it for the current session.

To have it persistant across reboots I suggest adding this to your rc.local:

# Fix for VMware Workstation 11+ khugepaged.
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag

Ensure this goes above the line:

exit 0

More info and references:

@ckuhtz
Copy link

ckuhtz commented Dec 20, 2024

VMware Workstation 17.6.2

Resolved Issues

  • The kcompactd kernel process causes virtual machines on Linux hosts to become unresponsive
    Virtual machines on Linux hosts eventually become unresponsive because of the kcompactd kernel process. The issue is resolved in VMware Workstation 17.6.2.

AWESOME. Thank you.

@gene-olson
Copy link

gene-olson commented Dec 22, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment