Received: by 2002:a4f:b056:0:0:0:0:0 with SMTP id m22csp1411691ivi; Fri, 2 Oct 2020 09:26:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCU45PfwYEF6vW9qlDpyA7ox+KAKMJFGL+glVYn5CAQY1R2UdmLGpiX6MtOnH5FdBzgQ4m X-Received: by 2002:a50:e78f:: with SMTP id b15mr3278248edn.104.1601656015650; Fri, 02 Oct 2020 09:26:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601656015; cv=none; d=google.com; s=arc-20160816; b=a2HAY23psJFmeZyWxHftouFgYOrrnueK84y+DB1KtDnuJUJzAReIUR0o/unyttza4J fqWCGa9innaPIQOJPysVtK9Xs25n9UfJZs6FuAlX5BoPzbDXZSWHMnZ19csiFdAawUw0 qbA73ulU3RsWhNz/GTxV+X3yK3zWC5s8Z249HFKThk6gpIpO73bMaA9Ld6b/qWx13mxe 3Iv+ICAsPmQXwZpcwoZpuM8Z/R+qUTdCDm8qoNNyjc32YZjLdy7MKcX94JLRWD0y7Sox nnFWZoeypHosRQJ9ik2RuRCYTDmdTeXhsrCwYd32hjzAr+CtGHPNi3l8eaBNQtNmfV9q KKmQ== 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=bMnBZVJZ0gP6yWIahq+ggDCPy47CsnYvJiYw0n333nM=; b=yHsxpj9fvDSs2o8n2pzFVZPYqeMB0WveybUQpu17A+C2z2bJXX23QIVhT6zJqyYIWW +/RLUnZjX3Ynu6Evx7AElf5rvuY9fhykcZup5cr+MO6o3zbTO/ucHbv4axE+IdfjEAYM o5pyYO/Yt9v3r0a/o32HL0BLnhs02r58BYzsNy2nMhhqpuN5Tvm9Xtpxzk2i7nP6tTgy vIa0ptPTEYH1uZblGhmtNyxNl28SLXzXvtSWfhsBv5+CTLSdciGe6x3ufL9YL/VWKYeA 9hIvcA7+t+M7/xkvTMIyuBb9TnfTBWGVbI/Ha6e6H8nCiTTpTzV9hiwXM7XDuHlx1mEF 1Tsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Z2BhCB0i; 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 j25si951715ejb.68.2020.10.02.09.26.32; Fri, 02 Oct 2020 09:26:55 -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=Z2BhCB0i; 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 S2388182AbgJBQWi (ORCPT + 99 others); Fri, 2 Oct 2020 12:22:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726386AbgJBQWh (ORCPT ); Fri, 2 Oct 2020 12:22:37 -0400 Received: from mail-qt1-x84a.google.com (mail-qt1-x84a.google.com [IPv6:2607:f8b0:4864:20::84a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 743F2C0613D0 for ; Fri, 2 Oct 2020 09:22:37 -0700 (PDT) Received: by mail-qt1-x84a.google.com with SMTP id e6so1381065qtg.13 for ; Fri, 02 Oct 2020 09:22:37 -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=Z2BhCB0ionBjY9f7rJg975U+QnCTCPpylLVtNijw2nkc9jOX0nWeWzaScP/MiSCHxb VlNw+IBd6+iMm5/zsKLjJhp4Av/TRf3MlDYx51iPzzIF3DYfrx3bJCSrtH9C//COkKxc xSYhR8fO9b21qmYKgflHjxUWg6wu/GpUAhEGJPmZeDcdY7rbfDAfRXb8euzLbp12Zh88 edKzBO0V9SHioyYGqGPIsn7hVLnsZnoCKmyX8mkVd22fnpHi1uxrWXuN4V+FYJ+VfUUh jHc4fZgacTCxZJu3LoVwWYVB64D6hIAt2jp6nQ4THkRgwkXaDAkjk/QHsk/CbqUR/Y1b Hr2A== 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=mtnTWm+2hrf7iysI/4PZOMk2YhABCQdNveCHegi4SMIe8lIOsczw2jL+rSlP1SWJgb QJZ1H7cJtHuVIIUCcPGxQivrO6ahpePW49Hcun1IS+5MV4mXKUNwBJZ+5elxoDN+HLCD C0qdoNBEmraIJ/oRkcQqnRfp0HjCXsqhPeOnZBRVyeB3fOZv7p+zfuL0OwgrPay7zYUL zBo5FtPAwWa4NX5H4Q/8SYXrubeppvHmwb4KGx8pcEBmBwEIXFYMX+c8UMtcg5bkJDH+ ZtM+YJ6yZjUFcun5s8d+1G6pRUcGhCiumBWnkABG08+qnd5c+RVUWzkruO2HSQZ7ejBc yV1A== X-Gm-Message-State: AOAM530pPf6jJLhMDxUPxS99z/bXreKxKytAMnF9905qWW/o3CgbBAc4 yK+/uRtjDTKM2xCbw7OKJ8/OWjcHR9vInA7wJA== 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:4527:: with SMTP id l7mr3023885qvu.2.1601655756530; Fri, 02 Oct 2020 09:22:36 -0700 (PDT) Date: Fri, 2 Oct 2020 16:20:51 +0000 In-Reply-To: <20201002162101.665549-1-kaleshsingh@google.com> Message-Id: <20201002162101.665549-7-kaleshsingh@google.com> Mime-Version: 1.0 References: <20201002162101.665549-1-kaleshsingh@google.com> X-Mailer: git-send-email 2.28.0.806.g8561365e88-goog Subject: [PATCH v2 6/6] 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 , Arnd Bergmann , Sami Tolvanen , Frederic Weisbecker , Krzysztof Kozlowski , Hassan Naveed , Christian Brauner , Stephen Boyd , Mark Rutland , Mark Brown , Mike Rapoport , Gavin Shan , Zhenyu Ye , Anshuman Khandual , Jia He , John Hubbard , Zi Yan , Dave Hansen , Mina Almasry , "Kirill A. Shutemov" , Ram Pai , Ralph Campbell , Sandipan Das , 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 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 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 -- 2.28.0.806.g8561365e88-goog