Subject: Re: FreeBSD's /dev on NetBSD
To: Hans Petter Selasky <hselasky@c2i.net>
From: Tonnerre <tonnerre@thundrix.ch>
List: tech-kern
Date: 08/14/2005 01:14:31
--E13BgyNx05feLLmH
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Salut,

On Sun, Aug 14, 2005 at 12:09:59AM +0200, Hans Petter Selasky wrote:
> > NetBSD's SMP kernel is under a big-lock, so this isn't a problem for
> > the time being.
>=20
> This almost sounds like the Giant lock on FreeBSD. But then, actually=20
> splnet/splx and simple_lock/simple_unlock does not have any effect at all?

It does, on multiprocessor systems.

> What happens on NetBSD if a process calls "tsleep()" while holding a=20
> simple_lock()? Is there any code to do extra checking like on FreeBSD ?

A simplelock doesn't affect splx levels.

> I've heard that NetBSD is very against mutexes. Is this true? Will NetBSD=
=20
> always use one lock for the whole kernel?

Mutexes are too heavy for a lot of things, that's why we have simplelocks.
However, sometimes you do need them, in which case they're ok. It's always
a decision between too low and too high lock contention - both of them may
severely harm your performance.

NetBSD is currently heading for eliminating the LOCK_KERNEL madness.

				Tonnerre

--E13BgyNx05feLLmH
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iD8DBQFC/n7XXUVlAbfmNMIRAsFdAJ9iCAcsy+hHdej4BbRGtv0TNT20EACeJBIf
i+ayUDiZ1CPZfVqBEyxkYck=
=P4qG
-----END PGP SIGNATURE-----

--E13BgyNx05feLLmH--