I've been running Linux for 15 years and am stuck. Help!

On Ubuntu Desktop, sometimes (usually after a few minutes - sometimes not at all until reboot) all file write operations seem to hang, while opening files is not a problem. Can't kill processes, they just go <defunct>. Extremely slow drawing of windows.

What's going on here? Memory and CPU look good. Open files are not crazy... io load is very low. Not virtualized.

Any ideas?

@_lennart What does DMESG have to say when it's happening? I had a Raspberry Pi that did this because there was a DMA bug in the CPU that needed a workaround. Lots of I/O errors at the time.

Also, what's your 'swappiness' set to, and are you seeing swap in-use go up (even if you have plenty of memory available) at the time?

Are you running a distro that defaults to Transparent Hugepages (e.g., Fedora/CentOS/RHEL), with a workload somewhere that's not good with THP (e.g., redis)?

Can you pop a terminal open with 'sudo top' running and see if maybe a particular kernel process is associated with whatever is going on?