From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.1 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBB42C4727F for ; Wed, 30 Sep 2020 23:03:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5AC5F2075F for ; Wed, 30 Sep 2020 23:03:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="MRZTPRpg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5AC5F2075F 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 7719B6B005C; Wed, 30 Sep 2020 19:03:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6FAC86B0062; Wed, 30 Sep 2020 19:03:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5E8E36B0068; Wed, 30 Sep 2020 19:03:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0158.hostedemail.com [216.40.44.158]) by kanga.kvack.org (Postfix) with ESMTP id 47D606B005C for ; Wed, 30 Sep 2020 19:03:40 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 086DE181AE866 for ; Wed, 30 Sep 2020 23:03:40 +0000 (UTC) X-FDA: 77321256600.05.goat56_4704f1127196 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id 954CC18079DA8 for ; Wed, 30 Sep 2020 23:03:39 +0000 (UTC) X-HE-Tag: goat56_4704f1127196 X-Filterd-Recvd-Size: 6663 Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Wed, 30 Sep 2020 23:03:38 +0000 (UTC) Received: by mail-pg1-f195.google.com with SMTP id d13so2253008pgl.6 for ; Wed, 30 Sep 2020 16:03:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1qp3UfALwxeAkbBnOuUerX7dWpuQSQY7BSRCIH5z6dw=; b=MRZTPRpgiLd4dVo5yTkwFJrkJWJlwV1/Ezu7hIJ7Rs59u2t/dqz8e00FFVEDetPozz aQ6imer5vWRCnbV6wLq2YWB2w5P39mAy7li/GgpuxmnbWKoykyGMCqIlKa2bWy2kET/8 L/MyhQWSOovNqkrAEJ2e43CZq1U3ek+y2etGG2+Eu2ERHPBYEgLmCGAwSaAawfHkhuwz F78WlOn7b1307xFpv/seXC/bjszTNQyOetB8iXFcIBs6nk4xrEp0URmgonq76kjLlh8o mR5t7CGRCkY/rRjBb4gEuqL7VHhXjekm3+BeoVxpgKakUH/xZJ+fSVpYpIOevV/28v/V ScUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1qp3UfALwxeAkbBnOuUerX7dWpuQSQY7BSRCIH5z6dw=; b=YO6kmL0GodEl9wZfxh9WvY9CoUf80+WeA4cnIlEGSz9VVZAPashLZ8uXwHf7B7PlA1 gXkuDNFeyrAxaSHNFe2Ju/bTYY6bWRixE/UJ71hVLAcmKL4hm2rL7BHpxRbOxwQy0kE9 nUqHu6OjTyuo8N9nLqgG7p4Hf3aCulZjRqJ6TOB3EUacNTs/gGPdNNmirhUxyfWXu6y1 9gXNpbUXekw4ejfGYqftkupAnoAK5JowTY8/Ko+VXWqYAeV7s7tq+LG+oKgBChrlrJRg oHnrYuO8kkf5XutDaqpZm1jDWZi0ETAyoKDm2wjghxQoo2mwz7tCKPP1zs//jiCIsne0 yFzw== X-Gm-Message-State: AOAM533jwJ05yXmGs8J7T6tqTkHLfRrlGk2lVUjX5Nix4WPtPS9w0eBK CuOoi832oo7iHSE5TfYPUdtLt6aiXevatVpHCVYZ7g== X-Google-Smtp-Source: ABdhPJyhsf7xgXoZCwes3Wso6sNqelOwWRnGZknPTFob1tIYQqEMLBUree89qUifxh5a278FlT9ON5/JJAYto1X3Vqw= X-Received: by 2002:a17:902:8509:b029:d3:89e2:7931 with SMTP id bj9-20020a1709028509b02900d389e27931mr531392plb.51.1601507017712; Wed, 30 Sep 2020 16:03:37 -0700 (PDT) MIME-Version: 1.0 References: <20200930222130.4175584-1-kaleshsingh@google.com> <20200930223207.5xepuvu6wr6xw5bb@black.fi.intel.com> In-Reply-To: From: Kalesh Singh Date: Wed, 30 Sep 2020 19:03:26 -0400 Message-ID: Subject: Re: [PATCH 0/5] Speed up mremap on large regions To: Joel Fernandes Cc: Lokesh Gidra , "Kirill A. Shutemov" , Suren Baghdasaryan , Minchan Kim , "Cc: Android Kernel" , Catalin Marinas , Will Deacon , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "the arch/x86 maintainers" , "H. Peter Anvin" , Andrew Morton , Shuah Khan , "Aneesh Kumar K.V" , Kees Cook , Peter Zijlstra , Sami Tolvanen , Masahiro Yamada , Arnd Bergmann , Frederic Weisbecker , Krzysztof Kozlowski , Hassan Naveed , Christian Brauner , Mark Rutland , Mike Rapoport , Gavin Shan , Zhenyu Ye , Jia He , John Hubbard , William Kucharski , Sandipan Das , Ralph Campbell , Mina Almasry , Ram Pai , Dave Hansen , Kamalesh Babulal , Masami Hiramatsu , Brian Geffon , SeongJae Park , linux-kernel , "moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)" , "open list:MEMORY MANAGEMENT" , "open list:KERNEL SELFTEST FRAMEWORK" Content-Type: text/plain; charset="UTF-8" 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: On Wed, Sep 30, 2020 at 6:47 PM Joel Fernandes wrote: > > On Wed, Sep 30, 2020 at 6:42 PM Lokesh Gidra wrote: > > > > On Wed, Sep 30, 2020 at 3:32 PM Kirill A. Shutemov > > wrote: > > > > > > On Wed, Sep 30, 2020 at 10:21:17PM +0000, Kalesh Singh wrote: > > > > mremap time can be optimized by moving entries at the PMD/PUD level if > > > > the source and destination addresses are PMD/PUD-aligned and > > > > PMD/PUD-sized. Enable moving at the PMD and PUD levels on arm64 and > > > > x86. Other architectures where this type of move is supported and known to > > > > be safe can also opt-in to these optimizations by enabling HAVE_MOVE_PMD > > > > and HAVE_MOVE_PUD. > > > > > > > > Observed Performance Improvements for remapping a PUD-aligned 1GB-sized > > > > region on x86 and arm64: > > > > > > > > - HAVE_MOVE_PMD is already enabled on x86 : N/A > > > > - Enabling HAVE_MOVE_PUD on x86 : ~13x speed up > > > > > > > > - Enabling HAVE_MOVE_PMD on arm64 : ~ 8x speed up > > > > - Enabling HAVE_MOVE_PUD on arm64 : ~19x speed up > > > > > > > > Altogether, HAVE_MOVE_PMD and HAVE_MOVE_PUD > > > > give a total of ~150x speed up on arm64. > > > > > > Is there a *real* workload that benefit from HAVE_MOVE_PUD? > > > > > We have a Java garbage collector under development which requires > > moving physical pages of multi-gigabyte heap using mremap. During this > > move, the application threads have to be paused for correctness. It is > > critical to keep this pause as short as possible to avoid jitters > > during user interaction. This is where HAVE_MOVE_PUD will greatly > > help. > > And that detail should totally have gone into the commit message :-/ Hi Joel, The patch that introduces HAVE_MOVE_PUD in the series mentions the Android garbage collection use case. I can add these details there in the next version. Thanks, Kalesh > > Thanks, > > - Joel