浏览代码

[PATCH] mm: optimise page_count

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>
Nick Piggin 19 年之前
父节点
当前提交
617d2214ee
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      include/linux/mm.h

+ 1 - 1
include/linux/mm.h

@@ -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);
 }
 }