From: KAMEZAWA Hiroyuki Date: Fri, 25 Jul 2008 08:47:16 +0000 (-0700) Subject: memcg: add hints for branch X-Git-Tag: v2.6.27-rc1~373 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=b76734e5e34e1889ab9fc5f3756570b1129f0f50;p=linux-2.6-omap-h63xx.git memcg: add hints for branch Showing brach direction for obvious conditions. Signed-off-by: KAMEZAWA Hiroyuki Cc: Balbir Singh Cc: "Eric W. Biederman" Cc: Pavel Emelyanov Cc: Li Zefan Cc: Hugh Dickins Cc: YAMAMOTO Takashi Cc: Paul Menage Cc: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/memcontrol.c b/mm/memcontrol.c index f46b8615de6..04ded27f622 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);