Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp640043ybx; Thu, 7 Nov 2019 00:08:25 -0800 (PST) X-Google-Smtp-Source: APXvYqwJYyLmAcNbMfgY2iovrz2OBOj8cl+/14pXeHKreUsC1MjUdmRR/5C6XerL0OH5CGKJSZYO X-Received: by 2002:a50:ef0b:: with SMTP id m11mr2137910eds.74.1573114105732; Thu, 07 Nov 2019 00:08:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573114105; cv=none; d=google.com; s=arc-20160816; b=Bzfa+JkruVoBTCxH/x0GaxsBQB8fz7j5wXrSwZKQQZjj3bpFVr7kvR3uIrjPiAp0hA tMDFCSFm//XCjRjJYg2tSCFYaHvwHeoEm6WxCt1oWbqAbbJhLaJVRVbexwNsk4yzicH+ c2Z58JiL7C/s+iUJQ/Mr4qjEfodoTdJitmXQ8GOTgN1YocFVFDZk/zU7P66yte8YMzUP DL83WyPTBRCqeB7R1+eybTZm0yPimWmTz+i6L7zdvPImjpWAAWXIPmCh9IABPAlPQbbS GDDNEeETnbUo7R7EOYUAxapeHXNGWvhdh9xUb+076+u9J3bRgKikaVVb6ICjY1qWpszN /9Fw== 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=y8+iAXhPu2uuPmtdTgrOVk5ANsK941RNtBeXcJfCvk4=; b=mpjvJWELuNlAPawOh9e0EnIMBUkRt+c2tEdYcqZQWO99OBKu1frezcS7mu5xDLZhEE DUAgVexj+7qrHfXbAmb6osXYwAjWM9YkzlvodtcroJk5Mmml6BcdFuvcKfAURV2HB8M3 /iIWAAvXwDYtdQ/2KaBPJhNK4V93vaIeg5O+jyBJzG9aa1wOs/QiNF1UJQ/Avm1piRZj 9VumK6+klNPHNY3Hw/u3F3vsnGOLnjOR4qNLUEduVO8NrtcA/OeFGgPHRHUQ8WPF6S// 3dyxS6rcB7EzrlTNtZI36FwVg1MEE1DaE6IgR4s38hONlriiZBxUF0t83DG3RFBXInzN vxJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KypO2u9q; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h56si803208eda.356.2019.11.07.00.08.02; Thu, 07 Nov 2019 00:08:25 -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=@kernel.org header.s=default header.b=KypO2u9q; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727658AbfKGIHW (ORCPT + 99 others); Thu, 7 Nov 2019 03:07:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:60672 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726791AbfKGIHV (ORCPT ); Thu, 7 Nov 2019 03:07:21 -0500 Received: from rapoport-lnx (nesher1.haifa.il.ibm.com [195.110.40.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 14F2F2077C; Thu, 7 Nov 2019 08:07:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573114040; bh=Vs0vmuJFZJfCdBWbcef1JshwZZc9l+YrjwUdtsaNu3k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KypO2u9qQZOpCT97PagoJmJ05jNzzAwEOh5TQuJtaHcnw290kuyiCyRgXcpTDgoff yL2r3/5Nv3OxL5iW1vDTUMldS7lvQVWUl8vBPDTErZIqUCYXU5EvD9rUB9CL4lekw9 M70s0IBFr/3wdhsUYXeg/j3kPNjd4MGq8LMTqoAU= Date: Thu, 7 Nov 2019 10:07:07 +0200 From: Mike Rapoport To: John Hubbard Cc: Andrew Morton , Al Viro , Alex Williamson , Benjamin Herrenschmidt , =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , Christoph Hellwig , Dan Williams , Daniel Vetter , Dave Chinner , David Airlie , "David S . Miller" , Ira Weiny , Jan Kara , Jason Gunthorpe , Jens Axboe , Jonathan Corbet , =?iso-8859-1?B?Suly9G1l?= Glisse , Magnus Karlsson , Mauro Carvalho Chehab , Michael Ellerman , Michal Hocko , Mike Kravetz , Paul Mackerras , Shuah Khan , Vlastimil Babka , bpf@vger.kernel.org, dri-devel@lists.freedesktop.org, kvm@vger.kernel.org, linux-block@vger.kernel.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-media@vger.kernel.org, linux-rdma@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, netdev@vger.kernel.org, linux-mm@kvack.org, LKML Subject: Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN Message-ID: <20191107080706.GB3239@rapoport-lnx> References: <20191103211813.213227-1-jhubbard@nvidia.com> <20191103211813.213227-6-jhubbard@nvidia.com> <20191105131032.GG25005@rapoport-lnx> <9ac948a4-59bf-2427-2007-e460aad2848a@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9ac948a4-59bf-2427-2007-e460aad2848a@nvidia.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 05, 2019 at 11:00:06AM -0800, John Hubbard wrote: > On 11/5/19 5:10 AM, Mike Rapoport wrote: > ... > >> --- > >> Documentation/vm/index.rst | 1 + > >> Documentation/vm/pin_user_pages.rst | 212 ++++++++++++++++++++++ > > > > I think it belongs to Documentation/core-api. > > Done: > > diff --git a/Documentation/core-api/index.rst b/Documentation/core-api/index.rst > index ab0eae1c153a..413f7d7c8642 100644 > --- a/Documentation/core-api/index.rst > +++ b/Documentation/core-api/index.rst > @@ -31,6 +31,7 @@ Core utilities > generic-radix-tree > memory-allocation > mm-api > + pin_user_pages > gfp_mask-from-fs-io > timekeeping > boot-time-mm Thanks! > ... > >> diff --git a/Documentation/vm/pin_user_pages.rst b/Documentation/vm/pin_user_pages.rst > >> new file mode 100644 > >> index 000000000000..3910f49ca98c > >> --- /dev/null > >> +++ b/Documentation/vm/pin_user_pages.rst > >> @@ -0,0 +1,212 @@ > >> +.. SPDX-License-Identifier: GPL-2.0 > >> + > >> +==================================================== > >> +pin_user_pages() and related calls > >> +==================================================== > > > > I know this is too much to ask, but having pin_user_pages() a part of more > > general GUP description would be really great :) > > > > Yes, definitely. But until I saw the reaction to the pin_user_pages() API > family, I didn't want to write too much--it could have all been tossed out > in favor of a whole different API. But now that we've had some initial > reviews, I'm much more confident in being able to write about the larger > API set. > > So yes, I'll put that on my pending list. > > > ... > >> +This document describes the following functions: :: > >> + > >> + pin_user_pages > >> + pin_user_pages_fast > >> + pin_user_pages_remote > >> + > >> + pin_longterm_pages > >> + pin_longterm_pages_fast > >> + pin_longterm_pages_remote > >> + > >> +Basic description of FOLL_PIN > >> +============================= > >> + > >> +A new flag for get_user_pages ("gup") has been added: FOLL_PIN. FOLL_PIN has > > > > Consider reading this after, say, half a year ;-) > > > > OK, OK. I knew when I wrote that that it was not going to stay new forever, but > somehow failed to write the right thing anyway. :) > > Here's a revised set of paragraphs: > > Basic description of FOLL_PIN > ============================= > > FOLL_PIN and FOLL_LONGTERM are flags that can be passed to the get_user_pages*() > ("gup") family of functions. FOLL_PIN has significant interactions and > interdependencies with FOLL_LONGTERM, so both are covered here. > > Both FOLL_PIN and FOLL_LONGTERM are internal to gup, meaning that neither > FOLL_PIN nor FOLL_LONGTERM should not appear at the gup call sites. This allows > the associated wrapper functions (pin_user_pages() and others) to set the > correct combination of these flags, and to check for problems as well. Great, thanks! > thanks, > > John Hubbard > NVIDIA -- Sincerely yours, Mike.