Most of the time when my computer starts to need swap, I see a massive spike in CPU usage (
kswapd0 is consistently using 99%-100% CPU). According to
top, the time is spent in
sy (system/kernel) not
wa (IO wait).
I am running Linux 4.0.4-2-ARCH on a C720 with 2GB RAM, and 6GB swap on an SSD.
I seem to have this problem with or without discard pages (TRIM) turned on.
Are there any setting I should inspect or tweak to see if I can fix this?
Is there any way to debug the problem? Something like
strace for kernel threads?
Running with default Arch Linux settings:
[always] madvise never