Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp404155pxk; Thu, 1 Oct 2020 05:28:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOPTpGT6v0VorDyUgeDGIcrDoL/OcpVC3bq+R7gP4t6VrRul2ElbtjXntUFRblP/F4OsFX X-Received: by 2002:a05:6402:13d3:: with SMTP id a19mr7655441edx.255.1601555333859; Thu, 01 Oct 2020 05:28:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601555333; cv=none; d=google.com; s=arc-20160816; b=TwKB66PgCKREJnzEYtt5+dolCOQsaltrUHCeHPX2hC83kA4fZbYptKiJLKqmA8YmB4 ANmjdSoE5bdIJQWt/urnNg/pGFPt2tIuf8vV09AsPWlzDUVglLeYN4kPdAPIhooTpfZG 1hV0ZbmpvJR2gVe8Io4MZLutHRtaaksM9Bto1Z+IXiaNhc3tDzGj1Un8m5/3R32rtVYk Lk8lW165/ynn3CiTpxsMGG0ae+3kfqznuUcRe/8i+lLgpTSbtj/8rYh1A1ybuworvb5a PQ9Qu3Pfos53ajnNL0KT3z2ujPBGubKUVohRuuOApissMCFem87IF8s3vCUK1tki2FQD amCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:ironport-sdr :ironport-sdr; bh=AT+IeCEtmcblPlx4OaUKLLAMwyhGTacifUgGWdFbuGo=; b=e+rV5T7C/wLiHoVMvjt+iRIQYVQpakrkqjyFKlOK/fj6Q68AvlFmEtjiGSZdWscerU xi67gnC33GT+2PI44EXP9d084jNvy3YfjTt4c++3qrxMaI8GBtjjN5L9aRT6/xLZtIZ1 HQa+PVgitoG5jT3osXJXjmDmRp3M0iY2JYXe4cYahPxcmemXwVG7uyavMwEoZCEN5V9Q 8iJWBJvpPRcDl9doixRqeUNulEzPZ6H/3Ygv3wbFemE1u+lMao92xUmHPU2eDGWDMKjx Y6aQpH3+QDMWTJ9xGpScioU4s2LLgMVwQby9iZDdjLC5w1VENttUi1v2GG//x6X39kRE TQ4w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id yj16si3853429ejb.751.2020.10.01.05.28.31; Thu, 01 Oct 2020 05:28:53 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732094AbgJAM1S (ORCPT + 99 others); Thu, 1 Oct 2020 08:27:18 -0400 Received: from mga04.intel.com ([192.55.52.120]:20541 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731888AbgJAM1S (ORCPT ); Thu, 1 Oct 2020 08:27:18 -0400 IronPort-SDR: g/53jGtHPBQB5gPvsLQUW2a6d5n+sYmYXR+9Dyg4pHxe8fmmMNqHKM8oNWX+YIiqLCDpjGJnKM 02CWRCCWJ0CA== X-IronPort-AV: E=McAfee;i="6000,8403,9760"; a="160112729" X-IronPort-AV: E=Sophos;i="5.77,323,1596524400"; d="scan'208";a="160112729" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Oct 2020 05:27:17 -0700 IronPort-SDR: vYQlnFQDsSeVVFoJ8EgOROs7Pwdn8XJOQwxW3/B9d3MJcpTWEEUP/POGl82D5k9JxBIIN2EbId 3+0Q3exN2QZg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,323,1596524400"; d="scan'208";a="514699410" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga006.fm.intel.com with ESMTP; 01 Oct 2020 05:27:08 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 31B46327; Thu, 1 Oct 2020 15:27:06 +0300 (EEST) Date: Thu, 1 Oct 2020 15:27:06 +0300 From: "Kirill A. Shutemov" To: Lokesh Gidra Cc: Kalesh Singh , Suren Baghdasaryan , Minchan Kim , Joel Fernandes , kernel-team@android.com, Catalin Marinas , Will Deacon , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "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 , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH 0/5] Speed up mremap on large regions Message-ID: <20201001122706.jp2zr23a43hfomyg@black.fi.intel.com> References: <20200930222130.4175584-1-kaleshsingh@google.com> <20200930223207.5xepuvu6wr6xw5bb@black.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 30, 2020 at 03:42:17PM -0700, 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. Any chance to quantify the effect of mremap() with and without HAVE_MOVE_PUD? I doubt it's a major contributor to the GC pause. I expect you need to move tens of gigs to get sizable effect. And if your GC routinely moves tens of gigs, maybe problem somewhere else? I'm asking for numbers, because increase in complexity comes with cost. If it doesn't provide an substantial benefit to a real workload maintaining the code forever doesn't make sense. -- Kirill A. Shutemov