Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp978193pxu; Wed, 7 Oct 2020 23:17:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyD8wpUAUjDNJedj55RpZ0oO5bCReX06Skn2r51paSoaVa9irW0sy+EaxMwEkYZj9fGrtPX X-Received: by 2002:a17:906:f259:: with SMTP id gy25mr6701716ejb.499.1602137846127; Wed, 07 Oct 2020 23:17:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602137846; cv=none; d=google.com; s=arc-20160816; b=GrbEwgLcwLcb7Qy0Zy4t9mrDqSvrF6ICt9rP6UO16XxARcDDZH+nPfqSDaOODOZxZp YptJmnIJ3xz9j7LhZJmTwApO/YtJ1WypAXfxD/f7rMghvJP8xTvR3iZCdNxZCVScAigx peaJIlsdWN8FrGYce0Ml10bPgvLfBOExsDuc5QKqxVdvrUBErjQsYQL550+ygz2ibZ2F p0JVAFSDV49I3AxXcru5Ci7U51K+Sl3FPaDyha3DhgwcIsluQmn5w7R5xtbGxm5hHyM0 QbI+Hj2hvU0cVJ0vQQfDUCPp8YZOVZ7g9t7db//+A4v3lPVjm2JbdjxXmOjE9GNF4RVG dsSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=+nH69qMTnWt+NCq8s4qlyoxS7tBnE4r319eZA7oIng0=; b=aL/Kqxy3/F07HEEtZlSBphzle9yhrg2bO/zDADI/E44hRum+PXG0zwaOGYQTFEC57N qfYwptpAQoKoU9jqCcMB5Ga0PTJzfiU5JpeURK6Na/ZV1EhFgOBbFuT+0uejxWnhGWCu YkTEz6ukYyZNwwglCOcrSt9NQGta/TSKjetpHg6uieFVlKvbj56r6YO6MlX6y8ddm7F/ Qmdth4j3MZianzunpcpwO/EHCVoSml0JQ3/PNvOcYq/4rvxGtkctaOOf75hRSrXLKvPt SngM/2/7crfONiTe1pjKWOTwnOp4aCM8bW4xbRxJVa5EtUVbvQ0ErNOs+HJmb4t0lAh0 Ww+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n2si3479955edi.564.2020.10.07.23.17.03; Wed, 07 Oct 2020 23:17:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728383AbgJHFtS (ORCPT + 99 others); Thu, 8 Oct 2020 01:49:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:60654 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726245AbgJHFtS (ORCPT ); Thu, 8 Oct 2020 01:49:18 -0400 Received: from localhost (unknown [213.57.247.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 37EA420725; Thu, 8 Oct 2020 05:49:16 +0000 (UTC) Date: Thu, 8 Oct 2020 08:49:13 +0300 From: Leon Romanovsky To: Linus Torvalds Cc: Jason Gunthorpe , Peter Xu , John Hubbard , Linux-MM , Linux Kernel Mailing List , Andrew Morton , Jan Kara , Michal Hocko , Kirill Tkhai , Kirill Shutemov , Hugh Dickins , Christoph Hellwig , Andrea Arcangeli , Oleg Nesterov , Jann Horn Subject: Re: [PATCH 1/5] mm: Introduce mm_struct.has_pinned Message-ID: <20201008054913.GE13580@unreal> References: <20200927062337.GE2280698@unreal> <20200928124937.GN9916@ziepe.ca> <20200928172256.GB59869@xz-x1> <20200928183928.GR9916@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 28, 2020 at 12:50:03PM -0700, Linus Torvalds wrote: > On Mon, Sep 28, 2020 at 12:36 PM Linus Torvalds > wrote: > > > > So I'll do the pte wrprotect/restore removal. Anybody willing to do > > and test the sequence count approach? > > So the wrprotect removal is trivial, with most of it being about the comments. > > However, when I look at this, I am - once again - tempted to just add a > > if (__page_mapcount(page) > 1) > return 1; > > there too. Because we know it's a private mapping (shared mappings we > checked for with the "is_cow_mapping()" earlier), and the only case we > really care about is the one where the page is only mapped in the > current mm (because that's what a write pinning will have done, and as > mentioned, a read pinning doesn't do anything wrt fork() right now > anyway). > > So if it's mapped in another mm, the COW clearly hasn't been broken by > a pin, and a read pinned page had already gone through a fork. > > But the more I look at this code, the more I go "ok, I want somebody > to actually test this with the rdma case". > > So I'll attach my suggested patch, but I won't actually commit it. I'd > really like to have this tested, possibly _together_ with the sequence > count addition.. Hi Linus, We tested the suggested patch for last two weeks in our nightly regressions and didn't experience any new failures. It looks like it is safe to use it, but better to take the patch during/after merge window to minimize risk of delaying v5.9. Thanks > > Linus