提交 b76734e5 编写于 作者: K KAMEZAWA Hiroyuki 提交者: Linus Torvalds

memcg: add hints for branch

Showing brach direction for obvious conditions.
Signed-off-by: NKAMEZAWA 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: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 c9b0ed51
...@@ -550,7 +550,7 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm, ...@@ -550,7 +550,7 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm,
* The page_cgroup exists and * The page_cgroup exists and
* the page has already been accounted. * the page has already been accounted.
*/ */
if (pc) { if (unlikely(pc)) {
VM_BUG_ON(pc->page != page); VM_BUG_ON(pc->page != page);
VM_BUG_ON(!pc->mem_cgroup); VM_BUG_ON(!pc->mem_cgroup);
unlock_page_cgroup(page); unlock_page_cgroup(page);
...@@ -559,7 +559,7 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm, ...@@ -559,7 +559,7 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm,
unlock_page_cgroup(page); unlock_page_cgroup(page);
pc = kmem_cache_alloc(page_cgroup_cache, gfp_mask); pc = kmem_cache_alloc(page_cgroup_cache, gfp_mask);
if (pc == NULL) if (unlikely(pc == NULL))
goto err; goto err;
/* /*
...@@ -616,7 +616,7 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm, ...@@ -616,7 +616,7 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm,
pc->flags = PAGE_CGROUP_FLAG_ACTIVE; pc->flags = PAGE_CGROUP_FLAG_ACTIVE;
lock_page_cgroup(page); lock_page_cgroup(page);
if (page_get_page_cgroup(page)) { if (unlikely(page_get_page_cgroup(page))) {
unlock_page_cgroup(page); unlock_page_cgroup(page);
/* /*
* Another charge has been added to this page already. * Another charge has been added to this page already.
...@@ -690,7 +690,7 @@ __mem_cgroup_uncharge_common(struct page *page, enum charge_type ctype) ...@@ -690,7 +690,7 @@ __mem_cgroup_uncharge_common(struct page *page, enum charge_type ctype)
*/ */
lock_page_cgroup(page); lock_page_cgroup(page);
pc = page_get_page_cgroup(page); pc = page_get_page_cgroup(page);
if (!pc) if (unlikely(!pc))
goto unlock; goto unlock;
VM_BUG_ON(pc->page != page); VM_BUG_ON(pc->page != page);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册