From: Nick Piggin Date: Wed, 22 Mar 2006 08:08:43 +0000 (-0800) Subject: [PATCH] mm: optimise page_count X-Git-Tag: v2.6.17-rc1~1129^2~42 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=617d2214ee06c209e5c375c280d50abace8058e1;p=~shefty%2Frdma-dev.git [PATCH] mm: optimise page_count Optimise page_count compound page test and make it consistent with similar functions. Signed-off-by: Nick Piggin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/mm.h b/include/linux/mm.h index 7d8c127daad..6aa016f1d3a 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -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); }