[PATCH] remove unlikely() in might_sleep_if()
authorHua Zhong <hzhong@gmail.com>
Fri, 23 Jun 2006 09:05:42 +0000 (02:05 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 23 Jun 2006 14:43:06 +0000 (07:43 -0700)
The likely() profiling tools show that __alloc_page() causes a lot of misses:

!       132    119193 __alloc_pages():mm/page_alloc.c@937

Because most __alloc_page() calls are not atomic.

Signed-off-by: Hua Zhong <hzhong@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/kernel.h

index 25fccd859fbf311d1026aa6ff3a1e5c171cd85fd..8c21aaa248b4ee1917340283846c6bdc8651ed6c 100644 (file)
@@ -78,7 +78,7 @@ extern int cond_resched(void);
 # define might_sleep() do { might_resched(); } while (0)
 #endif
 
-#define might_sleep_if(cond) do { if (unlikely(cond)) might_sleep(); } while (0)
+#define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0)
 
 #define abs(x) ({                              \
                int __x = (x);                  \