Commit 617d2214 authored by Nick Piggin's avatar Nick Piggin Committed by Linus Torvalds

[PATCH] mm: optimise page_count

Optimise page_count compound page test and make it consistent with similar
functions.
Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b7ab795b
...@@ -311,7 +311,7 @@ extern void FASTCALL(__page_cache_release(struct page *)); ...@@ -311,7 +311,7 @@ extern void FASTCALL(__page_cache_release(struct page *));
static inline int page_count(struct page *page) static inline int page_count(struct page *page)
{ {
if (PageCompound(page)) if (unlikely(PageCompound(page)))
page = (struct page *)page_private(page); page = (struct page *)page_private(page);
return atomic_read(&page->_count); return atomic_read(&page->_count);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment