From 240a82e2203217fc5a04721ef5bede9786519fc3 Mon Sep 17 00:00:00 2001 From: David Rientjes Date: Thu, 3 May 2012 15:43:50 +1000 Subject: [PATCH] mm, thp: drop page_table_lock to uncharge memcg pages mm->page_table_lock is hotly contested for page fault tests and isn't necessary to do mem_cgroup_uncharge_page() in do_huge_pmd_wp_page(). Signed-off-by: David Rientjes Cc: KAMEZAWA Hiroyuki Cc: Andrea Arcangeli Cc: Johannes Weiner Signed-off-by: Andrew Morton --- mm/huge_memory.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index edfeb8cb23df..d0def42c121b 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -973,8 +973,10 @@ int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, spin_lock(&mm->page_table_lock); put_page(page); if (unlikely(!pmd_same(*pmd, orig_pmd))) { + spin_unlock(&mm->page_table_lock); mem_cgroup_uncharge_page(new_page); put_page(new_page); + goto out; } else { pmd_t entry; VM_BUG_ON(!PageHead(page)); -- 2.39.5