Subject: Re: Pulling simple syscalls out from the giant lock
To: David Laight <david@l8s.co.uk>
From: Matt Thomas <matt@3am-software.com>
List: tech-kern
Date: 06/07/2005 10:45:58
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 ?
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.
--
Matt Thomas email: matt@3am-software.com
3am Software Foundry www: http://3am-software.com/bio/matt/
Cupertino, CA disclaimer: I avow all knowledge of this message.