Subject: Re: Bummer - NetBSD 2.1 panic - si_refs - update
To: Donald Lee <MacPPC2@caution.icompute.com>
From: Allen Briggs <briggs@netbsd.org>
List: port-macppc
Date: 01/31/2007 10:00:00
On Tue, Jan 30, 2007 at 11:37:25PM -0600, Donald Lee wrote:
> One, at the end of the file, where the "${si}" gets put back in the
> pool, the operation is protected by "splvm()/splx()" rather than
> the msr ops that are now sprinkled in the code. I thought the
> reason for the msrs was because the IPLs were unreliable. Why
> are they OK here?
The pool operations just need splvm protection because other pool
operations can not happen at higher IPL than IPL_VM. Note the
comments above the functions. The enqueue and dequeue operations
are what need to be interrupt-safe because they can be called at
pretty much any IPL and you don't want to get an interrupt in the
middle of the operation that might lead to a re-entry into that code.
> Two, it seems that this newer code does not provide for
> multiple CPUs in the code. I can see where if multiple CPUs got into
> the code, we'd have a mess. Is this covered elsewhere?
> (BTW - the MP issue does not matter to me. I only have one CPU)
Right now, I think the biglock model protects against that. In a
fully-reentrant MP system, we would need to hold a mutex on the
softintr structure for the enqueue/dequeue, and a different one
for access to the pool (probably encapsulated in the pool code).
-allen
--
Allen Briggs | http://www.ninthwonder.com/~briggs/ | briggs@ninthwonder.com