Re: [PATCH 0/4] i386 - pte update optimizations

Eric Dumazet
2007-04-13T06:02:09Z

[-- Attachment #1: Type: text/plain, Size: 771 bytes --]

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.

[-- Attachment #2: umask.patch --]
[-- Type: text/plain, Size: 441 bytes --]

--- 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(&current->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,