Subject: Re: TTY locking
From: David Laight <firstname.lastname@example.org>
Date: 02/17/2003 10:23:41
On Mon, Feb 17, 2003 at 08:57:53AM +0100, Paul Kranenburg wrote:
> The TTY subsystem locking strategy has some issues left. One of them
> is that tputchar() can be called with or without the tty spin lock
> held: i.e.
> I put a simple_lock_try() in tputchar() to circumvent to problem, but
> that's not correct, and LOCKDEBUG catches it.
That code is just plain broken...
> Looking at the places from where ttyinfo() is called it seems Ok to just
> release the tty spin lock while the load and session stuff is printed,
> and then re-acquire it again before returning.
You need to convince yourself (and others) that ttyinfo() doesn't
neet the TTY_LOCK held. At the moment that isn't true .
(there is also the separate fact that is need the p_pglist list
locked - or better some stuff with reference counts...)
ATM the big_lock probably saves you.
 can you spot it?
David Laight: email@example.com