summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorNick Piggin <nickpiggin@yahoo.com.au>2006-01-06 00:10:57 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 08:33:25 -0800
commit92be2e33b155ee76399f51f41fb061f850d02f08 (patch)
tree13397157257259eff83729e0286c9a94cfb5a966 /mm
parent77a8a78834561398fb4cb1480afa7b0e80b1dd53 (diff)
downloadlwn-92be2e33b155ee76399f51f41fb061f850d02f08.tar.gz
lwn-92be2e33b155ee76399f51f41fb061f850d02f08.zip
[PATCH] mm: microopt conditions
Micro optimise some conditionals where we don't need lazy evaluation. Signed-off-by: Nick Piggin <npiggin@suse.de> Cc: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/page_alloc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 6d513faf050b..b0647b515277 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -336,9 +336,9 @@ static inline void __free_pages_bulk (struct page *page,
static inline int free_pages_check(const char *function, struct page *page)
{
- if ( page_mapcount(page) ||
- page->mapping != NULL ||
- page_count(page) != 0 ||
+ if (unlikely(page_mapcount(page) |
+ (page->mapping != NULL) |
+ (page_count(page) != 0) |
(page->flags & (
1 << PG_lru |
1 << PG_private |
@@ -348,7 +348,7 @@ static inline int free_pages_check(const char *function, struct page *page)
1 << PG_slab |
1 << PG_swapcache |
1 << PG_writeback |
- 1 << PG_reserved )))
+ 1 << PG_reserved ))))
bad_page(function, page);
if (PageDirty(page))
__ClearPageDirty(page);
@@ -458,9 +458,9 @@ expand(struct zone *zone, struct page *page,
*/
static int prep_new_page(struct page *page, int order)
{
- if ( page_mapcount(page) ||
- page->mapping != NULL ||
- page_count(page) != 0 ||
+ if (unlikely(page_mapcount(page) |
+ (page->mapping != NULL) |
+ (page_count(page) != 0) |
(page->flags & (
1 << PG_lru |
1 << PG_private |
@@ -471,7 +471,7 @@ static int prep_new_page(struct page *page, int order)
1 << PG_slab |
1 << PG_swapcache |
1 << PG_writeback |
- 1 << PG_reserved )))
+ 1 << PG_reserved ))))
bad_page(__FUNCTION__, page);
/*