Messages in this thread Patch in this message |  | | | Date | Fri, 13 Apr 2007 08:00:46 +0200 | | From | Eric Dumazet <> | | Subject | Re: [PATCH 0/4] i386 - pte update optimizations |
Zachary Amsden a écrit :
>
> Yes. Even then, last time I clocked instructions, xchg was still slower
> than read / write, although I could be misremembering. And it's not
> totally clear that they will always be in cached state, however, and for
> SMP, we still want to drop the implicit lock in cases where the
> processor might not know they are cached exclusive, but we know there
> are no other racing users. And there are plenty of old processors out
> there to still make it worthwhile.
>
Is there one processor that benefit from this patch then ?
I couldnt get a win on my test machines, maybe they are not old enough ;)
umask() doesnt need xchg() atomic semantic. If several threads are using
umask() concurrently results are not guaranted anyway.
--- linux-2.6.21-rc6/kernel/sys.c
+++ linux-2.6.21-rc6-ed/kernel/sys.c
@@ -2138,8 +2138,10 @@ asmlinkage long sys_getrusage(int who, s
asmlinkage long sys_umask(int mask)
{
- mask = xchg(¤t->fs->umask, mask & S_IRWXUGO);
- return mask;
+ struct fs_struct *fs = current->fs;
+ int old = fs->umask;
+ fs->umask = mask & S_IRWXUGO;
+ return old;
}
asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3, |  |