Subject: Re: Pulling simple syscalls out from the giant lock
To: None <tech-kern@NetBSD.org>
From: Ignatios Souvatzis <is@netbsd.org>
List: tech-kern
Date: 06/07/2005 20:58:38
--DocE+STaALJfprDB
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Jun 07, 2005 at 10:45:58AM -0700, Matt Thomas wrote:
> David Laight wrote:
> >On Tue, Jun 07, 2005 at 10:38:20AM -0700, Matt Thomas wrote:
> >
> >>>Yes. The MD syscall code checks for the SYSCALL_MPSAFE flag and
> >>>doesn't take the big-lock if it's set. It's currently only set for
> >>>getpid(). Exactly what else it could be easily applied to is less
> >>>clear; getpid() is the only true no-brainer that requires taking no
> >>>locks on anything at all.
> >>
> >>get*gid?
> >>get*uid?
> >
> >
> >While another thread is doing set*[gu]id ?
>=20
> Unless your process is taking care to do mutexes to control
> ordering, the result you get back will be unpredictable (did
> the set* run before or after the get*).  So you can treat
> them as unlocked since the user code has to have some method
> of serialization to get a meaningful answer.

What you said. Assuming, of course, that the read operation itself
is atomic.

	-is
--=20
seal your e-mail: http://www.gnupg.org/

--DocE+STaALJfprDB
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iD8DBQFCpe5dN4tiz3B8hB0RAkPoAKC6rWOjaIcMUNlFwTb9oLGbMZqESgCg4wYv
T/YBXrFScAVdCtsh5U2heoI=
=8MEU
-----END PGP SIGNATURE-----

--DocE+STaALJfprDB--