Skip to content

Instantly share code, notes, and snippets.

@sergey-cheperis
Created December 10, 2021 11:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sergey-cheperis/961998372c618c93f96840c5728a9264 to your computer and use it in GitHub Desktop.
Save sergey-cheperis/961998372c618c93f96840c5728a9264 to your computer and use it in GitHub Desktop.
Resolve khugepagesd 100% CPU usage or soft lockup

Issue

When running calculations with high rate of memory allocation, khugepaged can use 100% CPU or even cause CPU lockup messages in the kernel log:

INFO: task khugepaged:212 blocked for more than 120 seconds.

Solution

Disable transparent huge pages.

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

This needs to be made persistent across reboots.

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