From: Joonsoo Kim Date: Wed, 11 Sep 2013 21:21:57 +0000 (-0700) Subject: mm, hugetlb: grab a page_table_lock after page_cache_release X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8312034f3604bc0339c40545c538116f4ddad152;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git mm, hugetlb: grab a page_table_lock after page_cache_release We don't need to grab a page_table_lock when we try to release a page. So, defer to grab a page_table_lock. Signed-off-by: Joonsoo Kim Reviewed-by: Naoya Horiguchi Cc: Aneesh Kumar Reviewed-by: Davidlohr Bueso Cc: David Gibson Cc: Wanpeng Li Cc: Hillf Danton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/hugetlb.c b/mm/hugetlb.c index f6347ec4fd0a..5bf6468a8862 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2647,10 +2647,11 @@ retry_avoidcopy: } spin_unlock(&mm->page_table_lock); mmu_notifier_invalidate_range_end(mm, mmun_start, mmun_end); - /* Caller expects lock to be held */ - spin_lock(&mm->page_table_lock); page_cache_release(new_page); page_cache_release(old_page); + + /* Caller expects lock to be held */ + spin_lock(&mm->page_table_lock); return 0; }