Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp36827pxk; Wed, 30 Sep 2020 17:06:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOrPW4gyIqiwcGinySmgmpiaWN0VNPmwv/jgE8FB6CvktEt4/DK9Kdn/ng1FxZsW0G2UFz X-Received: by 2002:aa7:cc8d:: with SMTP id p13mr5734047edt.136.1601510784091; 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=ph9tuksy4K/oE+w0QhcYjyT5TsCmXgXry7ontMABOucAUdiR1QTQdmzhO6BCW8Fp8F pv+H1sN03ocqsPxA+cUVGenbQ8jVaLMSaA6qWxTXmzGAi49W0zHH06/RQg881INOyBVJ ItPQ9O+evKDbl6W71864f8SoZqxg/5xev3RvoouZnKxBgM1dZd5ATwxUD/+h6PEXItDR gZscGggD9R4ytNNRbv6DKt/DVLopLU2tIVafi9In2UaWP1YHY7IwLFpX3Us4hYmG4Rv/ DxcnGP0CmpxnxyZ00g+n90oRJrouOf35mB4/VWv6V8bgnXlmAixwcKhln9HHJNtq4z1V +mSw== 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=r9i4rFwlO0Ri1Z8TnSbsRvxZfWKWakVdyJrZ8aN7lSY=; b=urY7ibEzOHoItVw11vFaCoxvJgHWYKaMYgXq83CodlYUSmEtjgplS6EHBpHVGMo5kz WdD8Mun5KZ44BA3eunu2hcwwNE2fX/WjaF7y5kD7+t1qHVkngZYeaUCEEmfuivQlHCiJ MujUJu5IN50/YO4DG1ma4pgYLgIvLl0P5j5h5U7c8SmRAC/+5RTeoR7Iyp1T8EOmlPFD bRpotGW3HBm0+aT0CwIwevKcgvv5vjamT6BT4tqMWrDt92roTGHYThmISFIDst+2uKzr mVC3JsfUfVTinMFBpXQsUOS9PQzm98fUHuhilzV3NnqPNWiFTCQvQ0z5m/18qBrRJScH rzgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=W1iWTcIg; 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 a15si2564483eju.46.2020.09.30.17.05.46; 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=W1iWTcIg; 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 S1731528AbgI3WWU (ORCPT + 99 others); Wed, 30 Sep 2020 18:22:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730201AbgI3WWU (ORCPT ); Wed, 30 Sep 2020 18:22:20 -0400 Received: from mail-qv1-xf49.google.com (mail-qv1-xf49.google.com [IPv6:2607:f8b0:4864:20::f49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C513C061755 for ; Wed, 30 Sep 2020 15:22:18 -0700 (PDT) Received: by mail-qv1-xf49.google.com with SMTP id f4so1880756qvw.15 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=pwzqy5Wj3oNa+EitBheVlaJssFo8jUveJyfqSLxZRvlxv6KtHYT0sIzon+aWe+AN+X gA/OZPWnmMZy5Up4Ka4GL8gWyOpg2FURcYlsbVBYnmV3LfzGa+QO8LS54t1J8XgK+pWa rDWp0B/9BHoK6tPaTwVSN2OmHfQqjgiinO5GeuI+Mbv6WJR2KAsp4Adam/vy3BHFI75z /0yb6CyA9rALVfgDgFbC0HACg8tntCU1ZYvZ6UWUALNbf7Endc2wwnqG1Nac+zLViNv8 eT11Bvji7hXxiaPsq/2Sqw+gainZy24MHzVsaIC3NlHWOeYJHDp1JH98Ad/Bz89E3uBV sWMg== X-Gm-Message-State: AOAM533cd0/aCuIRkuD7egqscbCH1Co/2mMS7kQdlf5ipgVTHDO0+FGb RsbufRsvhN3lOhO1qQ4rs9UdkM7BksHVA/M23w== 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: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 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 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 -- 2.28.0.709.gb0816b6eb0-goog