Skip to contentSkip to conversation

mm/hugetlb.c: use huge_pte_lock instead of opencoding the lock

PATCH New [email protected] 1 participant 1 message Dec 13, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 28/123 mm/hugetlb.c: use huge_pte_lock instead of opencoding the lock

From: "Aneesh Kumar K.V" <[email protected]>
Subject: mm/hugetlb.c: use huge_pte_lock instead of opencoding the lock

No functional change by this patch.

---

 mm/hugetlb.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
mm/hugetlb.c renamed from mm/hugetlb.c~mm-hugetlb-use-huge_pte_lock-instead-of-opencoding-the-lock +2 -4
diff -puN mm/hugetlb.c~mm-hugetlb-use-huge_pte_lock-instead-of-opencoding-the-lock mm/hugetlb.c
@@ -3713,8 +3713,7 @@ retry:
 		vma_end_reservation(h, vma, address);
 	}
 
-	ptl = huge_pte_lockptr(h, mm, ptep);
-	spin_lock(ptl);
+	ptl = huge_pte_lock(h, mm, ptep);
 	size = i_size_read(mapping->host) >> huge_page_shift(h);
 	if (idx >= size)
 		goto backout;
@@ -4332,8 +4331,7 @@ pte_t *huge_pmd_share(struct mm_struct *
 	if (!spte)
 		goto out;
 
-	ptl = huge_pte_lockptr(hstate_vma(vma), mm, spte);
-	spin_lock(ptl);
+	ptl = huge_pte_lock(hstate_vma(vma), mm, spte);
 	if (pud_none(*pud)) {
 		pud_populate(mm, pud,
 				(pmd_t *)((unsigned long)spte & PAGE_MASK));

_