Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp36831pxk; Wed, 30 Sep 2020 17:06:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkiGA9FmaBW6gYrCwn1vTjn2hpygcZ/6sew8Yy4Yyze2369GNVuoht49vtwuJVIpw5Auj8 X-Received: by 2002:a17:906:e08f:: with SMTP id gh15mr5268623ejb.443.1601510784155; Wed, 30 Sep 2020 17:06:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601510784; cv=none; d=google.com; s=arc-20160816; b=mIO6mWVjXFV5Ae8mp3d77pXJTgEd27rpZAGHOsU2wXoArT6LDYKiEj37ilOpPtMbZP ZKMkGgiRrP0UWikLhLx+qkj68+aGcnz3w7QWSg4c/qlYruew10MxCDsdJa/dnN35+cIJ Umf4XViXMtvV4dbm2AETGEnoqGN2xfVgSzFE9qHeW8iv0eqRKMF6dmabId7fA1ZCYF7x n68kS/xjZNSbXybdh4AeeKoCLIhctl0OlVxkF6Tt7qzdAXAbOBrgj4rhRdLEF1QVyLxf RX9uGXggMaGy27XaB1i4m5jWZ1901WuE7bH2HNqgCtUbVwM+VPk5l0kpTHMJ5zUrCwxN mWIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:cc:from:subject:references:mime-version :message-id:in-reply-to:date:sender:dkim-signature; bh=Mra73tAqzotShWNgSXv1vhLyePg3f0HjrcFvwMDeq9o=; b=MgXu0oO2UlMVKChdZ+vvFsSer63RW6taH0oE/AFnvyPP8m4UWoPktLVk3/lMm29yUR le+h2PrG8GxncKMH4JT6/aIcNk9rEjh41jSkTABME8AzsaIPAonH6OXnmFoUeN5mn81C 9HVAx/BHuBMfy4f29jB4kZPFSsnuCKtMXZk+McHCRqCQVs13zEhP/pP4N+P8rRzT1TMY AU1HgRdw99cKSAD9cw8+KD0G3IjXGR+3m2rrZCdm5lB4FU7Cwnsru+7ui4KyClRQqmGf XFLY+oJPFvpt4t8QokaSPLQ+b/6WkncNcZtJzGg2d4sKGiqE5v9oM7hoRuV1FtkGYEzF rQoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=jDIKOMNU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ce7si2304429ejb.249.2020.09.30.17.05.47; Wed, 30 Sep 2020 17:06:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=jDIKOMNU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731561AbgI3WW3 (ORCPT + 99 others); Wed, 30 Sep 2020 18:22:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731322AbgI3WW2 (ORCPT ); Wed, 30 Sep 2020 18:22:28 -0400 Received: from mail-qv1-xf4a.google.com (mail-qv1-xf4a.google.com [IPv6:2607:f8b0:4864:20::f4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B154EC061755 for ; Wed, 30 Sep 2020 15:22:28 -0700 (PDT) Received: by mail-qv1-xf4a.google.com with SMTP id bo17so1902865qvb.2 for ; Wed, 30 Sep 2020 15:22:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:cc; bh=Mra73tAqzotShWNgSXv1vhLyePg3f0HjrcFvwMDeq9o=; b=jDIKOMNUrsBzgzsboYR6brg4WOYp4kCRZqrCWAvAZbpkekxYpp5uwWu1VMa3jBM1D4 qePDAkhwPaS7ozmJhvpiPn8rqjAEru5rJyPx6RWU/8Ay/7inrR7CHVJ77p9zaJZ1IwI9 Dy5ixhsQoV7e7t6GjskB9KRoGi6vhUEOJIOmUECHIHMNA/6dx0Mfp5sk/qPevZgAIWJD dSDgUoz8vPO96wn0mRJrwb6JU+kn6sz1n4gmMp04q1wpnavCaWjLkLkQER3ZYnT7jxHz JbrMiGc+vRmaiWx7InwR9v7+c9MnvzgX9b4pL1qHoSDq+DWQYdeR0dkqLDkbjTEQELIk LT7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:cc; bh=Mra73tAqzotShWNgSXv1vhLyePg3f0HjrcFvwMDeq9o=; b=ukcJR1XKh+8eVGFgXHzuOosv7FIHHxrxBmDW5rQOm0NX+He/A5jL1LUFXfefEbGcF/ wxb7MLfnlUt67J0DYfEjG/8FhnGRULRg0CI0Nm8ewx0rGamLLGvvGmcMqtxEwIlGwHoo 1zrIBvg3Eqv9ti+NJ5/OUFfUj0WqyZSDT4pO/y1AKHWvH6mETH84ZGO3vhPG50Sx9H4i LIGUDlEt5rd35dKbpoixZpq93zO6g818GJ4E7dcDPHOYhLfR4NkFvECwGU4LL0+yFyZl K4ygrK6XWLmegGSiqhhlLuggyPIWJ5r/1AXuqsnb24M684lZhBrisDTULYGT+WSzpJ+/ OWyg== X-Gm-Message-State: AOAM533/7kzUw3I/g1ot2tW44GhuWy9xHtde2pImUMWRvluSRj4NPal9 by1+1kWt/j+TJL+9ezzhUwAx7SwkuS/hOqHCCg== Sender: "kaleshsingh via sendgmr" X-Received: from kaleshsingh.c.googlers.com ([fda3:e722:ac3:10:14:4d90:c0a8:2145]) (user=kaleshsingh job=sendgmr) by 2002:a0c:b39a:: with SMTP id t26mr4865208qve.19.1601504547782; Wed, 30 Sep 2020 15:22:27 -0700 (PDT) Date: Wed, 30 Sep 2020 22:21:22 +0000 In-Reply-To: <20200930222130.4175584-1-kaleshsingh@google.com> Message-Id: <20200930222130.4175584-6-kaleshsingh@google.com> Mime-Version: 1.0 References: <20200930222130.4175584-1-kaleshsingh@google.com> X-Mailer: git-send-email 2.28.0.709.gb0816b6eb0-goog Subject: [PATCH 5/5] x86: mremap speedup - Enable HAVE_MOVE_PUD From: Kalesh Singh Cc: surenb@google.com, minchan@google.com, joelaf@google.com, lokeshgidra@google.com, kaleshsingh@google.com, kernel-team@android.com, Catalin Marinas , Will Deacon , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Andrew Morton , Shuah Khan , Kees Cook , "Aneesh Kumar K.V" , Peter Zijlstra , Sami Tolvanen , Arnd Bergmann , Masahiro Yamada , Krzysztof Kozlowski , Frederic Weisbecker , Hassan Naveed , Christian Brauner , Mark Rutland , Mark Brown , Mike Rapoport , Gavin Shan , Steven Price , Zhenyu Ye , Jia He , John Hubbard , Ram Pai , "Kirill A. Shutemov" , Ralph Campbell , Mina Almasry , Sandipan Das , Dave Hansen , Brian Geffon , Masami Hiramatsu , SeongJae Park , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org Content-Type: text/plain; charset="UTF-8" To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org HAVE_MOVE_PUD enables remapping pages at the PUD level if both the source and destination addresses are PUD-aligned. With HAVE_MOVE_PUD enabled it can be inferred that there is approximately a 13x improvement in performance on x86. (See data below). ------- Test Results --------- The following results were obtained using a 5.4 kernel, by remapping a PUD-aligned, 1GB sized region to a PUD-aligned destination. The results from 10 iterations of the test are given below: Total mremap times for 1GB data on x86. All times are in nanoseconds. Control HAVE_MOVE_PUD 180394 15089 235728 14056 238931 25741 187330 13838 241742 14187 177925 14778 182758 14728 160872 14418 205813 15107 245722 13998 205721.5 15594 <-- Mean time in nanoseconds A 1GB mremap completion time drops from ~205 microseconds to ~15 microseconds on x86. (~13x speed up). Signed-off-by: Kalesh Singh --- arch/x86/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 7101ac64bb20..ff6e2755cab8 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -198,6 +198,7 @@ config X86 select HAVE_MIXED_BREAKPOINTS_REGS select HAVE_MOD_ARCH_SPECIFIC select HAVE_MOVE_PMD + select HAVE_MOVE_PUD select HAVE_NMI select HAVE_OPROFILE select HAVE_OPTPROBES -- 2.28.0.709.gb0816b6eb0-goog