While trying to figure out why sysv msg is around 30% slower than pipes for data transfers I noticed that gcc's autodetection (3.2.2) guesses the "if(access_ok())" tests in uaccess.h wrong and puts the error memset into the direct path and the copy out of line. So tell the compiler that access_ok() is likely to be true. include/asm-i386/uaccess.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN include/asm-i386/uaccess.h~access_ok-is-likely include/asm-i386/uaccess.h --- 25/include/asm-i386/uaccess.h~access_ok-is-likely 2003-09-14 13:14:26.000000000 -0700 +++ 25-akpm/include/asm-i386/uaccess.h 2003-09-14 13:14:26.000000000 -0700 @@ -80,7 +80,7 @@ extern struct movsl_mask { * checks that the pointer is in the user space range - after calling * this function, memory access functions may still return -EFAULT. */ -#define access_ok(type,addr,size) (__range_ok(addr,size) == 0) +#define access_ok(type,addr,size) (likely(__range_ok(addr,size) == 0)) /** * verify_area: - Obsolete, use access_ok() _