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.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 9ABB1C433E7 for ; Thu, 8 Oct 2020 05:49:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 466D52173E for ; Thu, 8 Oct 2020 05:49:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728412AbgJHFtS (ORCPT ); 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