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:
Same for me.
None of the above works for me. Did the hugepage_transparent things, the compaction_proactiveness, both directly, in etc/, and in vmware *.vmx file. Checking the various variable from /proc and /sys returns the expected value. Still, kcompactd0 kicks in. It is slightly less severe than it uses to be, but still it freezes the guest to death.
I'm thinking about recompiling the kernel and disabling that kcompactd0 thing altogether.
Host Debian 5.16.18-1 (2022-03-29) x86_64 GNU/Linux, 16GB RAM.
VMWare 16.2.3 build-19376536
Guest Windows 10 (64-bit), 8GB RAM allocated.