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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 5A360C33CB2 for ; Wed, 15 Jan 2020 01:20:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 236B5214AF for ; Wed, 15 Jan 2020 01:20:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 236B5214AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C99B18E0005; Tue, 14 Jan 2020 20:20:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C22D58E0003; Tue, 14 Jan 2020 20:20:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B12318E0005; Tue, 14 Jan 2020 20:20:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0224.hostedemail.com [216.40.44.224]) by kanga.kvack.org (Postfix) with ESMTP id 9CC7F8E0003 for ; Tue, 14 Jan 2020 20:20:50 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 45DD3180AD81A for ; Wed, 15 Jan 2020 01:20:50 +0000 (UTC) X-FDA: 76378114260.21.size13_2455d1817f255 X-HE-Tag: size13_2455d1817f255 X-Filterd-Recvd-Size: 2888 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Wed, 15 Jan 2020 01:20:49 +0000 (UTC) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jan 2020 17:20:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,320,1574150400"; d="scan'208";a="225800371" Received: from unknown (HELO localhost) ([10.239.159.54]) by orsmga006.jf.intel.com with ESMTP; 14 Jan 2020 17:20:46 -0800 Date: Wed, 15 Jan 2020 09:20:55 +0800 From: Wei Yang To: Li Xinhai Cc: khlebnikov , "richardw.yang" , "linux-mm@kvack.org" , akpm , "linux-kernel@vger.kernel.org" , Rik van Riel , "kirill.shutemov" Subject: Re: [PATCH v2 1/2] mm/rmap: fix and simplify reusing mergeable anon_vma as parent when fork Message-ID: <20200115012055.GC4916@richard> Reply-To: Wei Yang References: <20200110023029.GB16823@richard> <20200110112357351531132@gmail.com> <20200110053442.GA27846@richard> <20200111223820.GA15506@richard> <20200113003343.GA27210@richard> <1cf002fa-a3cb-bcef-57dc-ac9c09dcf2eb@yandex-team.ru> <2020011422424965556826@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <2020011422424965556826@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) Content-Transfer-Encoding: quoted-printable 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: On Tue, Jan 14, 2020 at 10:42:52PM +0800, Li Xinhai wrote: >On 2020-01-13=A0at 19:07=A0Konstantin Khlebnikov=A0wrote: > >> >>Because I want to keep both heuristics. >>This seems most sane way of interaction between them. >> >>Unfortunately even this patch is slightly broken. >>Condition prev->anon_vma->parent =3D=3D pvma->anon_vma doesn't guarante= e that >>prev vma has the same set of anon-vmas like current vma. >>I.e. anon_vma_clone(vma, prev) might be not enough for keeping connecti= vity.=20 > >New patch is required? My suggestion is separate the fix and new approach instead of mess them i= nto one patch. >It is necessary to call anon_vma_clone(vma,=A0pvma) to link all anon_vma= which >currently linked by pvma, then link the prev->anon_vma to vma. By this w= ay, >connectivity of vma should be maintained, right? > >>Building such case isn't trivial job but I see nothing that could preve= nt it. >> > --=20 Wei Yang Help you, Help me