Subject: Re: Pulling simple syscalls out from the giant lock
To: Nathan J. Williams <nathanw@wasabisystems.com>
From: Thor Lancelot Simon <tls@rek.tjls.com>
List: tech-kern
Date: 06/07/2005 13:41:23
On Tue, Jun 07, 2005 at 01:30:53PM -0400, Nathan J. Williams wrote:
> Thor Lancelot Simon <tls@rek.tjls.com> writes:
>
> > To a cursory examination, it looks like it's possible that a number of
> > syscalls that touch only process state (particularly read-only ones
> > like getcwd, getpid, etc. but also some that change state, like
> > chdir, chroot, and a few others) could easily take subsystem locks
> > instead of the giant lock.
> >
> > Is this correct?
>
> 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.
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?
The other one that comes immediately to mind, though, is gettimeofday().
Oh, and getppid() and getrlimit(), maybe.
--
Thor Lancelot Simon tls@rek.tjls.com
"The inconsistency is startling, though admittedly, if consistency is to be
abandoned or transcended, there is no problem." - Noam Chomsky