Skip to content

Commit

Permalink
[PATCH] remove unlikely() in might_sleep_if()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hua Zhong authored and Linus Torvalds committed Jun 23, 2006
1 parent 0216bfc commit 368a5fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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); \
Expand Down

0 comments on commit 368a5fa

Please sign in to comment.