Subject: Re: Pulling simple syscalls out from the giant lock
To: Thor Lancelot Simon <tls@rek.tjls.com>
From: Tonnerre <tonnerre@thundrix.ch>
List: tech-kern
Date: 06/07/2005 19:59:15
--qjNfmADvan18RZcF
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Salut,

On Tue, Jun 07, 2005 at 01:41:23PM -0400, Thor Lancelot Simon 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.
>=20
> The vnode locks needed for getcwd() certainly _ought_ to be MP-safe,
> no?  What's the point of having them there if they aren't?
>=20
> The other one that comes immediately to mind, though, is gettimeofday().
> Oh, and getppid() and getrlimit(), maybe.

Well, gettimeofday() is so easy that in Linux it is done entirely in userla=
nd;
the kernel is mapping a shared page to some place, and every process that d=
oes
gettimeofday() reads the variable and returns, with no context switching
involved. This is very useful for processes like servers that try to implem=
ent
a real timeout (and thus sleep and use gettimeofday to find out how much ti=
me
has actually passed).

So I don't think locking is a problem here..

				Tonnerre

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

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

iD8DBQFCpeBzXUVlAbfmNMIRAjBGAJ9+608Osm1uUr5j5+Tlp1VK8YYbVACgtZ3+
0oDEXenmixneBYymSIU2XsM=
=COzd
-----END PGP SIGNATURE-----

--qjNfmADvan18RZcF--