aboutsummaryrefslogtreecommitdiffstats
path: root/mm/huge_memory.c
diff options
context:
space:
mode:
authorDavid Rientjes <rientjes@google.com>2012-05-29 18:06:26 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-29 19:22:20 -0400
commit6f60b69d8cabbf7c0daf879cae4d09ac0776f4b4 (patch)
treeb9ee18ec2ca4be000197a8a3ebb1b8e9015dc599 /mm/huge_memory.c
parent096a7cf44712ab531101bb4689f75f7fcd9b9f18 (diff)
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 <rientjes@google.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Reviewed-by: Andrea Arcangeli <aarcange@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/huge_memory.c')
-rw-r--r--mm/huge_memory.c2
1 files changed, 2 insertions, 0 deletions
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,
973 spin_lock(&mm->page_table_lock); 973 spin_lock(&mm->page_table_lock);
974 put_page(page); 974 put_page(page);
975 if (unlikely(!pmd_same(*pmd, orig_pmd))) { 975 if (unlikely(!pmd_same(*pmd, orig_pmd))) {
976 spin_unlock(&mm->page_table_lock);
976 mem_cgroup_uncharge_page(new_page); 977 mem_cgroup_uncharge_page(new_page);
977 put_page(new_page); 978 put_page(new_page);
979 goto out;
978 } else { 980 } else {
979 pmd_t entry; 981 pmd_t entry;
980 VM_BUG_ON(!PageHead(page)); 982 VM_BUG_ON(!PageHead(page));