diff options
author | Joonsoo Kim <iamjoonsoo.kim@lge.com> | 2013-09-11 17:21:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-11 18:57:44 -0400 |
commit | 8312034f3604bc0339c40545c538116f4ddad152 (patch) | |
tree | e0f0033270c7f80a88218ea67e6d69120a78f2bb /mm | |
parent | 5944d0116c773319a48ea6812d1891aa6d0bbbbf (diff) |
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 <iamjoonsoo.kim@lge.com>
Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Aneesh Kumar <aneesh.kumar@linux.vnet.ibm.com>
Reviewed-by: Davidlohr Bueso <davidlohr@hp.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/hugetlb.c | 5 |
1 files changed, 3 insertions, 2 deletions
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: | |||
2647 | } | 2647 | } |
2648 | spin_unlock(&mm->page_table_lock); | 2648 | spin_unlock(&mm->page_table_lock); |
2649 | mmu_notifier_invalidate_range_end(mm, mmun_start, mmun_end); | 2649 | mmu_notifier_invalidate_range_end(mm, mmun_start, mmun_end); |
2650 | /* Caller expects lock to be held */ | ||
2651 | spin_lock(&mm->page_table_lock); | ||
2652 | page_cache_release(new_page); | 2650 | page_cache_release(new_page); |
2653 | page_cache_release(old_page); | 2651 | page_cache_release(old_page); |
2652 | |||
2653 | /* Caller expects lock to be held */ | ||
2654 | spin_lock(&mm->page_table_lock); | ||
2654 | return 0; | 2655 | return 0; |
2655 | } | 2656 | } |
2656 | 2657 | ||