From patchwork Wed Sep 30 22:21:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalesh Singh X-Patchwork-Id: 11810427 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8E0466CA for ; Wed, 30 Sep 2020 22:23:00 +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 4DC2A20719 for ; Wed, 30 Sep 2020 22:23:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LDYGfmST"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="jDIKOMNU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4DC2A20719 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.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:From:Subject:References:Mime-Version:Message-Id: In-Reply-To:Date:Reply-To:To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qMOvjJB8vl4fYeGRuH+sYCGMUJO4paYy/xSNQcl/VzA=; b=LDYGfmSTFXE5acXSXyu6R/rZC TRr3ZO5jnkfZ+sfFyI++RJtkbM/IOs10mxW4KrHL9cviWaRoOD/jbq7xrwVLF7iw+OROd+rgDtFXn 42+W17CK7pu5JrLhAQdKoTTDwxoM71NXCxfO/c+FA+VrdiKTKStm0pS3jcEKsfLnhEEMD8RWLD1/8 278uySEUzN2z0obqBGodQn/orjoWT0HUljE+bRuvu4dyCqNKMtUHjhVqpWrar9nOCcpo6WYWR8+9L e5dJ/vfqBclFPI8JrpDPJAbsMtAKRD4h9ihdbQSX0Tq86v7tv45cDENrVtfRStt7hk1Y9XzjqFxjZ vwFCTydxw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNkUp-0006UL-Rh; Wed, 30 Sep 2020 22:22:47 +0000 Received: from mail-qt1-x84a.google.com ([2607:f8b0:4864:20::84a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNkUY-0006NY-UT for linux-arm-kernel@lists.infradead.org; Wed, 30 Sep 2020 22:22:34 +0000 Received: by mail-qt1-x84a.google.com with SMTP id y53so2269954qth.2 for ; Wed, 30 Sep 2020 15:22:29 -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=LH57SlC5jLW2XPP9Hj/1j1L5OGYEvAPebdFlutdIxlP1X7fcxsn+VND97gslKF3UxU UTsZWISth3Rr4ExS+WHivHHV0o+WX/pvAcvKOjZxQ2UC62v4q+tUGP8nHz18oZ/Vgd7Q 0K0rFP03T8ogOUvUJDBX588HSM5r7IMh+4MPKCf3zyE1C0z/HpgP5mCr9NUnBNLhyekp QLLoz4bqqat1Y7xRu5QH8PtslNY/l+72f5NDoANM7fApslDsprJSa6R9sW9LupeeGkE+ cgnFM63ZBcgqIfVA8yXbI/kEGGh8QrpSg9r3BseeqkByOk4aosi08ZpbHY7mW37hlW5x Unuw== X-Gm-Message-State: AOAM531EU8pZJVaaFmOPXKzW1BHrdd8DaxEzH/BvkAFWlFqm3PujtTjp ijXLa+oY6hEMwlKkP548cLiG+e1cxNcrpYywuQ== X-Google-Smtp-Source: ABdhPJyLR6MYlSTS4XQqoJzvYxjrHwSWIVNtfhqTdtx45lsRl3oJwBhgd7X3m6yDztZJ8ANUp7tpdCXWxqNC36OyAw== 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200930_182231_035444_FD240E49 X-CRM114-Status: GOOD ( 15.24 ) X-Spam-Score: -7.0 (-------) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-7.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:84a listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM white-list -0.0 SPF_PASS SPF: sender matches SPF record 1.2 MISSING_HEADERS Missing To: header 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.5 DKIMWL_WL_MED DKIMwl.org - Medium trust sender 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, Mark Rutland , Gavin Shan , Brian Geffon , Peter Zijlstra , Catalin Marinas , kaleshsingh@google.com, Ram Pai , Dave Hansen , Will Deacon , 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 , Ingo Molnar , Sami Tolvanen , kernel-team@android.com, Hassan Naveed , Masami Hiramatsu , Ralph Campbell , Kees Cook , minchan@google.com, Zhenyu Ye , John Hubbard , Frederic Weisbecker , Mark Brown , Borislav Petkov , Thomas Gleixner , surenb@google.com, linux-arm-kernel@lists.infradead.org, SeongJae Park , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" , Andrew Morton , Mike Rapoport , Sandipan Das Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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