I had been struggling for some considerable time with guest (Win10) performance issues with VMware – including application (Photoshop CS6) ‘freezing’ for a time, and overall very sluggish responses..
I had found several articles that suggested cause/effect/fix for this, but none really worked..
I made changes to control khugepaged:
[root@rglinux820 ~]$ echo never | tee /sys/kernel/mm/transparent_hugepage/defrag
[root@rglinux820 ~]$ echo 0 | tee /sys/kernel/mm/transparent_hugepage/khugepaged/defrag
[root@rglinux820 ~]$ cat /sys/kernel/mm/transparent_hugepage/defrag
always defer defer+madvise madvise [never]
– and added ‘ transparent_hugepage=never ‘ to the kernel command line..
– but this only worked for a while after host reboot, and then the guest freezing started again.
I then found another suggestion, regarding kcompactd0, and made the following changes (as root):
$ echo 0 > /proc/sys/vm/compaction_proactiveness
and (for a permanent fix) added the following to /etc/sysctl.conf:
# Fix problem when vmware is affected by kcompactd0.
After all these changes, the freezing problem seems to have – finally – disappeared..
It should be mentioned that Win10 also may need ‘power/performance’ settings altered to prevent ‘disk sleep’ issues etc., but that is outside the scope of a Linux article!..
There may be other workarounds/fixes, but these are the ones that worked for me..
The original articles I found are here – and one has been updated to cover a potential Win11 guest issue:
https://gist.github.com/2E0PGS/2560d054819843d1e6da76ae57378989 (scroll down to the comments by neves-0 and gene-olsen for the kcompactd0 fix..)
Robert Gadsdon. January 20th, 2022.