From patchwork Mon Oct 5 15:40:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalesh Singh X-Patchwork-Id: 11816873 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 E2CB792C for ; Mon, 5 Oct 2020 15:41:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9A72A20B80 for ; Mon, 5 Oct 2020 15:41:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="k5vN5lL8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9A72A20B80 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C24E9900007; Mon, 5 Oct 2020 11:41:32 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id BD3E68E0001; Mon, 5 Oct 2020 11:41:32 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A9AB3900007; Mon, 5 Oct 2020 11:41:32 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0117.hostedemail.com [216.40.44.117]) by kanga.kvack.org (Postfix) with ESMTP id 71A128E0001 for ; Mon, 5 Oct 2020 11:41:32 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id ECA7B181AE868 for ; Mon, 5 Oct 2020 15:41:31 +0000 (UTC) X-FDA: 77338286382.24.month28_3a0f87e271bf Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id BBAD41A4AA for ; Mon, 5 Oct 2020 15:41:31 +0000 (UTC) X-Spam-Summary: 1,0,0,238c79ae0f943853,d41d8cd98f00b204,3qj57xwskcbc7x81f4f5a343bb381.zb985ahk-997ixz7.be3@flex--kaleshsingh.bounces.google.com,,RULES_HIT:41:152:355:379:387:541:800:960:973:988:989:1260:1277:1313:1314:1345:1359:1437:1516:1518:1535:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3152:3352:3865:3866:3867:3868:3870:3871:3872:3874:4250:4321:4605:5007:6261:6630:6653:6742:6743:7875:7903:9969:10004:10400:11026:11473:11658:11914:12295:12296:12297:12438:12555:12895:12986:13069:13161:13229:13311:13357:14181:14394:14659:14721:21444:21451:21627:30054,0,RBL:209.85.219.74:@flex--kaleshsingh.bounces.google.com:.lbl8.mailshell.net-66.100.201.100 62.18.0.100;04y8dgajg1r7638rdwka1frtgoeggycnnw8fei7grxth6mo5khb7shj1cju8yim.1a8oqyx7daohybym6wkpixofzchpa8ijgud9wkmqg8de9web5dudhyawhy9guqj.h-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFti me:23,LU X-HE-Tag: month28_3a0f87e271bf X-Filterd-Recvd-Size: 5836 Received: from mail-qv1-f74.google.com (mail-qv1-f74.google.com [209.85.219.74]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Mon, 5 Oct 2020 15:41:31 +0000 (UTC) Received: by mail-qv1-f74.google.com with SMTP id ec4so3499001qvb.21 for ; Mon, 05 Oct 2020 08:41:30 -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=bMnBZVJZ0gP6yWIahq+ggDCPy47CsnYvJiYw0n333nM=; b=k5vN5lL8u+dk7kk1dVwMid1XenomFqovMOogievds6K5jd20VXgxbl2GFmp9kcpSBP 6QTRISzHEYP0AwHteqslnrm2lDI4o6TNFzp3eLpPSYPYmosTOpjvr0Tcp5Evej0M8pOG NDN7DhJqs5Pc+2CCYJ9ilX5R5ax+1FWsqWBoizCPssscrao3rJH39V7UmzRBLCdDcBnv /c5HcLQ2tHg6VqfaazIcTVynqbkSBCGQGA1TdVjphaWV+Q9djLrapFHuVINGUeK58Iq2 qSVxl7d+7HUqT/LF6PXQtIH5YrCQ55CM67kkpySUh+9u+hzZIqVOJTquW9YdjteNKCac uGtg== 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=bMnBZVJZ0gP6yWIahq+ggDCPy47CsnYvJiYw0n333nM=; b=RyWsiD9gXzn/bAJwivGsfv7ei9GNg0NwAq8j5gl8jRCEyV67OfDTwXPbunyKurk6n1 CqQxNaLdYZsPDadoED2xTKHuJlNCyKcZRJiwp7e5UCLCyTZRsGNUeg7XytsEmoAIAIZf HZmDEGOH4aRU6QKwHDTczjWwyXhOvXzzRmtVpjUNZgPhrf+iWSf3MPImRIifGRwmYI3l 6gsJ8ytGo9P/aYp3zAaWtxcLZKZnd4Y5/vH1RDMSrYWNegGH5FBgNNBIoKgZAlFrzheL 1q8Wn4loPZ14uwgrsGwm27uEziFWg23HZvN0lsU22h3K9wqgBCEcvEuPx0qG5947QfKt UyLQ== X-Gm-Message-State: AOAM533TqZ9uHq+KmYC+3HbMAqztYVH2PD5gc+x/kzLBUYy6Gc4q1YnU 1+SQrvpOoqhyPv2kX1BrsDY4DwY4GxqgPVRCig== X-Google-Smtp-Source: ABdhPJxCbT3Tk7IhWxN1eyg5aVeN/8oSsg9g9VSjiEzr12333FvC/+nSCGHof4S0Ag8i51NGfN+bVC/79zdrCeEyvg== X-Received: from kaleshsingh.c.googlers.com ([fda3:e722:ac3:10:14:4d90:c0a8:2145]) (user=kaleshsingh job=sendgmr) by 2002:ad4:4594:: with SMTP id x20mr337215qvu.4.1601912490402; Mon, 05 Oct 2020 08:41:30 -0700 (PDT) Date: Mon, 5 Oct 2020 15:40:08 +0000 In-Reply-To: <20201005154017.474722-1-kaleshsingh@google.com> Message-Id: <20201005154017.474722-6-kaleshsingh@google.com> Mime-Version: 1.0 References: <20201005154017.474722-1-kaleshsingh@google.com> X-Mailer: git-send-email 2.28.0.806.g8561365e88-goog Subject: [PATCH v3 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 , Masahiro Yamada , Sami Tolvanen , Arnd Bergmann , Frederic Weisbecker , Krzysztof Kozlowski , Hassan Naveed , Christian Brauner , Mark Rutland , Mike Rapoport , Gavin Shan , Mark Brown , Jia He , Zhenyu Ye , John Hubbard , Dave Hansen , Jason Gunthorpe , Ralph Campbell , Mina Almasry , "Kirill A. Shutemov" , Ram Pai , Sandipan Das , Yang Shi , 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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