From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BC63C433E7 for ; Thu, 15 Oct 2020 10:58:15 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6FB24212CC for ; Thu, 15 Oct 2020 10:58:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="3bNLhTz6"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="ckJ3wyU5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6FB24212CC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=iwIQrCf6Q6oxCIAWQ/rb+ODYTWyUdyf24LfwVfFKbcs=; b=3bNLhTz6d/2qbUu5SkWbfRmku F05+uvDSBj7yrRPvZKcH1TXK1llIAxMxUso+GLiasUac3E0c4/EVRA+Zrh5G40orV8TNFZq0CMTng KDaexdHEJKHpGIpTm+8qOvAdZsmXAp8vNdHSxFjAQBLBcHo9LgQWpsglnux9jN6Smbq3Muq3trcHA 014vqifXhZW2FvWY+OznkMLAD5/YD5wehaKxhqoPnUFB/zbCPzVknXL8kwhhFC6m9L7jZnS7hptuB teeBQ5M2Gb9/QJ2pw2I1dg6ZIEot/1apG0P9heyuwUGjVjq5y4B5ykNz4hJUyNFFL2NsYtyOJxAwD a3Vk1kzYQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kT0vR-0006Gk-Ov; Thu, 15 Oct 2020 10:56:01 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kT0vM-0006Dt-Pf for linux-arm-kernel@lists.infradead.org; Thu, 15 Oct 2020 10:55:59 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3A66B22249; Thu, 15 Oct 2020 10:55:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602759355; bh=te9muqVH1TRG904u4JJ4FrQCvPp6MwdDgE/Yv30w3PU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ckJ3wyU5jbwGNq4/krnO1Iy1JWHTNJXBDCx/Edql4YEfgqOnqGc+7gvGYh77bhyG6 ZzO52I3qNsQ+7Ma4k76UevjKNz+Su710g/JPRn1RDafdL7bYn/BUxX+tX5YYYmcJWV 0h1zvbDXckgkqYAVWhf9Fo7QapayWowt7udV4KE0= Date: Thu, 15 Oct 2020 11:55:43 +0100 From: Will Deacon To: Kalesh Singh Subject: Re: [PATCH v4 2/5] arm64: mremap speedup - Enable HAVE_MOVE_PMD Message-ID: <20201015105542.GA5110@willie-the-truck> References: <20201014005320.2233162-1-kaleshsingh@google.com> <20201014005320.2233162-3-kaleshsingh@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201014005320.2233162-3-kaleshsingh@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201015_065557_644733_EDF4D3C5 X-CRM114-Status: GOOD ( 24.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: joelaf@google.com, Gavin Shan , Brian Geffon , Peter Zijlstra , Catalin Marinas , Ram Pai , Dave Hansen , lokeshgidra@google.com, linux-kselftest@vger.kernel.org, "H. Peter Anvin" , Christian Brauner , Shuah Khan , Mina Almasry , Jia He , Arnd Bergmann , "Aneesh Kumar K.V" , Masahiro Yamada , x86@kernel.org, Krzysztof Kozlowski , Steven Price , Jason Gunthorpe , Ingo Molnar , Sami Tolvanen , kernel-team@android.com, Hassan Naveed , Masami Hiramatsu , Ralph Campbell , Kees Cook , minchan@google.com, Anshuman Khandual , Sandipan Das , John Hubbard , Frederic Weisbecker , Mark Brown , Borislav Petkov , Josh Poimboeuf , Thomas Gleixner , surenb@google.com, linux-arm-kernel@lists.infradead.org, SeongJae Park , linux-mm@kvack.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Mike Rapoport , Andrew Morton , "Kirill A . Shutemov" , Mike Kravetz Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Oct 14, 2020 at 12:53:07AM +0000, Kalesh Singh wrote: > HAVE_MOVE_PMD enables remapping pages at the PMD level if both the > source and destination addresses are PMD-aligned. > > HAVE_MOVE_PMD is already enabled on x86. The original patch [1] that > introduced this config did not enable it on arm64 at the time because > of performance issues with flushing the TLB on every PMD move. These > issues have since been addressed in more recent releases with > improvements to the arm64 TLB invalidation and core mmu_gather code as > Will Deacon mentioned in [2]. > > From the data below, it can be inferred that there is approximately > 8x improvement in performance when HAVE_MOVE_PMD is enabled on arm64. > > --------- Test Results ---------- > > The following results were obtained on an arm64 device running a 5.4 > kernel, by remapping a PMD-aligned, 1GB sized region to a PMD-aligned > destination. The results from 10 iterations of the test are given below. > All times are in nanoseconds. > > Control HAVE_MOVE_PMD > > 9220833 1247761 > 9002552 1219896 > 9254115 1094792 > 8725885 1227760 > 9308646 1043698 > 9001667 1101771 > 8793385 1159896 > 8774636 1143594 > 9553125 1025833 > 9374010 1078125 > > 9100885.4 1134312.6 <-- Mean Time in nanoseconds > > Total mremap time for a 1GB sized PMD-aligned region drops from > ~9.1 milliseconds to ~1.1 milliseconds. (~8x speedup). > > [1] https://lore.kernel.org/r/20181108181201.88826-3-joelaf@google.com > [2] https://www.mail-archive.com/linuxppc-dev@lists.ozlabs.org/msg140837.html > > Signed-off-by: Kalesh Singh > Acked-by: Kirill A. Shutemov > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Andrew Morton > --- > Changes in v4: > - Add Kirill's Acked-by. Argh, I thought we already enabled this for PMDs back in 2018! Looks like that we forgot to actually do that after I improved the performance of the TLB invalidation. I'll pick this one patch up for 5.10. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel