summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>2008-07-25 01:47:16 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-25 10:53:37 -0700
commitb76734e5e34e1889ab9fc5f3756570b1129f0f50 (patch)
tree9929c25da8b9c29fcb0c5394023f66b7668cdfa1 /mm
parentc9b0ed51483cc2fc42bb801b6675c4231b0e4634 (diff)
downloadlinux-b76734e5e34e1889ab9fc5f3756570b1129f0f50.tar.gz
linux-b76734e5e34e1889ab9fc5f3756570b1129f0f50.tar.bz2
linux-b76734e5e34e1889ab9fc5f3756570b1129f0f50.zip
memcg: add hints for branch
Showing brach direction for obvious conditions. Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Balbir Singh <balbir@in.ibm.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Pavel Emelyanov <xemul@openvz.org> Cc: Li Zefan <lizf@cn.fujitsu.com> Cc: Hugh Dickins <hugh@veritas.com> Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Cc: Paul Menage <menage@google.com> Cc: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/memcontrol.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index f46b8615de6c..04ded27f6226 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -550,7 +550,7 @@ retry:
* The page_cgroup exists and
* the page has already been accounted.
*/
- if (pc) {
+ if (unlikely(pc)) {
VM_BUG_ON(pc->page != page);
VM_BUG_ON(!pc->mem_cgroup);
unlock_page_cgroup(page);
@@ -559,7 +559,7 @@ retry:
unlock_page_cgroup(page);
pc = kmem_cache_alloc(page_cgroup_cache, gfp_mask);
- if (pc == NULL)
+ if (unlikely(pc == NULL))
goto err;
/*
@@ -616,7 +616,7 @@ retry:
pc->flags = PAGE_CGROUP_FLAG_ACTIVE;
lock_page_cgroup(page);
- if (page_get_page_cgroup(page)) {
+ if (unlikely(page_get_page_cgroup(page))) {
unlock_page_cgroup(page);
/*
* Another charge has been added to this page already.
@@ -690,7 +690,7 @@ __mem_cgroup_uncharge_common(struct page *page, enum charge_type ctype)
*/
lock_page_cgroup(page);
pc = page_get_page_cgroup(page);
- if (!pc)
+ if (unlikely(!pc))
goto unlock;
VM_BUG_ON(pc->page != page);