Subject: Re: kern/37181: kevent calls ltsleep() at splsched()
To: None <gnats-bugs@NetBSD.org>
From: Andrew Doran <ad@netbsd.org>
List: netbsd-bugs
Date: 10/23/2007 13:56:28
On Tue, Oct 23, 2007 at 08:05:17AM +0000, Martin Husemann wrote:

>  Side note: I'd suggest we define a KASSERTMAXIPL() macro (arch dependend,
>  or empty if not easy/not yet done) and sprinkle things like
>  
>      KASSERTMAXIPL(IPL_SCHED);
>  
>  (or in this case: KASSERTMAXIPL(IPL_SCHED+1), I guess)
>  
>  at a few strategic places.

I think it is better (for the generic case) to convert to use locks or to
make the code mulithreaded using other mechanisms. Then other assertions
become available to you, for example KASSERT(mutex_owned(&foo_lock)).

Simplyfing the SPL system will help greatly because it is poorly understood
and relies on a pack of fragile assumptions. Random example: printf() may be
called from network level interrupts, but IPL_TTY is not guaranteed to block
network interrupts. We have a lot of code that works purely out of luck but
lot of that has been fixed over the past year.

http://mail-index.netbsd.org/tech-kern/2007/05/05/0005.html

Andrew