From patchwork Wed Oct 14 00:53:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalesh Singh X-Patchwork-Id: 11836597 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 62A4014B2 for ; Wed, 14 Oct 2020 00:55:08 +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 2EA9120EDD for ; Wed, 14 Oct 2020 00:55:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LUxO2q+r"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="jw3IYuqh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2EA9120EDD 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=v+wgN/Vjd7UjGaJkDnLmrww41NQdSrtkfp1733lf4OU=; b=LUxO2q+ryFaGyaVAseJanDrsT PLnd6ZcvFdEvX0C3Ne3OT4sfgQCgUf+1L0MOEtSv/Jsaaf0kHGZ6jhHh5PLSI4/aUDDhkuPWMUWfS PCAO0a3U0Pq5OBgc5zDHCy0Pcx6gNiiGzLvIebcnxcmm1ydHsr9RbNHcbBLss01EmOIpfYaurpG9f KUmlu5gVaCnKXCFKcrczhKGEak0iVH8Yg2ZlrLTQwD+uz11/JUKPvpUdWdfmKCCF2wG7MmmM7fPek 3q5f4lspInqS7Iq/FDIqT1b+MrUwfV+B2as+tfVx2bM664M7YzIBl2sL//kGR2V5WZdjs+/WRYyU3 oSRmuXdVQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSV4D-0003DA-FG; Wed, 14 Oct 2020 00:54:57 +0000 Received: from mail-qk1-x74a.google.com ([2607:f8b0:4864:20::74a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSV4A-0003Aa-I3 for linux-arm-kernel@lists.infradead.org; Wed, 14 Oct 2020 00:54:55 +0000 Received: by mail-qk1-x74a.google.com with SMTP id i10so1071571qkh.1 for ; Tue, 13 Oct 2020 17:54:52 -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=+sRzkUE+scrQPOvt1hpaJRFlbY+mLiTASxfxA+AvDzY=; b=jw3IYuqhYk3bNCks48afsywsfyXpRda22JQ0j0vZleZASO4yZwS1bbAuklB3w73SDu nVAc5RTpyaQR83VAqaD5XtkkdxVMh+0WBUMs27BJbmYfuDR1MW5kWP4aQfuVJrwkj8hh ZUBpB5ib1AH/FLfmvSzZMAn6wB7H0IpN8t+GBiHXJ7r60tAz2aTiCECnYOE5ke/1OYb5 WloVpKbiCNwWXyA4+oAnzoKO4VvGLId6i4oBNn44HJh83Bd1hMW1gtw8oN04wN5EK01s gowS/qx8dBNy3W+Q/r388jANZjwOF21UjBdBC73CjCeTbc9Ads94fCnBq1FmwxpHOw7G axtA== 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=+sRzkUE+scrQPOvt1hpaJRFlbY+mLiTASxfxA+AvDzY=; b=mw41sne151RBa7aeYNn/uuuwkPGclG7RxdNmcb5X5HwA5lFvrYB/Y9hA2jHkLs7TFC d/pLgVrGPAgqQJAS3GjgzS5Om2nPZ1i9jgxdQufpihN/i/bvIOAaAVPpZx0TdEXgToCv eE6jkhy3LjcNrfcpzvnIf7lNg9fHNORTz1P7ao0GwFuCZ/NiltlKL8jliaeoP6a1TIVS h5cgZTv/1b0uMRLGsmh6IayCxxOGud3i3Y+c1lURro5rMtup0K3fJsOmm2SdSmpawvqw wpyVF8rDqhZYxnBZAB0nKyykxWLM+9SoZIHUJAcnTP9udx8fH6OI9NXEMvgzggXdcAQp gOXA== X-Gm-Message-State: AOAM532wXd3Nq6shJ6fLahr4WBcAOZt89AvhHEmU7FOw4D7aV4TpMxVD fPqkfLSunaQugL+zabrKIqGhmU6iL0/6RhH2XA== X-Google-Smtp-Source: ABdhPJyfDvKvdmHyyap2eUwDhm0Me8oBd98Fxe3Nu61XFgLJneYAMnVgTd1Giuoe//Q/MlLcMZyeZ5E1JL9dS9zouw== X-Received: from kaleshsingh.c.googlers.com ([fda3:e722:ac3:10:14:4d90:c0a8:2145]) (user=kaleshsingh job=sendgmr) by 2002:ad4:4150:: with SMTP id z16mr2651885qvp.50.1602636890894; Tue, 13 Oct 2020 17:54:50 -0700 (PDT) Date: Wed, 14 Oct 2020 00:53:10 +0000 In-Reply-To: <20201014005320.2233162-1-kaleshsingh@google.com> Message-Id: <20201014005320.2233162-6-kaleshsingh@google.com> Mime-Version: 1.0 References: <20201014005320.2233162-1-kaleshsingh@google.com> X-Mailer: git-send-email 2.28.0.1011.ga647a8990f-goog Subject: [PATCH v4 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-20201013_205454_603784_20D747C3 X-CRM114-Status: GOOD ( 15.55 ) X-Spam-Score: -6.5 (------) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-6.5 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:74a listed in] [list.dnswl.org] -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM white-list 1.2 MISSING_HEADERS Missing To: header -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 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, Anshuman Khandual , John Hubbard , Frederic Weisbecker , Borislav Petkov , Thomas Gleixner , Zi Yan , surenb@google.com, linux-arm-kernel@lists.infradead.org, SeongJae Park , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mike Rapoport , Andrew Morton , "Kirill A . Shutemov" , 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 Acked-by: Kirill A. Shutemov Cc: Andrew Morton Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: H. Peter Anvin Acked-by: Ingo Molnar --- Changes in v4: - Add Kirill's Acked-by. arch/x86/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 835d93006bd6..e199760d54fc 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