Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp548748ybl; Sat, 18 Jan 2020 06:01:45 -0800 (PST) X-Google-Smtp-Source: APXvYqw5DdFIJyPE2P38Lcy0mNa7FsRrynvVGOvVQ/r5oE2P3U6wHBf9D74zqsGsIUxfcjcnRhHM X-Received: by 2002:a05:6830:184:: with SMTP id q4mr9976665ota.232.1579356105386; Sat, 18 Jan 2020 06:01:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579356105; cv=none; d=google.com; s=arc-20160816; b=WDdcp/UKydCfoFJrqoYC8pP/945MFqwGqi9mrYOUC5D45U75ytgEMLtAbTkmn0UeDo CRgns/jeHn6yO/CtKt0hmN7p13BKWo0/mE9epX0ag6bB2hdkgbyvgrzMSxahvu1eXwVw uFQjREGFTKP1LhAm+7+x8bFFegaSmLkOgyuz06dO59VQdcKo+qtR6qQTv81TvQpLjLPm 1JDkFHbg+UMV2rBdLGlT6m8H3jWOyQLbI3zlyxueZHvLpkZu1R2LlouhY5tLc1gdzCGS 8SUq+KJ6ggIheHXU1l6h37gT/j8wTVFLGSvSWpU8fkgfqzQbY6fETHXMGyIMJidiN8sh r/JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=E98X9864/bfJIEJe+/1iPeIORymujBg0mBrF3gq7gaE=; b=XJ8KnigiJwiKqD0dH2oTQEs0hl3DuyOjE9XwSkY21PUcjrk5zfpYc7nF5QBCxWMlci qcwrfqRXP/AMR7blAyjVz9GuwxLXD9iKOcUpzWo8qlRDI0P1Phd6I8QHmtiE3CSnvso2 q9xzMVXv+EovxU586svlaJ/MypjUjfVlFFFa0TX1iIFcnYyiigziD6ll4azgXN5VSi14 j+MBgndFrKL7cw39oYXEpFKcZOnlbOw0QeJTuucs0HN19iY47BDc+q/ZTNjcIM2BLy0+ b1NWTKseeUCG9619q14oUwNXz3ZcsY9OtdDvS10ZJRcL3t5paMyEXDCZNH2VX1//rW6J GtzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VIv0uW1H; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m90si16754849otc.259.2020.01.18.06.01.32; Sat, 18 Jan 2020 06:01:45 -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=@gmail.com header.s=20161025 header.b=VIv0uW1H; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726386AbgAROAd (ORCPT + 99 others); Sat, 18 Jan 2020 09:00:33 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:33077 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726208AbgAROAd (ORCPT ); Sat, 18 Jan 2020 09:00:33 -0500 Received: by mail-wm1-f66.google.com with SMTP id d139so11444944wmd.0 for ; Sat, 18 Jan 2020 06:00:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=E98X9864/bfJIEJe+/1iPeIORymujBg0mBrF3gq7gaE=; b=VIv0uW1HqN/tg7z8Y+/DuyFusoKgexT53nGya2d1RvY6y8VvIrDNaI+QNUF1qIPcU8 jfbHDKR7Q0U1vQRVWZ8pe3QKvLdumFTxK+gptx4dt2wTw7XGH8JXj0icOHr8pYKGQZ9O 9addS7fNNDNXJCKCxMx7XU7mW+TW137xsrIuxzjhvfi5e0RwSKQ1WdCM9vAZ6Xfm8WnT Fi/Rz4ceoEnMqx4iM7UXxZgK7ETo8xhPGTQP02wb9Ls+i6hzXpqW5fbyovzVHfKq0yge uuPLhTEAoD7XEevU3Sh57gGiVBjccVu/COUEg4lgm8tQ4bmE70EbIthl3NWrKQslRvCi WlPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=E98X9864/bfJIEJe+/1iPeIORymujBg0mBrF3gq7gaE=; b=RKv5gZy5rBfZIWJ6Z/ciyt1jKQvm2Z9PdDPJH+R3tZ3OeJBS3x735iXIqQctBxe+rc TWBfYvE2AGgFbXz9529PVCzFrroJPP5jVS9ZoifdQ5clqY6ksdkYPWVZ7xWkkEFUztyz FxfRGJJqptuVEyd9g/GaymYZwfkIHzTvPRzhn5Je7wsSHBo7MH6KjgOTIZqQNzpep8yy nSBIgj1gzYZQyNLf5aUucJhdTwxlJszKezQlRZgpXLyF2BHwVeeGOCz+OPv+eMvho2mQ BPx6se9mkghJH2Q8BhhGUmmhFu1ApGIrJs++M7h0qlRcdc5gl4yH/CZzOIRQZZt6PXZ7 +LXA== X-Gm-Message-State: APjAAAXqHlHbVpBdP4PmDTzZvP4hC3fH9P6zc7Rxf2x27/nHC2g51L8K wu62G50pATwggEBUR9x8pQ8= X-Received: by 2002:a1c:4c5:: with SMTP id 188mr9741370wme.82.1579356030665; Sat, 18 Jan 2020 06:00:30 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id c5sm14811705wmb.9.2020.01.18.06.00.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 18 Jan 2020 06:00:29 -0800 (PST) Date: Sat, 18 Jan 2020 14:00:29 +0000 From: Wei Yang To: Konstantin Khlebnikov Cc: Wei Yang , Li Xinhai , "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: <20200118140029.z24bye6kq2yo33fn@master> Reply-To: Wei Yang References: <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> <8f335403-4a14-bd17-39da-6299dd962fc6@yandex-team.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8f335403-4a14-bd17-39da-6299dd962fc6@yandex-team.ru> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 18, 2020 at 11:04:21AM +0300, Konstantin Khlebnikov wrote: >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 up to you. >> >> > 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. >> > > >> > >> -- Wei Yang Help you, Help me