Re: sleep under spinlock, sequencer.c, 2.6.12.5

Alan Cox
2005-08-19T23:39:35Z

On Gwe, 2005-08-19 at 10:13 +0200, Peter T. Breuer wrote:
> The following "sleep under spinlock" is still present as of linux
> 2.6.12.5 in sound/oss/sequencer.c in midi_outc:
>
>
> n = 3 * HZ; /* Timeout */
>
> spin_lock_irqsave(&lock,flags);
> while (n && !midi_devs[dev]->outputc(dev, data)) {
> interruptible_sleep_on_timeout(&seq_sleeper, HZ/25);
> n--;
> }
> spin_unlock_irqrestore(&lock,flags);
>
>
> I haven't thought about it, just noted it. It's been there forever
> (some others in the sound architecture have been gradually disappearing
> as newer kernels come out).

Yep thats a blind substition of lock_kernel in an old tree it seems.
Probably my fault. Should drop it before the sleep and take it straight
after.