Re: Re: freeze_processes questions

Alan Stern
2005-04-06T21:03:03Z

[-- Attachment #1: Type: TEXT/PLAIN, Size: 928 bytes --]

On Wed, 6 Apr 2005, Rafael J. Wysocki wrote:

> > What happens if a process owns a lock needed to suspend a device and it is
> > waiting in TASK_UNINTERRUPTIBLE?
>
> Well, we're in trouble. :-)
>
> However, if any process that we have frozen owns such a lock, we're in trouble
> too. Thus it won't help if we forcibly freeze the uninterruptible process.
> Worse yet, there won't be any way to wake it up afterwards. OTOH, if we leave
> it in TASK_UNINTERRUPTIBLE, it may (potentially) be woken up by an interrupt
> handler (as you pointed out previously :-)) and release the lock.
>
> Frankly, I can't see any probable scenario leading to this kind of trouble.
> Seemingly, it would require someone to take a lock and (knowingly) do
> something that could end up in uninterruptible sleep, which IMHO is not
> a good idea.

It happens all the time in the USB core, when dealing with a
newly-connected device.

Alan Stern