Troubleshooting System Stutter, Lags, Freezes, and Hangs

Test a Different I/O Scheduler:

Sometimes a kernel change alone will not resolve some stubborn freezing problems. For those that have tested multiple different kernels and are still experiencing freezes, it is a good idea to also test out different I/O schedulers. Some kernel versions, (such as cacule) come preconfigured with different I/O schedulers, otherwise you must manually change schedulers yourself.

Try monitoring your disk I/O activity with the iotop utility. Excessive I/O activity can lead to system slowdowns or freezes. If this appears to be happening you might want to try changing your I/O scheduler. This is an especially worthwhile troubleshooting step if you find any I/O errors in your logs. Test out different schedulers to see if there is any performance improvement.

To identify the scheduler in use for all drives, run:

grep . /sys/class/block/*/queue/scheduler

Switching the default scheduler in use may seem a little daunting if you've never attempted it before, however it is actually quite simple.

For further information, reference the ArchWiki:

Input/Output schedulers

Changing the I/O scheduler

Tuning the I/O scheduler

Storage I/O scheduling with ionice

You may also want to investigate related sysctl tuning parameters:

Sysctl - Virtual memory

Kernel docs - sysctl vitual memory