aboutsummaryrefslogtreecommitdiffstats
path: root/mm/hugetlb.c
diff options
context:
space:
mode:
authorMichal Hocko <mhocko@suse.cz>2012-01-10 18:07:21 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 19:30:42 -0500
commitef009b25f4f8a77d2b32067d424d5ac757dcdc5b (patch)
tree4972dac6ca66279277da1b328d9f6d32bcf08dd0 /mm/hugetlb.c
parenta734bcc812146cfba530e1adaf609fce1357982e (diff)
hugetlb: clarify hugetlb_instantiation_mutex usage
Let's make it clear that we cannot race with other fault handlers due to hugetlb (global) mutex. Also make it clear that we want to keep pte_same checks anayway to have a transition from the global mutex easier. Signed-off-by: Michal Hocko <mhocko@suse.cz> Cc: Hillf Danton <dhillf@gmail.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Johannes Weiner <jweiner@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r--mm/hugetlb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 2c551b28ba69..49e693b7fd0c 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2349,6 +2349,9 @@ static int unmap_ref_private(struct mm_struct *mm, struct vm_area_struct *vma,
2349 2349
2350/* 2350/*
2351 * Hugetlb_cow() should be called with page lock of the original hugepage held. 2351 * Hugetlb_cow() should be called with page lock of the original hugepage held.
2352 * Called with hugetlb_instantiation_mutex held and pte_page locked so we
2353 * cannot race with other handlers or page migration.
2354 * Keep the pte_same checks anyway to make transition from the mutex easier.
2352 */ 2355 */
2353static int hugetlb_cow(struct mm_struct *mm, struct vm_area_struct *vma, 2356static int hugetlb_cow(struct mm_struct *mm, struct vm_area_struct *vma,
2354 unsigned long address, pte_t *ptep, pte_t pte, 2357 unsigned long address, pte_t *ptep, pte_t pte,