[PATCH] mm: optimise page_count
authorNick Piggin <npiggin@suse.de>
Wed, 22 Mar 2006 08:08:43 +0000 (00:08 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 22 Mar 2006 15:54:02 +0000 (07:54 -0800)
Optimise page_count compound page test and make it consistent with similar
functions.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/mm.h

index 7d8c127..6aa016f 100644 (file)
@@ -311,7 +311,7 @@ extern void FASTCALL(__page_cache_release(struct page *));
 
 static inline int page_count(struct page *page)
 {
-       if (PageCompound(page))
+       if (unlikely(PageCompound(page)))
                page = (struct page *)page_private(page);
        return atomic_read(&page->_count);
 }