Skip to contentSkip to conversation

kill task in TASK_UNINTERRUPTIBLE

DISCUSSION Amol Lad 10 participants 12 messages May 8, 2002 – May 10, 2002

lore
Share & tools
lore

Amol Lad

author
#0 lore raw

Hi,
Is there any way i can kill a task in
TASK_UNINTERRUPTIBLE state ?

please cc me

Thanks
Amol

__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

#1 lore raw
Quoted 3 lines · Amol Lad

Hi,
Is there any way i can kill a task in
TASK_UNINTERRUPTIBLE state ?

No. Everytime you see hung task in this state
you see kernel bug.

Somebody correct me if I am wrong.
--
vda

#2 lore raw
Quoted 9 lines · Denis Vlasenko
Quoted 3 lines · Amol Lad

Hi,
Is there any way i can kill a task in
TASK_UNINTERRUPTIBLE state ?

No. Everytime you see hung task in this state
you see kernel bug.

Somebody correct me if I am wrong.

Generally correct. Of course, what is "hung" ?

If it is just sitting in uninterruptible sleep, it could legitimately be waiting for an event. More than likely, however, after some sane period of time something is broken.

So, yah, it is a kernel bug.

I'll expand on your answer too - _why_ can't we kill it? Same argument we had over saving the futexes if a process bails. You hold a semaphore because you are entering a critical section. If you die in the middle, who knows the state the data is in and you do _not_ want to reenter it.

Robert Love

#3 lore raw
In reply to Denis Vlasenko
Quoted 4 lines
Quoted 1 line

TASK_UNINTERRUPTIBLE state ?

No. Everytime you see hung task in this state
you see kernel bug.

Or waiting on a resource that isnt available - that can occur for example with NFS for long periods, or for a few minutes when burning a CD and the IDE bus is locked

#4 lore raw
Quoted 3 lines · [email protected] said:

Or waiting on a resource that isnt available - that can occur for
example with NFS for long periods, or for a few minutes when burning a CD and the IDE bus is locked -

Often the main reason for sleeping in uninterruptible state during these periods is because the difficulty of performing a sane cleanup exceeds the boredom threshold of the programmer. There are plenty of places where TASK_UNINTERRUPTIBLE is used just because people have been lazy.

I'm guilty of it too - I use TASK_UNINTERRUPTIBLE for anything which can be called from jffs2_read_inode() because I was too lazy to chase through a mechanism by which ->read_inode() may return -ERESTARTSYS without creating a permanent bad inode. But we're working on it, and this should get fixed in 2.5.

--
dwmw2

#5 lore raw
In reply to Alan Cox
Quoted 8 lines · Alan Cox
Quoted 4 lines
Quoted 1 line

TASK_UNINTERRUPTIBLE state ?

No. Everytime you see hung task in this state
you see kernel bug.

Or waiting on a resource that isnt available - that can occur for example with NFS for long periods, or for a few minutes when burning a CD and the IDE bus is locked

I really prefer interruptible NFS mode (without timeout).

If CD burner needs to completely lock IDE, well, that is less than wonderful piece of hardware. I won't blame kernel for this.
--
vda

#6 lore raw
In reply to Amol Lad
Quoted 9 lines · Denis Vlasenko
Quoted 3 lines · Amol Lad

Hi,
Is there any way i can kill a task in
TASK_UNINTERRUPTIBLE state ?

No. Everytime you see hung task in this state
you see kernel bug.

Somebody correct me if I am wrong.

Except for processes accessing NFS files while the NFS server is down:
they will be stuck in TASK_UNINTERRUPTIBLE until the NFS server comes back up again.

Phil.

#7 lore raw
In reply to Amol Lad
Quoted 8 lines · Philippe Troin
Quoted 5 lines · Denis Vlasenko
Quoted 3 lines · Amol Lad

Hi,
Is there any way i can kill a task in
TASK_UNINTERRUPTIBLE state ?

Quoted 8 lines
Quoted 4 lines

No. Everytime you see hung task in this state
you see kernel bug.

Somebody correct me if I am wrong.

Except for processes accessing NFS files while the NFS server is down:
they will be stuck in TASK_UNINTERRUPTIBLE until the NFS server comes back up again.

A REALLY good argument for puting timeouts on your NSF mounts! Don't leave home without them.

-g

Signature · 4 lines
George Anzinger   [email protected]
High-res-timers:  http://sourceforge.net/projects/high-res-timers/
Real time sched:  http://sourceforge.net/projects/rtsched/
Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml
#8 lore raw

Hi,

Quoted 6 lines · george anzinger
Quoted 3 lines

Except for processes accessing NFS files while the NFS server is down:
they will be stuck in TASK_UNINTERRUPTIBLE until the NFS server comes back up again.

A REALLY good argument for puting timeouts on your NSF mounts! Don't leave home without them.

Use "mount -o intr" and you can kill the process.

bye, Roman

#9 lore raw
In reply to george anzinger
Quoted 8 lines · Roman Zippel
Quoted 6 lines
Quoted 3 lines

Except for processes accessing NFS files while the NFS server is down:
they will be stuck in TASK_UNINTERRUPTIBLE until the NFS server comes back up again.

A REALLY good argument for puting timeouts on your NSF mounts! Don't leave home without them.

Use "mount -o intr" and you can kill the process.

Could someone please explain to me how this works? IIRC NFS uses generic_file_read as most other filesystems. And whe WaitOnPage in there sleeps in uninterruptible state. I was told, that though it would be easy to change here, it's almost impossible in page-fault, because trying to handle a signal might trigger the very same page-fault again.

--------------------------------------------------------------------------------
- Jan Hudec `Bulb' <[email protected]>

#10 lore raw
In reply to Amol Lad
Quoted 6 lines · george anzinger
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

Is there any way i can kill a task in
TASK_UNINTERRUPTIBLE state ?

No. Everytime you see hung task in this state
you see kernel bug.
Somebody correct me if I am wrong.

Quoted 6 lines
Quoted 3 lines

Except for processes accessing NFS files while the NFS server is down:
they will be stuck in TASK_UNINTERRUPTIBLE until the NFS server comes back up again.

A REALLY good argument for puting timeouts on your NSF mounts! Don't leave home without them.

Timeouts may be a bad idea: imagine large (LARGE) database which you don't want to repair due to lost data over NFS. Better let it hang in NFS i/o even for hours while you are repairing your network.

OTOH, interruptible NFS mounts are ok: processes can be killed but with explicit admin action only, just what I need.

Anybody uses _uninterruptible_ NFS mounts? Enlighten me why. --
vda

#11 lore raw
In reply to Amol Lad
Quoted 12 lines · Denis Vlasenko
Quoted 10 lines · george anzinger
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

Is there any way i can kill a task in
TASK_UNINTERRUPTIBLE state ?

No. Everytime you see hung task in this state
you see kernel bug.
Somebody correct me if I am wrong.

Except for processes accessing NFS files while the NFS server is down:
they will be stuck in TASK_UNINTERRUPTIBLE until the NFS server comes back up again.

Quoted 7 lines
Quoted 2 lines

A REALLY good argument for puting timeouts on your NSF mounts! Don't leave home without them.

Timeouts may be a bad idea: imagine large (LARGE) database which you don't want to repair due to lost data over NFS. Better let it hang in NFS i/o even for hours while you are repairing your network.

I'm not sure using an NFS mount for a big important DB would be prudent in the first place. I dunno, maybe there are situations where it's unavoidable. I just really cringe when hearing about DB volumes over NFS.

-Andrew