PERFORCE change 120788 for review

Attilio Rao attilio at FreeBSD.org
Wed Jun 6 13:31:47 UTC 2007


Rui Paulo wrote:
> 
> If I'm not doing something wrong, I need to use spin locks on my
> interrupt handler, or else witness_checkorder will complain with
> "blockable sleep lock".
> 
> Note that I'm using FILTERs.

So you are doing this in the wrong way.
In order to use correctly filters, please note that the support for them 
is compile time choosen, so you need to wrapper all filter specific 
parts using INTR_FILTER compat macro.

You have so to provide an alternative way for !INTR_FILTERS kernel.
Respect to locking, the correct thing to do here is:
- blocking lock for ithreads
- spin lock for fast handlers
- spin lock when you need locking inside a filter (it means that you 
could end in the not ideal case to use a spin lock inside an ithread, in 
the case the filter decides the ithread needs to run and they need to be 
synchronized).

You would choose a fast handler/filter only handler when the work the 
handler needs to do is simple and doesn't require too much hardwork, 
otherwise you would need an ithread/filter + ithread.

In the latter case you can use a blocking lock (a mutex or a rwlock) if 
you just need syncronization of your softc inside the ithread, 
otherwise, as I previously mentioned, you need a spinlock too here.

Attilio


More information about the p4-projects mailing list