Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2594640ybi; Sun, 26 May 2019 04:09:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsY1WLAVUDJtLBP4Jqy+xJpmWCeCSYVVnVKIm+wzPGf59Eo7g6esmQJdMmq77RG2l1x7MU X-Received: by 2002:a63:1a5e:: with SMTP id a30mr21241369pgm.433.1558868969787; Sun, 26 May 2019 04:09:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558868969; cv=none; d=google.com; s=arc-20160816; b=JgZN6TWgesfQXEiMlMWcHEK6kmbd9mNHt2Mle8rxLS5gcjO/l5YHg0KF4sJSV8Sf7Q Bae/b4G+dGI2FSPmBI4goC3UJstOHjTlGeDoOSfOe7GZ13xH3B2dkPQ9isNvcQH5lMNA 6nbNZZaQayzUbx+lNLPigsgmNFKW9mCUsgmQOwP/C7NlxZrJJ1GAtnRkczk7jHUeyE21 pDEHWc26L3P+TMrLDtmzrC6yl+7iZLl2lUBlVRRMJYfp08lBJuRveqyqpZl2TOEVC8QQ yzrtFm9uE3h0yq2vzPwjDfzbB/yE6tS2APQl2zHHAwEczdaeiWW0V+3VSgqa36DyDPtm WgIg== 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:message-id:subject:cc :to:from:date:dkim-signature; bh=dnRlIwzLsh5gtE410Wzg4R0DjN2uPpGflfJ056ZS7Vo=; b=szpkKRDxHTfoIK8ipnkkDd8b6pFh1SVCFuRGZLaJZJI255uuwGF7KliPBQH/nDNzuj J4cFptnIcsfOucr8lBF+xw0CN1Mcw05X9QLWSUMXyDOyVXKjXkRnzlcv9qMHAvrBchR5 E1POAsEA+Y1aDi+JMz4r0qTdUbGIBg1Omd2N4owTiHdQugQjeciED/3B+7w5UK4T2nX2 tGjPJFudDYw5Ku6xzGow2fEdVDaH1cFcJAF6wsnZDeoTFgZ5EpmWTuCG/yfHTQ15Vj+m aoMuId5agbZN2gEA1C5HOWSivupnPiCVCCNDEXaTV5OzPsFUKAzpRxgnsd90N27a3D7O KDPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=KpKeoXxD; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s34si12921041pjc.10.2019.05.26.04.09.14; Sun, 26 May 2019 04:09:29 -0700 (PDT) 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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=KpKeoXxD; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727749AbfEZLGf (ORCPT + 99 others); Sun, 26 May 2019 07:06:35 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:46122 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726837AbfEZLGf (ORCPT ); Sun, 26 May 2019 07:06:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=dnRlIwzLsh5gtE410Wzg4R0DjN2uPpGflfJ056ZS7Vo=; b=KpKeoXxDjqBDfQZZgp1AuGzjs C3p5lYMN8SnDhpWYllf1E7TWYwBI6oGBT2jXgmJYCKD4gCtkUT6wAlQxetGESzhFLp0kixvl0PKz6 sAIZ8McSchStRWXueMYMAzUEef1vD2eo20gCnaFS9GlxjNZ6NofnoZ95FC3RIG5QAZ5R47DmON+Qo JdOQPQ1LUXvgqEpgmOO5i6saVR6L0Xi+3VJ1CQlW12vxdRwBwl+0dLPYwev5/IQbIN2AjGvY27PsJ 6Pv6/5pS3hIlEgR1RuK7uJxg+BLAGf0eWCGlaxQFawlyO5JV9eBonzUDeprQ1j6UJOqA3XCCfRY7o RH6eOeHcQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1hUqz2-00036Y-1M; Sun, 26 May 2019 11:06:32 +0000 Date: Sun, 26 May 2019 04:06:31 -0700 From: Matthew Wilcox To: john.hubbard@gmail.com Cc: Andrew Morton , linux-mm@kvack.org, Jason Gunthorpe , LKML , linux-rdma@vger.kernel.org, linux-fsdevel@vger.kernel.org, John Hubbard , Doug Ledford , Mike Marciniszyn , Dennis Dalessandro , Christian Benvenuti , Jan Kara , Ira Weiny , =?iso-8859-1?B?Suly9G1l?= Glisse , Jason Gunthorpe , Christoph Hellwig Subject: Re: [PATCH v2] infiniband/mm: convert put_page() to put_user_page*() Message-ID: <20190526110631.GD1075@bombadil.infradead.org> References: <20190525014522.8042-1-jhubbard@nvidia.com> <20190525014522.8042-2-jhubbard@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190525014522.8042-2-jhubbard@nvidia.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 24, 2019 at 06:45:22PM -0700, john.hubbard@gmail.com wrote: > For infiniband code that retains pages via get_user_pages*(), > release those pages via the new put_user_page(), or > put_user_pages*(), instead of put_page() I have no objection to this particular patch, but ... > This is a tiny part of the second step of fixing the problem described > in [1]. The steps are: > > 1) Provide put_user_page*() routines, intended to be used > for releasing pages that were pinned via get_user_pages*(). > > 2) Convert all of the call sites for get_user_pages*(), to > invoke put_user_page*(), instead of put_page(). This involves dozens of > call sites, and will take some time. > > 3) After (2) is complete, use get_user_pages*() and put_user_page*() to > implement tracking of these pages. This tracking will be separate from > the existing struct page refcounting. > > 4) Use the tracking and identification of these pages, to implement > special handling (especially in writeback paths) when the pages are > backed by a filesystem. Again, [1] provides details as to why that is > desirable. I thought we agreed at LSFMM that the future is a new get_user_bvec() / put_user_bvec(). This is largely going to touch the same places as step 2 in your list above. Is it worth doing step 2? One of the advantages of put_user_bvec() is that it would be quite easy to miss a conversion from put_page() to put_user_page(), but it'll be a type error to miss a conversion from put_page() to put_user_bvec().