ESN 43483-090226-351967-14


Document Name: TASK_KILLABLE
Document Description: TASK_KILLABLE

TASK_KILLABLE


2009/02/26

Who hasn't been frustrated by some device stuck in a hardware read or write? Maybe it's a tape drive? It's effectively dead, maybe because the person who wrote the driver is an idiot or maybe because the person who designed the hardware is more of an idiot, or more likely something has just gone tragically wrong and you are stuck. Literally stuck, because the process doing the reading or writing dove down into the driver and it's never coming back up for air. Never. Go ahead, send it a "kill -9" signal. The process will never see that, because it's way down at the bottom of the ocean waiting for something that apparently is never going to happen.

On Linux, you'd see the process state is "D for "Defunct"". OS X uses "U" for "uninterruptible". I don't know about you, but I think "U" makes more sense. After all, we have to suppose that it is at least possible that whatever trouble is going down, it might resolve itself. If a very large counter is ticking down, maybe if we wait long enough the driver will finish or give up? Yeah, right: we're going to power-cycle the box and hope the problem doesn't repeat.

Wouldn't it be nice if you could kill the stupid thing? Or tell the driver to give up with an ioctl? Well, don't get too excited, but somebody agrees and is working on just that.. Apparently it was Linus Torvald who actually suggested this back in 2002, and now it's actually there - well, somewhat anyway. The problem is that programmers need to use this and of course unless someone has kindly rewritten a driver for that purpose, it doesn't. This TASK_KILLABLE: New process state in Linux article from IBM describes its use in NFS.


Author: Anthony Lawrence - Contact Author
Publisher: Anthony Lawrence
Licensee Name: Anthony Lawrence
Reference URL: http://aplawrence.com/Linux/die_die_die.html
Copyright: All Rights Reserved
Registration Date: 2/26/2009 6:06:22 PM UTC
Views: 116




NUMLY.COM