Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1535482ybp; Fri, 4 Oct 2019 16:52:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8BP6GXamWY2PqOpG5++EKy0wmhxYWubX6LihVC0WJq78hpN8p+rDsrD4SOpAGMPTFnUYe X-Received: by 2002:a05:6402:2d2:: with SMTP id b18mr4544983edx.214.1570233158558; Fri, 04 Oct 2019 16:52:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570233158; cv=none; d=google.com; s=arc-20160816; b=tkwz0yQCePROQZxi6KIErOSKax/Zs/CTbb1qQ+VMZtcbrQU/5lF7YyJwEtnQEPyMoA DNp7XsX4P0WRCXBIBMdQiLa67yU5VPE8huZm4Hf9gXY7a2FC5oNT9/HneyY4ASo2F4TV jsy1UK4s69Sdxvm0anO7HCf4SzxszYAAfRHRZ5Z0dNSzGNm1HeUgS/1ZuuHviMN2at6p ZGKGtQopadAkhswDqnxe1xRTgwcCe+oWtiMqYBJ2mc/2PoKTgS4VL7GR9PUmBH3U0HoO wi2VwUkgaXestF9kcgr5Sl/wFCavzLnvRskhJdSK2CdRm8wDCYCCDn5+wGe6DpFFoW2D CTwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=MiBZqyzRJ3LlXDrYjqfDXlSHcFPCHwMLfUTBrDU73Dg=; b=rCg0sdeM9u2lTaDJN9bGU+r5+fDDAQA6B1UpT9CNnJ8LZPGlOSB/yMQPxqpFBKnxi3 thakPB+a6L9USPi658v5uqJMcX3Lx5GVX0i91vfQ4UfeHP2NbkNtSm1SB/gZ7omgtxBG jqkLDb4L/R27PYYwZVkg/t/rEBP+ZLXfDhYjM9Qc8XFGTMe98CAIo2y+qeXPw/11P88O m2dLaVkasq5/fVwNbo7//RdMueRfW7H4CcsVbODC8M4F1yQfPNiy0pqFlUVfJt4zbqDE 6wvDPwb0zLULhf/oDHXLa6WVMQydx++6xbk3FUuQJhvoQNJ1qIK7pDhK295y0W+FPOSv keUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id be24si4394521edb.120.2019.10.04.16.52.14; Fri, 04 Oct 2019 16:52:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731444AbfJDXpa (ORCPT + 99 others); Fri, 4 Oct 2019 19:45:30 -0400 Received: from shelob.surriel.com ([96.67.55.147]:59532 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725730AbfJDXpa (ORCPT ); Fri, 4 Oct 2019 19:45:30 -0400 Received: from imladris.surriel.com ([96.67.55.152]) by shelob.surriel.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1iGXGI-00049i-S7; Fri, 04 Oct 2019 19:45:26 -0400 Message-ID: <9358295b1d9cc173940a58038123128b4dafc5d0.camel@surriel.com> Subject: Re: [PATCH] mm/rmap.c: reuse mergeable anon_vma as parent when fork From: Rik van Riel To: Wei Yang , akpm@linux-foundation.org, kirill.shutemov@linux.intel.com, jglisse@redhat.com, mike.kravetz@oracle.com, khlebnikov@yandex-team.ru Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org Date: Fri, 04 Oct 2019 19:45:26 -0400 In-Reply-To: <20191004160632.30251-1-richardw.yang@linux.intel.com> References: <20191004160632.30251-1-richardw.yang@linux.intel.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-pyM9/LzSGvdMtJgYPqRg" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-pyM9/LzSGvdMtJgYPqRg Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, 2019-10-05 at 00:06 +0800, Wei Yang wrote: > In function __anon_vma_prepare(), we will try to find anon_vma if it > is > possible to reuse it. While on fork, the logic is different. >=20 > Since commit 5beb49305251 ("mm: change anon_vma linking to fix > multi-process server scalability issue"), function anon_vma_clone() > tries to allocate new anon_vma for child process. But the logic here > will allocate a new anon_vma for each vma, even in parent this vma > is mergeable and share the same anon_vma with its sibling. This may > do > better for scalability issue, while it is not necessary to do so > especially after interval tree is used. >=20 > Commit 7a3ef208e662 ("mm: prevent endless growth of anon_vma > hierarchy") > tries to reuse some anon_vma by counting child anon_vma and attached > vmas. While for those mergeable anon_vmas, we can just reuse it and > not > necessary to go through the logic. >=20 > After this change, kernel build test reduces 20% anon_vma allocation. >=20 > Signed-off-by: Wei Yang Acked-by: Rik van Riel --=20 All Rights Reversed. --=-pyM9/LzSGvdMtJgYPqRg Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEKR73pCCtJ5Xj3yADznnekoTE3oMFAl2X2ZYACgkQznnekoTE 3oPWpQf/b82uQvESfiRANm55vxx5yC3OU0qDt3+yd1D//k3lnCEADg1KLuT53P/a Iq9fLZ/3EnDg2pwx5Vqnm+G4knmjSgQN0JC9f1E455R4mOpF3OJfX6U2EDDrycck UONRE0qRMxMeTjbrxQPdyXGlrwKXekL3jvk25jqhO6F0eTR6chxrK0rZG9sfrNC/ 5Ii4VLSmhlCT6YOaCrA/CMzRgS1pRxWmigMvXLPwQpRvspAca//XTCN9fh2213dV 8BbSasCdczPByHi2zWb4kd92jMYSSC9hAs+8NoT/jC/bvxZV9sMgwOKsrrToICJl 3t/vk7sWhfXe3oVe+mVAbO5D2/cGNA== =WM9u -----END PGP SIGNATURE----- --=-pyM9/LzSGvdMtJgYPqRg--