From patchwork Wed Sep 30 22:21:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalesh Singh X-Patchwork-Id: 11810415 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 8746D6CA for ; Wed, 30 Sep 2020 22:22:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 430172075F for ; Wed, 30 Sep 2020 22:22:20 +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="W1iWTcIg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 430172075F 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 594AF900005; Wed, 30 Sep 2020 18:22:19 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 544E26B0070; Wed, 30 Sep 2020 18:22:19 -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 45B37900005; Wed, 30 Sep 2020 18:22:19 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0098.hostedemail.com [216.40.44.98]) by kanga.kvack.org (Postfix) with ESMTP id 2D0126B006E for ; Wed, 30 Sep 2020 18:22:19 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id DBAD04417 for ; Wed, 30 Sep 2020 22:22:18 +0000 (UTC) X-FDA: 77321152356.30.fall35_080226127196 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id B7443180B3C85 for ; Wed, 30 Sep 2020 22:22:18 +0000 (UTC) X-Spam-Summary: 1,0,0,37fb1e7c4f27fd71,d41d8cd98f00b204,3gqv1xwskcpgpfqjxmxnslmlttlqj.htrqnsz2-rrp0fhp.twl@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:9121:9969:10004:10400:11026:11233: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.160.202:@flex--kaleshsingh.bounces.google.com:.lbl8.mailshell.net-66.100.201.100 62.18.0.100;04yrcfk3z7ueuq8cnipszchx54smkyph5qysqmg55ir381f5318195967y1rwch.i7ig5eou37t7mostw16qgmpgijf1e33mda4btt4wtqyd7oxu7fdrzox5y58p5me.1-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_rule s:0:0:0, X-HE-Tag: fall35_080226127196 X-Filterd-Recvd-Size: 5982 Received: from mail-qt1-f202.google.com (mail-qt1-f202.google.com [209.85.160.202]) by imf13.hostedemail.com (Postfix) with ESMTP for ; Wed, 30 Sep 2020 22:22:18 +0000 (UTC) Received: by mail-qt1-f202.google.com with SMTP id m13so2243207qtu.10 for ; Wed, 30 Sep 2020 15:22:18 -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=r9i4rFwlO0Ri1Z8TnSbsRvxZfWKWakVdyJrZ8aN7lSY=; b=W1iWTcIgxIUy2UVtGwKg/FWOAbFwxj1yZWmUPz5Pi/125KT5znQ+tf41yAd1LXtU3d Uib3iflcCUIsFkmFwF65SPdIo0tOd05bt6iEjAmwvgkuxVugygP1L5ds1Ja8WufaiuMV xz81lcY5xrAL+nyfM3Z0hdPj/tJ43t16HfcFkrJ+MxmieS3E1BV/xbXh8PvXr1ROpI8b rCKYtMByUOGystQtiQJjncYyQgIpF3rGdUXr5N8/ZwBTqs43v+RaP/0IRmqIv5X0KeCw wjabq5p+HsWNPVNiSZT1vRrkK3OoQqkBQQ+qiqurkNU1dwg9e3kAqbptm+mdcIc9xW87 dADg== 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=r9i4rFwlO0Ri1Z8TnSbsRvxZfWKWakVdyJrZ8aN7lSY=; b=amFYiyAufSQ2hiHY7ltVYYLzPPmXUOdntIdAhTVmvFVeyQG/XyXnBC66AsrzFcImBS qQ+3jFmMK3FV1xw4+wWNzCHknDWhziSQ1Ple+vGkeFqu9UL/vUvFcRAEkKJQMQyOk2fu OGKafT42YP2pN0Wm5RJew1d+XVW4v5Pbl0wWI313YzSs9Ina5GVOY16jVCu61gfv2t8B +zpotnd724nb1Pg6/h+6Y5fUqsZZwx8gS8cnazT40HXifxUwicHMJ0o0OYC7oyg+lkU6 9efOjk4KbD+Im/0AO4MgKw76NkOA9+YApkr71bz5pcVDKqn3byOdaCcKgcSIie0ws8oQ tv2w== X-Gm-Message-State: AOAM531lP7P1741kcq4aQqyZG1C+VdMP8snFN7pECrXzwaFj+39VeYEN X2e5Zd+qZYMEEjf3CH6V6qrCpqhC1EnDvfAlTg== X-Google-Smtp-Source: ABdhPJw/sR64l5kK5cZN6wHaMabXV7sFr12f7agBjeiB0rYDcGu7AUGvx40hqtjxrcgjvKmLH0L0Diy+P9Slii6SiQ== X-Received: from kaleshsingh.c.googlers.com ([fda3:e722:ac3:10:14:4d90:c0a8:2145]) (user=kaleshsingh job=sendgmr) by 2002:ad4:58e3:: with SMTP id di3mr4707465qvb.54.1601504537414; Wed, 30 Sep 2020 15:22:17 -0700 (PDT) Date: Wed, 30 Sep 2020 22:21:21 +0000 In-Reply-To: <20200930222130.4175584-1-kaleshsingh@google.com> Message-Id: <20200930222130.4175584-5-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 4/5] arm64: 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 , Arnd Bergmann , Masahiro Yamada , Sami Tolvanen , Krzysztof Kozlowski , Frederic Weisbecker , Hassan Naveed , Christian Brauner , Mark Rutland , Mark Brown , Mike Rapoport , Gavin Shan , Dave Martin , Jia He , Zhenyu Ye , John Hubbard , Jason Gunthorpe , Zi Yan , Dave Hansen , "Kirill A. Shutemov" , Ralph Campbell , Ram Pai , Mina Almasry , Sandipan Das , Brian Geffon , Masami Hiramatsu , Kamalesh Babulal , 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 19x improvement in performance on arm64. (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 arm64. All times are in nanoseconds. Control HAVE_MOVE_PUD 1247761 74271 1219896 46771 1094792 59687 1227760 48385 1043698 76666 1101771 50365 1159896 52500 1143594 75261 1025833 61354 1078125 48697 1134312.6 59395.7 <-- Mean time in nanoseconds A 1GB mremap completion time drops from ~1.1 milliseconds to ~59 microseconds on arm64. (~19x speed up). Signed-off-by: Kalesh Singh --- arch/arm64/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 844d089668e3..4d521f0a5863 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -122,6 +122,7 @@ config ARM64 select HANDLE_DOMAIN_IRQ select HARDIRQS_SW_RESEND select HAVE_MOVE_PMD + select HAVE_MOVE_PUD select HAVE_PCI select HAVE_ACPI_APEI if (ACPI && EFI) select HAVE_ALIGNED_STRUCT_PAGE if SLUB