Skip to contentSkip to conversation

hugetlbfs-support-split-page-table-lock.patch removed from -mm tree

to-be-updated [email protected] 1 participant 1 message Jun 4, 2013

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

Subject: [to-be-updated] hugetlbfs-support-split-page-table-lock.patch removed from -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Tue, 04 Jun 2013 13:33:32 -0700

The patch titled
Subject: hugetlbfs: support split page table lock
has been removed from the -mm tree. Its filename was
hugetlbfs-support-split-page-table-lock.patch

This patch was dropped because an updated version will be merged

------------------------------------------------------
From: Naoya Horiguchi <[email protected]>
Subject: hugetlbfs: support split page table lock

Currently all of page table handling by hugetlbfs code are done under mm->page_table_lock. This is not optimal because there can be lock contentions between unrelated components using this lock.

This patch makes hugepage support split page table lock so that we use page->ptl of the leaf node of page table tree which is pte for normal pages but can be pmd and/or pud for hugepages of some architectures.

Cc Rik van Riel <[email protected]>
Cc Mel Gorman <[email protected]>
Cc Andi Kleen <[email protected]>
Cc Michal Hocko <[email protected]>
Cc KOSAKI Motohiro <[email protected]>

---

 arch/x86/mm/hugetlbpage.c |    6 +-
 include/linux/hugetlb.h   |   18 +++++++
 mm/hugetlb.c              |   84 +++++++++++++++++++++---------------
 3 files changed, 73 insertions(+), 35 deletions(-)
arch/x86/mm/hugetlbpage.c renamed from arch/x86/mm/hugetlbpage.c~hugetlbfs-support-split-page-table-lock +4 -2
diff -puN arch/x86/mm/hugetlbpage.c~hugetlbfs-support-split-page-table-lock arch/x86/mm/hugetlbpage.c
@@ -75,6 +75,7 @@ huge_pmd_share(struct mm_struct *mm, uns
 	unsigned long saddr;
 	pte_t *spte = NULL;
 	pte_t *pte;
+	spinlock_t *ptl;
 
 	if (!vma_shareable(vma, addr))
 		return (pte_t *)pmd_alloc(mm, pud, addr);
@@ -89,6 +90,7 @@ huge_pmd_share(struct mm_struct *mm, uns
 			spte = huge_pte_offset(svma->vm_mm, saddr);
 			if (spte) {
 				get_page(virt_to_page(spte));
+				ptl = huge_pte_lockptr(mm, spte);
 				break;
 			}
 		}
@@ -97,12 +99,12 @@ huge_pmd_share(struct mm_struct *mm, uns
 	if (!spte)
 		goto out;
 
-	spin_lock(&mm->page_table_lock);
+	spin_lock(ptl);
 	if (pud_none(*pud))
 		pud_populate(mm, pud, (pmd_t *)((unsigned long)spte & PAGE_MASK));
 	else
 		put_page(virt_to_page(spte));
-	spin_unlock(&mm->page_table_lock);
+	spin_unlock(ptl);
 out:
 	pte = (pte_t *)pmd_alloc(mm, pud, addr);
 	mutex_unlock(&mapping->i_mmap_mutex);
include/linux/hugetlb.h renamed from include/linux/hugetlb.h~hugetlbfs-support-split-page-table-lock +18 -0
diff -puN include/linux/hugetlb.h~hugetlbfs-support-split-page-table-lock include/linux/hugetlb.h
@@ -32,6 +32,24 @@ void hugepage_put_subpool(struct hugepag
 
 int PageHuge(struct page *page);
 
+#if USE_SPLIT_PTLOCKS
+#define huge_pte_lockptr(mm, ptep) ({__pte_lockptr(virt_to_page(ptep)); })
+#else	/* !USE_SPLIT_PTLOCKS */
+#define huge_pte_lockptr(mm, ptep) ({&(mm)->page_table_lock; })
+#endif	/* USE_SPLIT_PTLOCKS */
+
+#define huge_pte_offset_lock(mm, address, ptlp)		\
+({							\
+	pte_t *__pte = huge_pte_offset(mm, address);	\
+	spinlock_t *__ptl = NULL;			\
+	if (__pte) {					\
+		__ptl = huge_pte_lockptr(mm, __pte);	\
+		*(ptlp) = __ptl;			\
+		spin_lock(__ptl);			\
+	}						\
+	__pte;						\
+})
+
 void reset_vma_resv_huge_pages(struct vm_area_struct *vma);
 int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *);
 int hugetlb_overcommit_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *);
mm/hugetlb.c renamed from mm/hugetlb.c~hugetlbfs-support-split-page-table-lock +51 -33

283 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are

migrate-add-migrate_entry_wait_huge.patch mm-memory-failurec-fix-memory-leak-in-successful-soft-offlining.patch