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.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS 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 82B57C4360C for ; Fri, 4 Oct 2019 23:45:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2C8CC20673 for ; Fri, 4 Oct 2019 23:45:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C8CC20673 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=surriel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7DC556B0003; Fri, 4 Oct 2019 19:45:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 78DE46B0005; Fri, 4 Oct 2019 19:45:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6A28A8E0003; Fri, 4 Oct 2019 19:45:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0230.hostedemail.com [216.40.44.230]) by kanga.kvack.org (Postfix) with ESMTP id 49DFF6B0003 for ; Fri, 4 Oct 2019 19:45:32 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id CF177180AD803 for ; Fri, 4 Oct 2019 23:45:31 +0000 (UTC) X-FDA: 76007736462.25.brake49_6a6d5e6561511 X-HE-Tag: brake49_6a6d5e6561511 X-Filterd-Recvd-Size: 3264 Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Fri, 4 Oct 2019 23:45:31 +0000 (UTC) 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: --=-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--