Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys



David Young <dyoung%pobox.com@localhost> wrote:
> > In fact, I am not convinced that such IPL tracking is very useful - we
> > have reduced amount of IPLs, which is much simpler model than we used to
> > have, and the problem you were recently debugging was miss-interpretation
> > of certain spin-mutex behaviour.
> 
> You have not described the bug itself, or the cause of the bug, but the
> cause of the difficulty in finding the cause of the bug. :-) And you're
> doing so with the benefit of hindsight.

Fair point, although I did not debug that problem. :) And developers were
point out early about usage of IPL_HIGH (actually, it is also pointed out
in spl(9) that for MI code it's rarely the case).  Another thing - current
TTY locking is something what is supposed to be revamped i.e. it should be
pushed down to lower layers.  So you were debugging an unusual case.

> The bug was a panic, "cpu_switchto: switching above IPL_SCHED (8)", that
> typically occurred in the tty code.  The reason was not clear until
> evidence provided by SPLDEBUG pointed to a shortcut/optimization of spin
> mutexes that made my new code interact with tty locking in unexpected
> ways.

The behaviour was discussed in original newlock2 thread, when mutex(9) was
designed.  It seems that this point did not get into the man page, though..
But the panic is there to catch such and similar bugs.

> SPLDEBUG is single-purpose.  It also has some bugs, which I am happy to
> describe.  But let's keep it until we come up with something better.

OK, I do not mind it as long as it's for debugging and isn't in sys/kern.
However, some discussion before merging it could have been useful. :)

-- 
Mindaugas


Home | Main Index | Thread Index | Old Index