+ hugetlbfs-support-split-page-table-lock.patch added to -mm tree
Subsystems (4)
[email protected]
maintainerSubject: + hugetlbfs-support-split-page-table-lock.patch added to -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Fri, 31 May 2013 12:30:18 -0700
The patch titled
Subject: hugetlbfs: support split page table lock
has been added to the -mm tree. Its filename is
hugetlbfs-support-split-page-table-lock.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
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.
---
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
@@ -75,6 +75,7 @@ huge_pmd_share(struct mm_struct *mm, unsunsigned 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, unsif (!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
@@ -32,6 +32,24 @@ void hugepage_put_subpool(struct hugepagint 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
mm-memory-failurec-fix-memory-leak-in-successful-soft-offlining.patch hugetlbfs-support-split-page-table-lock.patch migrate-add-migrate_entry_wait_huge.patch