From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by kanga.kvack.org (Postfix) with ESMTP id 1E5826B027F for ; Fri, 12 Oct 2018 14:02:27 -0400 (EDT) Received: by mail-wr1-f69.google.com with SMTP id d29-v6so8435436wrc.3 for ; Fri, 12 Oct 2018 11:02:27 -0700 (PDT) Received: from shards.monkeyblade.net (shards.monkeyblade.net. [2620:137:e000::1:9]) by mx.google.com with ESMTPS id 138-v6si1752466wmn.177.2018.10.12.11.02.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Oct 2018 11:02:25 -0700 (PDT) Date: Fri, 12 Oct 2018 11:02:20 -0700 (PDT) Message-Id: <20181012.110220.321284613911888246.davem@davemloft.net> Subject: Re: [PATCH v2 2/2] mm: speed up mremap by 500x on large regions From: David Miller In-Reply-To: <20181012113056.gxhcbrqyu7k7xnyv@kshutemo-mobl1> References: <20181012013756.11285-1-joel@joelfernandes.org> <20181012013756.11285-2-joel@joelfernandes.org> <20181012113056.gxhcbrqyu7k7xnyv@kshutemo-mobl1> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: kirill@shutemov.name Cc: joel@joelfernandes.org, 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, aryabinin@virtuozzo.com, luto@kernel.org, bp@alien8.de, catalin.marinas@arm.com, chris@zankel.net, dave.hansen@linux.intel.com, elfring@users.sourceforge.net, fenghua.yu@intel.com, geert@linux-m68k.org, gxt@pku.edu.cn, deller@gmx.de, mingo@redhat.com, jejb@parisc-linux.org, jdike@addtoit.com, jonas@southpole.se, Julia.Lawall@lip6.fr, kasan-dev@googlegroups.com, kvmarm@lists.cs.columbia.edu, lftan@altera.com, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.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, jcmvbkbc@gmail.com, nios2-dev@lists.rocketboards.org, openrisc@lists.librecores.org, peterz@infradead.org, richard@nod.at From: "Kirill A. Shutemov" Date: Fri, 12 Oct 2018 14:30:56 +0300 > I looked into the code more and noticed move_pte() helper called from > move_ptes(). It changes PTE entry to suite new address. > > It is only defined in non-trivial way on Sparc. I don't know much about > Sparc and it's hard for me to say if the optimization will break anything > there. > > I think it worth to disable the optimization if __HAVE_ARCH_MOVE_PTE is > defined. Or make architectures state explicitely that the optimization is > safe. What sparc is doing in move_pte() is flushing the data-cache (synchronously) if the virtual address color of the mapping changes. Hope this helps.