From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by kanga.kvack.org (Postfix) with ESMTP id F0E3F6B0336 for ; Sat, 27 Oct 2018 06:21:09 -0400 (EDT) Received: by mail-pg1-f198.google.com with SMTP id b7-v6so2141990pgt.10 for ; Sat, 27 Oct 2018 03:21:09 -0700 (PDT) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id k33-v6sor11249375pld.54.2018.10.27.03.21.08 for (Google Transport Security); Sat, 27 Oct 2018 03:21:08 -0700 (PDT) Date: Sat, 27 Oct 2018 21:21:02 +1100 From: Balbir Singh Subject: Re: [PATCH 2/4] mm: speed up mremap by 500x on large regions (v2) Message-ID: <20181027102102.GO8537@350D> References: <20181013013200.206928-1-joel@joelfernandes.org> <20181013013200.206928-3-joel@joelfernandes.org> <20181024101255.it4lptrjogalxbey@kshutemo-mobl1> <20181024115733.GN8537@350D> <20181025021350.GB13560@joelaf.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181025021350.GB13560@joelaf.mtv.corp.google.com> Sender: owner-linux-mm@kvack.org List-ID: To: Joel Fernandes Cc: "Kirill A. Shutemov" , linux-kernel@vger.kernel.org, kernel-team@android.com, minchan@kernel.org, pantin@google.com, hughd@google.com, lokeshgidra@google.com, dancol@google.com, mhocko@kernel.org, akpm@linux-foundation.org, Andrey Ryabinin , Andy Lutomirski , anton.ivanov@kot-begemot.co.uk, Borislav Petkov , Catalin Marinas , Chris Zankel , Dave Hansen , "David S. Miller" , elfring@users.sourceforge.net, Fenghua Yu , Geert Uytterhoeven , Guan Xuetao , Helge Deller , Ingo Molnar , "James E.J. Bottomley" , Jeff Dike , Jonas Bonn , Julia Lawall , kasan-dev@googlegroups.com, kvmarm@lists.cs.columbia.edu, Ley Foon Tan , linux-alpha@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@linux-mips.org, linux-mm@kvack.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-um@lists.infradead.org, linux-xtensa@linux-xtensa.org, Max Filippov , nios2-dev@lists.rocketboards.org, Peter Zijlstra , Richard Weinberger , Rich Felker , Sam Creasey , sparclinux@vger.kernel.org, Stafford Horne , Stefan Kristiansson , Thomas Gleixner , Tony Luck , Will Deacon , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Yoshinori Sato On Wed, Oct 24, 2018 at 07:13:50PM -0700, Joel Fernandes wrote: > On Wed, Oct 24, 2018 at 10:57:33PM +1100, Balbir Singh wrote: > [...] > > > > + pmd_t pmd; > > > > + > > > > + new_ptl = pmd_lockptr(mm, new_pmd); > > > > > > Looks like this is largely inspired by move_huge_pmd(), I guess a lot of > > the code applies, why not just reuse as much as possible? The same comments > > w.r.t mmap_sem helping protect against lock order issues applies as well. > > I thought about this and when I looked into it, it seemed there are subtle > differences that make such sharing not worth it (or not possible). > Could you elaborate on them? Thanks, Balbir Singh.