Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751410AbbD3Nax (ORCPT ); Thu, 30 Apr 2015 09:30:53 -0400 Received: from mta-out1.inet.fi ([62.71.2.227]:51269 "EHLO kirsi1.inet.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750854AbbD3Naw (ORCPT ); Thu, 30 Apr 2015 09:30:52 -0400 Date: Thu, 30 Apr 2015 16:30:35 +0300 From: "Kirill A. Shutemov" To: "Aneesh Kumar K.V" Cc: akpm@linux-foundation.org, paulus@samba.org, benh@kernel.crashing.org, kirill.shutemov@linux.intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 1/3] mm/thp: Use pmdp_splitting_flush_notify to clear pmd on splitting Message-ID: <20150430133035.GF15874@node.dhcp.inet.fi> References: <1429823043-157133-1-git-send-email-kirill.shutemov@linux.intel.com> <1430382341-8316-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1430382341-8316-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1430382341-8316-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2996 Lines: 84 On Thu, Apr 30, 2015 at 01:55:39PM +0530, Aneesh Kumar K.V wrote: > Some arch may require an explicit IPI before a THP PMD split. This > ensures that a local_irq_disable can prevent a parallel THP PMD split. > So use new function which arch can override > > Signed-off-by: Aneesh Kumar K.V > --- > include/asm-generic/pgtable.h | 5 +++++ > mm/huge_memory.c | 7 ++++--- > mm/pgtable-generic.c | 11 +++++++++++ > 3 files changed, 20 insertions(+), 3 deletions(-) > > diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h > index fe617b7e4be6..d091a666f5b1 100644 > --- a/include/asm-generic/pgtable.h > +++ b/include/asm-generic/pgtable.h > @@ -184,6 +184,11 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm, > #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ > #endif > > +#ifndef __HAVE_ARCH_PMDP_SPLITTING_FLUSH_NOTIFY > +extern void pmdp_splitting_flush_notify(struct vm_area_struct *vma, > + unsigned long address, pmd_t *pmdp); > +#endif > + > #ifndef __HAVE_ARCH_PGTABLE_DEPOSIT > extern void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp, > pgtable_t pgtable); > diff --git a/mm/huge_memory.c b/mm/huge_memory.c > index cce4604c192f..81e9578bf43a 100644 > --- a/mm/huge_memory.c > +++ b/mm/huge_memory.c > @@ -2606,9 +2606,10 @@ static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd, > > write = pmd_write(*pmd); > young = pmd_young(*pmd); > - > - /* leave pmd empty until pte is filled */ > - pmdp_clear_flush_notify(vma, haddr, pmd); > + /* > + * leave pmd empty until pte is filled. > + */ > + pmdp_splitting_flush_notify(vma, haddr, pmd); > > pgtable = pgtable_trans_huge_withdraw(mm, pmd); > pmd_populate(mm, &_pmd, pgtable); > diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c > index 2fe699cedd4d..0fc1f5a06979 100644 > --- a/mm/pgtable-generic.c > +++ b/mm/pgtable-generic.c > @@ -7,6 +7,7 @@ > */ > > #include > +#include > #include > #include > > @@ -184,3 +185,13 @@ void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address, > } > #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ > #endif > + > +#ifndef __HAVE_ARCH_PMDP_SPLITTING_FLUSH_NOTIFY > +#ifdef CONFIG_TRANSPARENT_HUGEPAGE > +void pmdp_splitting_flush_notify(struct vm_area_struct *vma, > + unsigned long address, pmd_t *pmdp) > +{ > + pmdp_clear_flush_notify(vma, address, pmdp); > +} > +#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ > +#endif I think it worth inlining. Let's put it to It probably worth combining with collapse counterpart in the same patch. -- Kirill A. Shutemov -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/