How to stop 'uninterruptible' process on Linux?

后端 未结 6 543
借酒劲吻你
借酒劲吻你 2020-12-28 11:50

I have a VirtualBox process hanging around which I tried to kill (KILL/ABORT) but without success. The parent pid is 1 (init).

top

6条回答
  •  余生分开走
    2020-12-28 12:33

    Killing an uninterruptible process succeeds, it just doesn't do so immediately. The process won't disappear until it actually receives the signal. So sending a signal alone is not enough to get rid of the process, you also have to wake it up from uninterruptible sleep.

    Tanel Poder has written a great guide to analyse D state processes. It is very typical that this state is caused by incomplete I/O, e.g. network failure. slm has posted some very useful pointers on superuser how to unjam the network I/O, and also about the problem itself.

    Personally, when dealing with Windows on VirtualBox, and even with wine, I often run into this problem because of a cdrom I/O that never completes (I guess its some sort of disc presence check). ATA devices can be reset, which likely will unjam the process. For instance, I'm using the following little script to reset both my optical drives, unjamming the processes they are blocking:

    echo 1 > /sys/block/sr0/delete
    echo 1 > /sys/block/sr1/delete
    echo "- - -" > /sys/class/scsi_host/host7/scan
    

提交回复
热议问题