A process in disk sleep or uninterruptible sleep is typically waiting on some I/O operation to complete. In this state, it cannot be woken up by signals, hence the process cannot be terminated using the SIGKILL signal.
My limited understanding of what happens is this:
The CPU scheduler in the kernel maintains a run queue which is the list of processes that are ready to run. When a process gets the CPU, it either
- Utilizes it's time slice fully and gets scheduled out, or
- It needs to wait for the response of an operation, typically I/O, and requests to be transferred to the sleep queue, waiting on the event.
Processes that schedule out due to #2 also indicate to the scheduler if they should be interrupted or not while they are waiting on the event. When they cannot continue proper operation if interrupted by a signal (typically device drivers), they'll indicate that they should be woken up only by the event. These are in uninterruptible sleep state, and will get moved to the sleep queue.
If you are experiencing regular freezing of the system due to disk sleep, it could be one of
- Buggy device driver
- Faults on your hardware (Disk drive?)
- Mounted filesystems that are slow to respond.
I've seen this time and again with NFS file systems. If for some reason the device response is lost the process will remain in sleep state, making it almost impossible to use the mount/device till a reboot.
If you think it's your hard disk access causing the I/O freezes, it might be prudent to check if there are bad blocks or sectors on the drive.