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=-3.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 D7C61C4727E for ; Thu, 1 Oct 2020 16:01:42 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8A20220872 for ; Thu, 1 Oct 2020 16:01:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="bUwYfGoR"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="DyMVRpMv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8A20220872 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VDlC56ZAads+g7LgjsCxaYWllgr/sAVpx7SCYgfB948=; b=bUwYfGoRjbhiYcxw3lgwu559n eAyoMKRqn1+GXIWMI1rb4rv5ae1vxPmTPGglchyjY0DQMUwTGizTpYhc3E72p1RtcpyqCY8v6W7uI M4mR66aX2Cefc6ah9t4+pdUAUAB7IoR6rGeQe/ekwNT+1EeQkYDSQJHSHMqKR1BrnXOYlvGI0hqSW Eq765uUwIKkpgN+pTAUfui67mMeyPyuWp0Isdb2S/esnn7WwftJlDQg/fUePBJHKqhygZ8YSQLMWd z4lFXPEaSzXLNFT6HCgSSCrZPcsZAdFv+hxcJ0ulQD9ZtZOfyfpo0Il7E3482zSbXlqqvMGivY8lL eoIX79J8g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kO107-00084R-3g; Thu, 01 Oct 2020 16:00:11 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kO103-00081t-Lw for linux-arm-kernel@lists.infradead.org; Thu, 01 Oct 2020 16:00:09 +0000 Received: by mail-pf1-x444.google.com with SMTP id k13so4956358pfg.1 for ; Thu, 01 Oct 2020 09:00:07 -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=KQdEfxziteFdMt0QZgtlc3LHWYMqOV0UZ+E74v9ga7pL6JQm39+VZZaH7N3Z0x1V5E 46iuj3rdPD6p/eVOObS9ttPEtLs0c6v9c5oG/16KlwIUQsl2a9qeXcrciSQJO9VpYcjd adUUt6wQdnfNSvkvE2OB3xLX/Kfkr795yYocidw7Id3ZG83FQJD7FSjRQwGVsfy3sApJ mAu5nP+Xp4KP8htePlTIJUjYRmfnWILFKVk93TWpSZ6XTGkR4WcGEkGBQjpkPS0QW2gT VkWlm2L94zeFKj3RAQuVxz1BAVJhQOyZFPVM2KPdqlXO084xfgMjG8m8gvyLPrWBD/lS DxSA== X-Gm-Message-State: AOAM532ZNyXXgZbPG+sFaQ9OELY4nfCKEGWdu86UF7Fi4jJZjStfvdOT 7iPxm7PMRltpK81MD8dE6HE6mGKBs1Eu+mFXex/AEw== X-Google-Smtp-Source: ABdhPJwlN5650AFlb8kwX/it/lrlk/RuhAcIRQLhSEsh+o04Dv5aTuiH3aYg0Hlib9CD5zO1Qo4rDUKW5Cf5xtTRDKU= 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" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201001_120007_818748_04EB6D77 X-CRM114-Status: GOOD ( 28.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joel Fernandes , Mark Rutland , Gavin Shan , Brian Geffon , Peter Zijlstra , Catalin Marinas , Ram Pai , Kamalesh Babulal , "open list:MEMORY MANAGEMENT" , William Kucharski , Will Deacon , Lokesh Gidra , "open list:KERNEL SELFTEST FRAMEWORK" , "H. Peter Anvin" , Christian Brauner , Shuah Khan , Mina Almasry , Jia He , Arnd Bergmann , "Aneesh Kumar K.V" , Masahiro Yamada , the arch/x86 maintainers , Krzysztof Kozlowski , Ingo Molnar , Sami Tolvanen , "Cc: Android Kernel" , Hassan Naveed , Ralph Campbell , Kees Cook , Minchan Kim , Zhenyu Ye , John Hubbard , Frederic Weisbecker , Borislav Petkov , Thomas Gleixner , Suren Baghdasaryan , "moderated list:ARM64 PORT \(AARCH64 ARCHITECTURE\)" , SeongJae Park , Dave Hansen , linux-kernel , Masami Hiramatsu , Andrew Morton , Mike Rapoport , Sandipan Das Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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. > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel