tech-kern archive

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

Re: blocking software interrupt thread & reentrancy



On Wed, Sep 22, 2010 at 01:42:04PM +0200, Manuel Bouyer wrote:
> Hello,
> I have a question about software interrupt threads (__HAVE_FAST_SOFTINTS
> case). I'm interrested in the mips implementation but I looked at x86
> and didn't find what I looked for either, so my question applies to
> both.
> 
> When a software interrupt is triggered, the CPU switches to
> the related kernel thread by changing the curlwp and stack pointers
> (softint_fast_dispatch() for mips, Xsoftintr(),for x86).
> This is triggered by a bit set in a bitmask by softint_trigger().
> For both mips and x86, this bit is cleared from the bitmask
> before invoking softint_fast_dispatch or Xsoftintr.
> 
> Now, if the softint thread blocks (this is allowed), another thread will
> get scheduled and the IPL will go back to IPL_NONE. I can't see what prevents
> another soft interrupt to be requested and the softint thread that
> is blocking from being switched to again, overwriting the blocking context.

I finally found it: it's the si_active flag, used by MI code.

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index