Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp572064pxu; Wed, 14 Oct 2020 08:20:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPoDrkMOQDEPQmHCfLXcsX0HiPCymMJ3iMkCDaMYqPYSd8n1btIGdeUE4oOKS0akVHrJjD X-Received: by 2002:a5d:6591:: with SMTP id q17mr6104181wru.173.1602688840800; Wed, 14 Oct 2020 08:20:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602688840; cv=none; d=google.com; s=arc-20160816; b=txKp3lPrcp9P3cg7TP+zs1ZY+B7bLQzLRoHu6tnVE0wAAtG9KeBEsoMrWb5AXQQes1 pcWvdS786c37D/JMzxsJhCIpScuAJKY8Lx97Qj0wqyFaJdn1EidMy5P4jc1R6m7r/z1m 3JpEEcfcsNnASPHbp5hj+31aRn4GCVqulwRAIloRf6eMq9DS5tWXVo0ux9FhLUoA2cJw 4zSmteLn/HaeBNuUqgMcWXSq0AeIUxxuTSEbZaYZ3y2RFgDyZi6fnn8ke3vSExdarUW+ h/av+Z/DGoaR7U3cT+CyZvSqbO7+igcKLQI3YKsFuo7aw4WJCzln61vdhlukmIZurMGJ uxlQ== 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=+sRzkUE+scrQPOvt1hpaJRFlbY+mLiTASxfxA+AvDzY=; b=eGYPEn3JpAe5eHKJLbHZjk95iRh3ScNH1wO0AqlRT2eqr/mmHHOGztEuHskcVjoohV rN+F4h1Tw1m1G0Aoba0F2Dw2mJNweeAM9TJ+BXC+WddQl+E5Acxw3Spgqp+yO0b9oicd sdEmvHnjwOg8YyjEZ3IZIu5d8BK6M6/tvaWMnW7bKpKdVgdOgXK5SvQPdP01ssoCn0Qn d0p4u9+H4obBToNMIm7bDewHfT5D7x4sRzPESuBhwbgCsGWwEdLikC5z4BZVIBZZv/54 2EoKYNBRGQq+x1bwUdaUZMTotbAPL0VFX36MMoaA8Fvr8JhZ/+NbBU3vM+BTUy5cP1dx GQoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=jw3IYuqh; 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 oz19si2865234ejb.730.2020.10.14.08.20.00; Wed, 14 Oct 2020 08:20:40 -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=jw3IYuqh; 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 S1725935AbgJNJVl (ORCPT + 99 others); Wed, 14 Oct 2020 05:21:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730973AbgJNJUk (ORCPT ); Wed, 14 Oct 2020 05:20:40 -0400 Received: from mail-qk1-x74a.google.com (mail-qk1-x74a.google.com [IPv6:2607:f8b0:4864:20::74a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFCE1C0251BE for ; Tue, 13 Oct 2020 17:54:51 -0700 (PDT) Received: by mail-qk1-x74a.google.com with SMTP id u16so1018311qkm.22 for ; Tue, 13 Oct 2020 17:54:51 -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=AXoFXBGRur/XRkZ2x03ZZ8+VrQw++CprCZG6RUsOYZMS0dOTzuTfnw0b85LvY+bcMQ E/ZBob0vA9dDadHwZyO12FmNdhE0kqmKOOpCfUYfPwkI9H/VFR/r6tXX+EKvjgR0AbTL mn3fuW5jX7W3MbOwXvIWV1DnalE6u907EELWcSNywhUhgLq+udCqeNIjmCg2bCACx0zZ gy4wwXVIIOypRQ5E/2p+DFWyX6QHi6kcsVIfgUZExf/HoOLKk0Xnravd+9OA6zcCqni4 7255++7FNONBvfgw7Uh0ZQol++uUaTMsAkMqK2LpPbM61VcTiX9KLMbfUjz0ryYYCWoX NQCQ== X-Gm-Message-State: AOAM530A4ifMw9y21GK9Bkg+qSZePds+3/bDCsOtXBdLVTw14ZdrBgxq XNUYjQ0ZDGYSwatjr+JzvR+QSQcgEORZyH5r9A== 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: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 Cc: surenb@google.com, minchan@google.com, joelaf@google.com, lokeshgidra@google.com, kaleshsingh@google.com, kernel-team@android.com, "Kirill A . Shutemov" , Andrew Morton , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Catalin Marinas , Will Deacon , x86@kernel.org, Shuah Khan , Peter Zijlstra , Kees Cook , "Aneesh Kumar K.V" , Arnd Bergmann , Sami Tolvanen , Masahiro Yamada , Krzysztof Kozlowski , Frederic Weisbecker , Hassan Naveed , Christian Brauner , Anshuman Khandual , Mark Rutland , Gavin Shan , Mike Rapoport , Steven Price , Jia He , John Hubbard , Ram Pai , Sandipan Das , Zi Yan , Mina Almasry , Ralph Campbell , Dave Hansen , 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 Acked-by: Kirill A. Shutemov Cc: Andrew Morton Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: H. Peter Anvin --- 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 -- 2.28.0.1011.ga647a8990f-goog