Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp48191pxk; Wed, 30 Sep 2020 17:29:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzS0hjZ7CGl3DyBYY3jKaOoKvix33mlXLBCM6EVh4e1gwDEnXRVLzN8ogdPW6mX1Yp1uzly X-Received: by 2002:a50:eb0a:: with SMTP id y10mr5727334edp.89.1601512154323; Wed, 30 Sep 2020 17:29:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601512154; cv=none; d=google.com; s=arc-20160816; b=FzMastW1siT5hy4qoO6Ek0034cDGfxxtaV7Kxw7tPmmvAg3kPkn7My8GIx47kgjFbJ XJX7A7Z/fmOy/J2v5ehS9XFCs6phlUhsIsdI1q9bU8cr/b+C+CIdEJc7K8Yf2cHbLAfJ K8QRiMxl4GbLGWI4Av7Vbo4ZLUZYNMQLVcK4Weli87YRgzASGyi/VycC0KOlgAjXBxqf XT0EXo9lxA9RW8hBvutdj64FSV7xKDFxnM8aSvfw9eIUKUGu1ksQxxBn6IjTkd+0LEyi o081/G19s+cIoSg+kz+Lsk10S0o8x3XHaOrFeEAi8VTTHKC59QyTCUACtsMSUIdro5JF WxvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=1qp3UfALwxeAkbBnOuUerX7dWpuQSQY7BSRCIH5z6dw=; b=EM7t5x+cmGD9fVeaD8uvj7PSS4I6XFpsfjrJo2YKN87PJSEueCkMeJFbhUcns2YHeH KhVlqL3mppdo6fACzjccUcElGAKuAVn6C2IJ/jcQqy826/zs3JBBQfOc1hqjH4IjotH4 El9ZWcKqVp2WdDqKAA44iNAa3s8uecx9SU2AqqUsf4Rfu7A11lwz2LCmmU9GsF6q1pfg J7JOUNy7A8/jYM2AtEtsHeP28OYBOrBUDIoGknYZCQvZo25XndzlkSf3nR76ffKgaHQr x+kpO6aLU0901+PaJoU+FwFhp1QXpfioYFPn0PT7MHJjOC2GgU3BDtcqM6r5Nq7svpn+ rE2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=MRZTPRpg; 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 do12si2286431ejc.114.2020.09.30.17.28.51; Wed, 30 Sep 2020 17:29:14 -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=MRZTPRpg; 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 S1732001AbgI3XDk (ORCPT + 99 others); Wed, 30 Sep 2020 19:03:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730307AbgI3XDj (ORCPT ); Wed, 30 Sep 2020 19:03:39 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AB31C061755 for ; Wed, 30 Sep 2020 16:03:38 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id 34so2232295pgo.13 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=IBM1be5vIGUPCbmIuT3Ok/B/zuKPQeZ+6oleiEKrFm6bcfMmjtW8TRXl3qy+K5Ic+L W8XvXXvkaBgRHq7nAaKfPAIHa4yKtmP8Z1AlA5RiUN5TaayaANs4490UAxQddxECOB8X wkXHHkG8l5GcgcClKRHT5U18b25xF6S8wuKSaxvUHG+T7A/cK7jVS2ibY1sV7zHBtxT+ ZtHilDMHfHxCA4LfkcjdrX6bW186G3tms5+iJ9CHPqTTZ23qee/FXK9Z10Y/i8dcqlht Ftuk+u7KY068aUfJtuDptZjnTAWFaexxATGk5isw+clf2uUaNDFLXKw8GzAX0UU+xlGu 5C+w== X-Gm-Message-State: AOAM533V7c71l0LoXQMz2eWyJacXWG0Rq+pZwyhPxpn3joNCY3iMS699 lrADH3ASCU8MpK7inzx8IfVChXqLDS5zY8FuB5Wq3A== 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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