소스 검색

[PATCH] remove unlikely() in might_sleep_if()

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>
Hua Zhong 19 년 전
부모
커밋
368a5fa1f2
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      include/linux/kernel.h

+ 1 - 1
include/linux/kernel.h

@@ -78,7 +78,7 @@ extern int cond_resched(void);
 # define might_sleep() do { might_resched(); } while (0)
 # define might_sleep() do { might_resched(); } while (0)
 #endif
 #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) ({				\
 #define abs(x) ({				\
 		int __x = (x);			\
 		int __x = (x);			\