From: David Rientjes Date: Tue, 29 May 2012 22:06:26 +0000 (-0700) Subject: mm, thp: drop page_table_lock to uncharge memcg pages X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6f60b69d8cabbf7c0daf879cae4d09ac0776f4b4;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git 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 Acked-by: Johannes Weiner Reviewed-by: Andrea Arcangeli Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/huge_memory.c b/mm/huge_memory.c index edfeb8cb23d..d0def42c121 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));