diff options
author | Nick Piggin <nickpiggin@yahoo.com.au> | 2006-01-06 03:10:57 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 11:33:25 -0500 |
commit | 92be2e33b155ee76399f51f41fb061f850d02f08 (patch) | |
tree | 13397157257259eff83729e0286c9a94cfb5a966 /mm/page_alloc.c | |
parent | 77a8a78834561398fb4cb1480afa7b0e80b1dd53 (diff) |
[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/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 16 |
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, | |||
336 | 336 | ||
337 | static inline int free_pages_check(const char *function, struct page *page) | 337 | static inline int free_pages_check(const char *function, struct page *page) |
338 | { | 338 | { |
339 | if ( page_mapcount(page) || | 339 | if (unlikely(page_mapcount(page) | |
340 | page->mapping != NULL || | 340 | (page->mapping != NULL) | |
341 | page_count(page) != 0 || | 341 | (page_count(page) != 0) | |
342 | (page->flags & ( | 342 | (page->flags & ( |
343 | 1 << PG_lru | | 343 | 1 << PG_lru | |
344 | 1 << PG_private | | 344 | 1 << PG_private | |
@@ -348,7 +348,7 @@ static inline int free_pages_check(const char *function, struct page *page) | |||
348 | 1 << PG_slab | | 348 | 1 << PG_slab | |
349 | 1 << PG_swapcache | | 349 | 1 << PG_swapcache | |
350 | 1 << PG_writeback | | 350 | 1 << PG_writeback | |
351 | 1 << PG_reserved ))) | 351 | 1 << PG_reserved )))) |
352 | bad_page(function, page); | 352 | bad_page(function, page); |
353 | if (PageDirty(page)) | 353 | if (PageDirty(page)) |
354 | __ClearPageDirty(page); | 354 | __ClearPageDirty(page); |
@@ -458,9 +458,9 @@ expand(struct zone *zone, struct page *page, | |||
458 | */ | 458 | */ |
459 | static int prep_new_page(struct page *page, int order) | 459 | static int prep_new_page(struct page *page, int order) |
460 | { | 460 | { |
461 | if ( page_mapcount(page) || | 461 | if (unlikely(page_mapcount(page) | |
462 | page->mapping != NULL || | 462 | (page->mapping != NULL) | |
463 | page_count(page) != 0 || | 463 | (page_count(page) != 0) | |
464 | (page->flags & ( | 464 | (page->flags & ( |
465 | 1 << PG_lru | | 465 | 1 << PG_lru | |
466 | 1 << PG_private | | 466 | 1 << PG_private | |
@@ -471,7 +471,7 @@ static int prep_new_page(struct page *page, int order) | |||
471 | 1 << PG_slab | | 471 | 1 << PG_slab | |
472 | 1 << PG_swapcache | | 472 | 1 << PG_swapcache | |
473 | 1 << PG_writeback | | 473 | 1 << PG_writeback | |
474 | 1 << PG_reserved ))) | 474 | 1 << PG_reserved )))) |
475 | bad_page(__FUNCTION__, page); | 475 | bad_page(__FUNCTION__, page); |
476 | 476 | ||
477 | /* | 477 | /* |