Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp281392ybl; Sat, 18 Jan 2020 00:05:40 -0800 (PST) X-Google-Smtp-Source: APXvYqxE4gNf4RLZXlRT4kK8BvLlcG6mb+RRkqlouDxuV5Rg0/YjNzMxJgBsVzJacNnsAP+CF7jZ X-Received: by 2002:aca:cc08:: with SMTP id c8mr6319491oig.42.1579334740447; Sat, 18 Jan 2020 00:05:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579334740; cv=none; d=google.com; s=arc-20160816; b=Lxcl+VbTzVcGjYdBOrlaLy7DzduMlv5gD8Du1UERh3+i/2OKJOh5dSVC6dZAph0kKF mGKtlCwFNsUk/QLm4Fb+QD3Nwl5BXoB3g6k//dcKl6XopQ/qArgt5DnTuPDsFS4Anx67 lfEdZ3DO5qCADNGi0ifYowtSHxrT5y0N4uHj0SrxusshfhS7S1gi4m4GGBxi1MidPMNy k5hZWfgF4BH8X/dD+Nr79QMwEnvYuBizsm6qBvKFYeiDV4874j1x8WT841Ok1ua924mi OQH5vkPfV/UVCbUXJQI6oBDPPEWCzmsuysM/mmKSrMv1MNMvJfkhpwBVT6DeB/hNgt2M tEOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=mzWO7FgHoEWNjnX84D+nJnPHJUiMjBrNmWaYiTUOznQ=; b=J26SH7bo5gyZ1WYLjx3K9984/k/Vf+QuCCo/Nj2br7MxCMKqyfOsnqGYKe4D9bPbw6 RvlA3YZUGksQMNzfCLHm9M6k1Z5JluBaNLq6s93193zLKw1AeYZsyRV/lU0wT5Y16y9m cbxTYg4Exqdn1QVdZ413efWPu66JSzLBQrxvBA1YK/LYxvJqsDg/ZI8OuwNZVKZfgd14 N6TWFRVWxpeODTeVXTV4UfBwMkRsTaPEs343HqhAzRVqK0D6SSNSpGJ/vJ0Lt/2ThEPo gEm5Lf06US3MhxhPSL4V1FUwH6Pufo3YO3ivgG+x0G3O1YtRyRNa5ON75mu4EKM7MzLH o2Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b="xhJ7gcm/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex-team.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h9si16065861otb.49.2020.01.18.00.05.24; Sat, 18 Jan 2020 00:05:40 -0800 (PST) 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; dkim=pass header.i=@yandex-team.ru header.s=default header.b="xhJ7gcm/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex-team.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726575AbgARIE0 (ORCPT + 99 others); Sat, 18 Jan 2020 03:04:26 -0500 Received: from forwardcorp1o.mail.yandex.net ([95.108.205.193]:43046 "EHLO forwardcorp1o.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726416AbgARIE0 (ORCPT ); Sat, 18 Jan 2020 03:04:26 -0500 Received: from mxbackcorp2j.mail.yandex.net (mxbackcorp2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::119]) by forwardcorp1o.mail.yandex.net (Yandex) with ESMTP id 9A2472E148F; Sat, 18 Jan 2020 11:04:22 +0300 (MSK) Received: from vla1-5a8b76e65344.qloud-c.yandex.net (vla1-5a8b76e65344.qloud-c.yandex.net [2a02:6b8:c0d:3183:0:640:5a8b:76e6]) by mxbackcorp2j.mail.yandex.net (mxbackcorp/Yandex) with ESMTP id muAey6KGiP-4LvGNOBc; Sat, 18 Jan 2020 11:04:22 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1579334662; bh=mzWO7FgHoEWNjnX84D+nJnPHJUiMjBrNmWaYiTUOznQ=; h=In-Reply-To:Message-ID:From:Date:References:To:Subject:Cc; b=xhJ7gcm/zTBF4pqWS7rYnpQ9OsFdcJLAvjSeA8/y0X82qjgtgAcm2x5NzojkeOncz iQIlnHOrqX7YiTvmP5dgwq+PPDIat9Zkbay5QToMIziLIlm4DhEEpeIAepwy5JTBl3 HBDb81nhL8Ctltx3If2S0cpUP3dXoujMzPd9+zqY= Authentication-Results: mxbackcorp2j.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Received: from unknown (unknown [2a02:6b8:b080:8305::1:9]) by vla1-5a8b76e65344.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id BhMT5Z59Wh-4LWipmcK; Sat, 18 Jan 2020 11:04:21 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Subject: Re: [PATCH v2 1/2] mm/rmap: fix and simplify reusing mergeable anon_vma as parent when fork To: Wei Yang , Li Xinhai Cc: "linux-mm@kvack.org" , akpm , "linux-kernel@vger.kernel.org" , Rik van Riel , "kirill.shutemov" 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> <20200115012055.GC4916@richard> From: Konstantin Khlebnikov Message-ID: <8f335403-4a14-bd17-39da-6299dd962fc6@yandex-team.ru> Date: Sat, 18 Jan 2020 11:04:21 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20200115012055.GC4916@richard> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/01/2020 04.20, Wei Yang wrote: > On Tue, Jan 14, 2020 at 10:42:52PM +0800, Li Xinhai wrote: >> On 2020-01-13 at 19:07 Konstantin Khlebnikov wrote: >> >>> >>> 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 == pvma->anon_vma doesn't guarantee 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 connectivity. >> >> New patch is required? > > My suggestion is separate the fix and new approach instead of mess them into > one patch. Yep, it's messy. Maybe it's could be better to revert recent change, apply second patch from this set and write something new after that. > >> It is necessary to call anon_vma_clone(vma, pvma) to link all anon_vma which >> currently linked by pvma, then link the prev->anon_vma to vma. By this way, >> connectivity of vma should be maintained, right? >> >>> Building such case isn't trivial job but I see nothing that could prevent it. >>> >> >