Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp568625pxk; Thu, 1 Oct 2020 09:04:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwY3/daewrOg73cIbOpFRe7D2ejkGDF0dNCJcn66fbu+UgjHhYPluU+PpJVNhrNvSiHYB4W X-Received: by 2002:a17:906:874f:: with SMTP id hj15mr9336399ejb.539.1601568274085; Thu, 01 Oct 2020 09:04:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601568274; cv=none; d=google.com; s=arc-20160816; b=p8TcSLO2yteZPaUJMixw+XV0RCjxeEEQWpl3FqjvxthgaH8I/caYykMAaAAtS4Uome Q90prbc+TP6CsiRNHIdfUsGiJ4aR8WiutBPzTii3t6DozG/s2+1WNcZ1OwaL1fM4ew7/ mYcF4qmhn3wIYBEfkWtBDKoPomQAUYdqnyP9z85MIIoGY3Gi+RjPNeRINmyzqKQeCjeN hQUamA/GG9ro6NVM1x1LwWN4puiWGJD6xIELC2xg3r8KcU3aj0oVWwrkYPo3Elt5g8PV I/79Rdc8nhCN+CVO3RJyxZ4a6pLEcyAyYR0+yptOJas3zEp8mtXv+KdtCxcvnqsewx3U Sb4Q== 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=tP2dMg1iUwJzmq0vUogTLB9VpnaKWbxkOw0rS14MEAY=; b=pfOsR+E6aK+Gs3op4Vykw993SDcD6Xso3BS7VLgr4RgsbsGv65C1P+XoLEHueyD3BE Ulq6qojug51G4dugeK/tJHTBi4NHjGAhwGTBd/JVWFFwdzAb1yZ9SkGCcsGFj7619pYp JMYAYLud6pkpg/J0GfkDPe9iR0mFFnOJjAz0U8fqs6BaRt5ZFq4q+7V2eJQ1eoL/BvSu bW4JHT1ZmRoNE/yWf435IeO0+mcQPefglEo8tyGj1pZNZSN18JBeRrLSDfwJlG2r4tZr D4JcrrlGUWlgiwW+VjwW1zVbHn/u4SkhOdPgFHvXIQmrAFIyRmakUurNvITadiY49jFe uf+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=DyMVRpMv; 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 u18si69150ejg.28.2020.10.01.09.04.09; Thu, 01 Oct 2020 09:04:34 -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=DyMVRpMv; 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 S1732119AbgJAQAH (ORCPT + 99 others); Thu, 1 Oct 2020 12:00:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732287AbgJAQAH (ORCPT ); Thu, 1 Oct 2020 12:00:07 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C45DC0613D0 for ; Thu, 1 Oct 2020 09:00:06 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id b124so4900497pfg.13 for ; Thu, 01 Oct 2020 09:00: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=tP2dMg1iUwJzmq0vUogTLB9VpnaKWbxkOw0rS14MEAY=; b=DyMVRpMvDrJEc7kSshu7rW7AlqroyCIaxTDZ9EMt9YvbwBwXyDaoKE6fZpl0O+0HcZ FSlXvAvgdOGhlHS6xV23L8iC6pyW5qjvaI4uYMEHcRIij3YSAO4aK9LvOUeYcnf2ZjLl 1uAwbfAa70Ej2z6wcAIYQ9wxjLv6b7K9hkVeVWW8qUq+p7D30nprbmv70XvmIGay+xZw WOBeDohWMLktNIK62U0HpXI281xL//XJYYVe6PnDGApbmnhl2d8VJ952m2i8LQyrhlf9 /CBhiffEnYZwoCDtSyJeWg3ly9SnLhgVGQauu1JG/OPpH7Z/Tjxrng6gvoipDkYsJZMG pOmw== 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=tP2dMg1iUwJzmq0vUogTLB9VpnaKWbxkOw0rS14MEAY=; b=qmSqUG9e9Ppp4jiaiARDXsUdhX1dTdmej9SyVKGg8V9sxyYQNG4qAfBbJto3YMw7+Z VCbQDkgEnl06c916RYiE2bLR8tUou0mRhTteeZ64GwtvyU7zi4XZ5Sw886KgvJEkZI+K DOESoaXyRQEojyTPsSh3VF/sOBUBTRobWakjvRSx0BuSbU6p28jipQOZlmtbxxOnD+sn j9Nx5KWnNPbF3z9Jj89HdTjK6IncZ98LEKFCypeUBgCy7iAVA5S+8pZp2IqTxxLCDSyv +bRNztIGkiyYhLSrH1qldgZ5yuWQrLkp3ecu9lpocsWxIk8nVewwDy1bsQ/ducTLsfwI o4pQ== X-Gm-Message-State: AOAM532tYo6jXDeSnl4XCdhC1132dkpRL/t5JYpuWSB0pbhpKzMKfxi0 FESPxSuE1Aml724B9cFzPlItJhQb7dKQDiA04kTazQ== X-Received: by 2002:a62:3541:0:b029:13f:ebd9:ad5c with SMTP id c62-20020a6235410000b029013febd9ad5cmr8127487pfa.30.1601568005449; Thu, 01 Oct 2020 09:00:05 -0700 (PDT) MIME-Version: 1.0 References: <20200930222130.4175584-1-kaleshsingh@google.com> <20200930223207.5xepuvu6wr6xw5bb@black.fi.intel.com> <20201001122706.jp2zr23a43hfomyg@black.fi.intel.com> In-Reply-To: <20201001122706.jp2zr23a43hfomyg@black.fi.intel.com> From: Kalesh Singh Date: Thu, 1 Oct 2020 11:59:54 -0400 Message-ID: Subject: Re: [PATCH 0/5] Speed up mremap on large regions To: "Kirill A. Shutemov" Cc: Lokesh Gidra , Suren Baghdasaryan , Minchan Kim , Joel Fernandes , "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 Thu, Oct 1, 2020 at 8:27 AM Kirill A. Shutemov wrote: > > 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. Lokesh on this thread would be better able to answer this. I'll let him weigh in here. Thanks, Kalesh > > -- > Kirill A. Shutemov > > -- > To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@android.com. >