Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp47582pxk; Wed, 30 Sep 2020 17:27:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzA5p9J7Zqk0zzqR8WC0THP/TsMojiRx9zjHTNUi7wfHn717RtfniDd0gA3QYJkGXpl14gR X-Received: by 2002:a05:6402:1612:: with SMTP id f18mr5478723edv.166.1601512072548; Wed, 30 Sep 2020 17:27:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601512072; cv=none; d=google.com; s=arc-20160816; b=FrfHPqV2SObY5dqHHZqalWoNOdY6e0Jwok6LRn1Z16eYPkbC9o3x/YddztHEMZIyMa RWayfn79XO1MnVZos/A1w+uHMNcPN4F4mSlokJrKmwMrW3dueZJ/tAnuHfQ1qn7cg+Nq nTPOyIobMSxaKnDCH/mDSE3y9DC2OuRQiO3TuMEi2TS1NS4P6IlUn9dT7lDXYsL+7fX2 MDPqMZb51g/6pTso317hw/FrpXOTDZJItPyQBDGUjWMpggmlcSabBwT/kv4+4gasnpSn Xn7cOyZjedN3SDu7mlWXXVMbLe3dg3Jpyk7+WDAtxn4oMR1noo3SSL2ammJWYGln8G98 PbmA== 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=eTCFS3cfNEjOOKerZt+01daLGyP2fALUEUrJKhPYQ6w=; b=iONfM5o3U/sksmTg3k1REMT8zPlLRnlpFuhkKUh75Dwgsmd6rFYw3iirbl9vBb7oKf PNu/RLRjtkGI/Pym32WVMURy9RorKeWZzvulqDGxYi3kwTPhMB66w73pU0Uh9CaWoKRX +EXA6XfO5Y/DnqlwNcNvVYVaXTyXR4eBcVMSAgys+GfPmPR0MnL+FV9XOVU2isjJBs0B IvhSn3tTvWeOvNiWNZHE+2QWh+Zc+OC7rX7lExdClmyY2rUvZtnG332ajeP/TTe2op4S ExYVFyJZ1v5PBWlJExJkL37qNBRbT6CXpIur9xJ3oh6/V1kBdxYtjdteg/rulDhbeY+x tapg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Q60Wco9+; 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 f17si2516046eja.524.2020.09.30.17.27.29; Wed, 30 Sep 2020 17:27:52 -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=Q60Wco9+; 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 S1731796AbgI3WrI (ORCPT + 99 others); Wed, 30 Sep 2020 18:47:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731791AbgI3WrI (ORCPT ); Wed, 30 Sep 2020 18:47:08 -0400 Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7565BC061755 for ; Wed, 30 Sep 2020 15:47:06 -0700 (PDT) Received: by mail-qk1-x742.google.com with SMTP id q5so3330868qkc.2 for ; Wed, 30 Sep 2020 15:47:06 -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=eTCFS3cfNEjOOKerZt+01daLGyP2fALUEUrJKhPYQ6w=; b=Q60Wco9+qfTN9GN/1gnoYEIQQnEJVS2L83J5fgMwYnhnkv7Iv+r7c6Vgvp8vKtK8q9 rEM+N2vD7SVboMi/LAS8n2Zi+bj/nEN/JUkRTbILPg4KptgS/sai/DwC/U+BaUsCAibi Iz8o1www1zeq5WMk+xVPn7qtQ5kkq14mC4HBugMazodVeXKe4YLW1pFY+APoOet0ttnU 3M0aPOwOD9YdezoRsvacCrR+i5YHVPSpDjasMZPxu4qszz5MxkWLRmMxDqV4KqH0bN7U qmHzpDNrLbiB0ndVTWpRvW6+vtA0FVgaxwlLdLxhMOO7cs9+iaxRlVuPu+79VoLAnuUQ X1gw== 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=eTCFS3cfNEjOOKerZt+01daLGyP2fALUEUrJKhPYQ6w=; b=M6tiGxdFtil6Tq5eFVICEB1bDpELCqgz6yYaD927j2nEDB0E4YqkrdDmq2U05M1jVV YpvbYZFw5Q3H2f6IQk78vmMT5ccT3UVcA1C/HU+nJY184Zf6weNwROpX2ce2j/cUZYuQ GKm0RN7AJaU86gVh583bm4y7qbkz/fTKzBMj9tA0aE3tTW2zFmQ6qoXX16SUE/6Vtb2L aIUwXXjROKUA9AmboN3+dBoHuvlBAIspKPpwTdiXGoCqRMUx5ctqSQTQY7XI4bQVj+ok fv0ONVsoTA9sTcc9G8HbPuQ/NPuIVYti7iBFm3YwsYMigRMWrhhkpX+8MDoUDqCCBFWl oV4Q== X-Gm-Message-State: AOAM533FTvePVkeXwbx3SBwKpafz/GGY18nIvBRpDuHI1F9Yg9AALTlg CqkRUarK5E/PwE47EMuRM/QlHDYV2vzduhqiVKc6ng== X-Received: by 2002:a05:620a:1367:: with SMTP id d7mr4910010qkl.20.1601506025306; Wed, 30 Sep 2020 15:47:05 -0700 (PDT) MIME-Version: 1.0 References: <20200930222130.4175584-1-kaleshsingh@google.com> <20200930223207.5xepuvu6wr6xw5bb@black.fi.intel.com> In-Reply-To: From: Joel Fernandes Date: Wed, 30 Sep 2020 18:46:54 -0400 Message-ID: Subject: Re: [PATCH 0/5] Speed up mremap on large regions To: Lokesh Gidra Cc: "Kirill A. Shutemov" , Kalesh Singh , 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: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 :-/ Thanks, - Joel