Subject: Re: Interrupt, interrupt threads, continuations, and kernel lwps
To: Bucky Katz <bucky@picovex.com>
From: Bill Stouder-Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 06/18/2007 21:32:53
--JP+T4n/bALQSJXh8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Jun 18, 2007 at 02:36:25PM -0700, Bucky Katz wrote:
> Andrew Doran <ad@netbsd.org> writes:
>=20
> > On Fri, Jun 15, 2007 at 11:20:42PM +0200, Pavel Cahyna wrote:
> >
> >> What would this mean? Replacing splbio, splnet, etc. by
> >> spllow/splmid/splhigh?
> >
> > That's the plan. It depends on the platform but looks roughly like this:
> >
> > bio, net, tty, vm -> low
> > sched, clock, audio -> mid
> > statclock, serial, ipi -> high
> >
>=20
> Hi,
>=20
> Sorry I only came to this discussion just now, but I've been head down
> in a development effort.

No biggie.

> I have a conceptual problem with doing this, because you're destroying
> useful information.  On platform A, audio might be able to do with
> mid, but on platform B it might need high. Now, to change that, I
> merely need to change one definition in one place. Once you've erased
> all that information then in order to move to a new platform I have to
> go look at all the splmid calls to see if they should still be mid or
> not, and I've got to make changes all over the code that break
> platform independency at a source level unnecessarily.

I think the issue will be mid vs low. high is really only for things that=
=20
happen when the scheduler can be running.

The problem is that when we move interrupt handling code into common-path=
=20
areas (or more accurately as we get rid of biglock), we are implicitly=20
ordering locks. Changing an interrupt level may well mean changing lock=20
ordering.

Note also that with moving to mutexes, we set the spl level of a mutex at=
=20
mutex init. Then each time we use the mutex, the right thing happens. So=20
mutex grab/release turns into spl calls internally. Or at least that's my=
=20
understanding. I'm sure I'll hear if I'm wrong. ;-)

--JP+T4n/bALQSJXh8
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (NetBSD)

iD8DBQFGd1x1Wz+3JHUci9cRAsuYAKCR1I7igquzOnQScyUazBxCw+9T5gCfWxCR
vFae3DaXnAIHESiAnzjHunQ=
=Op5s
-----END PGP SIGNATURE-----

--JP+T4n/bALQSJXh8--