All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 1/3] powerpc/mm: update pmdp_invalidate to return old pmd value
@ 2017-07-27  8:37 ` Aneesh Kumar K.V
  0 siblings, 0 replies; 26+ messages in thread
From: Aneesh Kumar K.V @ 2017-07-27  8:37 UTC (permalink / raw)
  To: benh, paulus, mpe, Kirill A . Shutemov
  Cc: linuxppc-dev, linux-mm, Aneesh Kumar K.V

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
 arch/powerpc/include/asm/book3s/64/pgtable.h | 4 ++--
 arch/powerpc/mm/pgtable-book3s64.c           | 9 ++++++---
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h
index 41d484ac0822..ece6912fae8e 100644
--- a/arch/powerpc/include/asm/book3s/64/pgtable.h
+++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
@@ -1119,8 +1119,8 @@ static inline pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm,
 }
 
 #define __HAVE_ARCH_PMDP_INVALIDATE
-extern void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address,
-			    pmd_t *pmdp);
+extern pmd_t pmdp_invalidate(struct vm_area_struct *vma, unsigned long address,
+			     pmd_t *pmdp);
 
 #define __HAVE_ARCH_PMDP_HUGE_SPLIT_PREPARE
 static inline void pmdp_huge_split_prepare(struct vm_area_struct *vma,
diff --git a/arch/powerpc/mm/pgtable-book3s64.c b/arch/powerpc/mm/pgtable-book3s64.c
index 3b65917785a5..0bb7f824ecdd 100644
--- a/arch/powerpc/mm/pgtable-book3s64.c
+++ b/arch/powerpc/mm/pgtable-book3s64.c
@@ -90,16 +90,19 @@ void serialize_against_pte_lookup(struct mm_struct *mm)
  * We use this to invalidate a pmdp entry before switching from a
  * hugepte to regular pmd entry.
  */
-void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address,
-		     pmd_t *pmdp)
+pmd_t pmdp_invalidate(struct vm_area_struct *vma, unsigned long address,
+		      pmd_t *pmdp)
 {
-	pmd_hugepage_update(vma->vm_mm, address, pmdp, _PAGE_PRESENT, 0);
+	unsigned long old_pmd;
+
+	old_pmd = pmd_hugepage_update(vma->vm_mm, address, pmdp, _PAGE_PRESENT, 0);
 	flush_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
 	/*
 	 * This ensures that generic code that rely on IRQ disabling
 	 * to prevent a parallel THP split work as expected.
 	 */
 	serialize_against_pte_lookup(vma->vm_mm);
+	return __pmd(old_pmd);
 }
 
 static pmd_t pmd_set_protbits(pmd_t pmd, pgprot_t pgprot)
-- 
2.13.3

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2017-07-28  7:04 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-27  8:37 [RFC PATCH 1/3] powerpc/mm: update pmdp_invalidate to return old pmd value Aneesh Kumar K.V
2017-07-27  8:37 ` Aneesh Kumar K.V
2017-07-27  8:37 ` [RFC PATCH 2/3] powerpc/mm: Implement pmdp_establish for ppc64 Aneesh Kumar K.V
2017-07-27  8:37   ` Aneesh Kumar K.V
2017-07-27 12:56   ` Michal Hocko
2017-07-27 12:56     ` Michal Hocko
2017-07-27 15:52     ` Aneesh Kumar K.V
2017-07-27 15:52       ` Aneesh Kumar K.V
2017-07-27  8:37 ` [RFC PATCH 3/3] mm/hugetlb: Remove pmd_huge_split_prepare Aneesh Kumar K.V
2017-07-27  8:37   ` Aneesh Kumar K.V
2017-07-27 10:50   ` Aneesh Kumar K.V
2017-07-27 10:50     ` Aneesh Kumar K.V
2017-07-27 12:57   ` Michal Hocko
2017-07-27 12:57     ` Michal Hocko
2017-07-27 15:57     ` Aneesh Kumar K.V
2017-07-27 15:57       ` Aneesh Kumar K.V
2017-07-28  7:04       ` Michal Hocko
2017-07-28  7:04         ` Michal Hocko
2017-07-27 12:54 ` [RFC PATCH 1/3] powerpc/mm: update pmdp_invalidate to return old pmd value Michal Hocko
2017-07-27 12:54   ` Michal Hocko
2017-07-27 12:58   ` Kirill A. Shutemov
2017-07-27 12:58     ` Kirill A. Shutemov
2017-07-27 15:48   ` Aneesh Kumar K.V
2017-07-27 15:48     ` Aneesh Kumar K.V
2017-07-28  7:01     ` Michal Hocko
2017-07-28  7:01       ` Michal Hocko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.