Commit 2c2f8449 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] access_ok is likely

From Manfred

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.
parent 98badc08
...@@ -80,7 +80,7 @@ extern struct movsl_mask { ...@@ -80,7 +80,7 @@ extern struct movsl_mask {
* checks that the pointer is in the user space range - after calling * checks that the pointer is in the user space range - after calling
* this function, memory access functions may still return -EFAULT. * 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() * verify_area: - Obsolete, use access_ok()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment