From mboxrd@z Thu Jan 1 00:00:00 1970 From: William Kucharski Subject: Re: [PATCH -next 0/3] Add support for fast mremap Date: Sun, 4 Nov 2018 00:56:48 -0600 Message-ID: References: <20181103040041.7085-1-joelaf@google.com> <6886607.O3ZT5bM3Cy@blindfold> <20181103183208.GA56850@google.com> Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20181103183208.GA56850@google.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+gla-linux-snps-arc=m.gmane.org@lists.infradead.org To: Joel Fernandes Cc: linux-mips@linux-mips.org, linux-m68k@vger.kernel.org, Rich Felker , linux-sh@vger.kernel.org, Peter Zijlstra , Catalin Marinas , Dave Hansen , Will Deacon , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Michal Hocko , linux-mm@kvack.org, lokeshgidra@google.com, sparclinux@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-riscv@lists.infradead.org, elfring@users.sourceforge.net, Jonas Bonn , kvmarm@lists.cs.columbia.edu, dancol@google.com, linux-ia64@vge.kvack.org, Yoshinori Sato , linux-xtensa@linux-xtensa.org, Richard Weinberger , Helge Deller , r.kernel.org@lithops.sigma-star.at, hughd@google.com, "James E.J. Bottomley" List-Id: linux-m68k@vger.kernel.org > On Nov 3, 2018, at 12:32 PM, Joel Fernandes wrote: > > Looks like more architectures don't define set_pmd_at. I am thinking the > easiest way forward is to just do the following, instead of defining > set_pmd_at for every architecture that doesn't care about it. Thoughts? > > diff --git a/mm/mremap.c b/mm/mremap.c > index 7cf6b0943090..31ad64dcdae6 100644 > --- a/mm/mremap.c > +++ b/mm/mremap.c > @@ -281,7 +281,8 @@ unsigned long move_page_tables(struct vm_area_struct *vma, > split_huge_pmd(vma, old_pmd, old_addr); > if (pmd_trans_unstable(old_pmd)) > continue; > - } else if (extent == PMD_SIZE && IS_ENABLED(CONFIG_HAVE_MOVE_PMD)) { > + } else if (extent == PMD_SIZE) { > +#ifdef CONFIG_HAVE_MOVE_PMD > /* > * If the extent is PMD-sized, try to speed the move by > * moving at the PMD level if possible. > @@ -296,6 +297,7 @@ unsigned long move_page_tables(struct vm_area_struct *vma, > drop_rmap_locks(vma); > if (moved) > continue; > +#endif > } > > if (pte_alloc(new_vma->vm_mm, new_pmd)) > That seems reasonable as there are going to be a lot of architectures that never have mappings at the PMD level. Have you thought about what might be needed to extend this paradigm to be able to perform remaps at the PUD level, given many architectures already support PUD-mapped pages? William Kucharski