Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1598496ybc; Wed, 13 Nov 2019 01:05:56 -0800 (PST) X-Google-Smtp-Source: APXvYqxVSo44/KcDxrm5yUSzXxnVbApp6RBJWq7NiGf+pZ5JnJC9f05fG1LCCTiIVXktbPLRuMGy X-Received: by 2002:a50:9fa4:: with SMTP id c33mr2353840edf.176.1573635956566; Wed, 13 Nov 2019 01:05:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573635956; cv=none; d=google.com; s=arc-20160816; b=suoZi5rTw7dQQxSZi17Gm40mHiFDUj1zylHNS6gfcZLAuR7z1XxR6FSRVDUtImMjHP 6IjraY2aBBt4TrwpEhMvcctdBVEJQ6J7gF/PHTH3wrJ/PVwDHYJ5nWtO9NeRFx+bOyos k5qnwSgVI24d7I5I2tYzRplamzd6mmPGDwCfgTdYGBDxeb0/8v0vYRvokK6h14IoTxWZ fo2vvd0Q8W4wa27jbYdwOGNcjHfjANybskqW/ftRCRZ+7oyID/zPWX3GQ85xbHPIZuXN 8f7mhvdLsJeGiy6RQTrT0GSx7PkB+OzSy6tluZ4caB8Y+ESeo44ZrjxlJM2p4jCTecLa sHgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=WuCLw1mNhRSSrQbzE2XtsJC46JZuOt82gJ5Z6A5sU6M=; b=O41HyikIm1xZkIK3F1XiZRmgdAWTSlNeOUzxLTf90qpR0TPeUKnYGe1+zuxq4UH20N S6nwWqtWqGubGW5B6WTaEvDx0ACJD3fGgkZ6KuXEQiGhyCMu+vZo/RYEeA0Mn1NWA6wD nN2yV7OgK/RlTFbWfNJUA67frHTpSMQb888+YV2pOxdo0HlVkKuO2/8LXeSSx0WgYTGk 7kH+PxU1nTKft9hAfK8rzNU0UPmYiqjJCDaXDU2Dr7hJeO103JruPkMxKyaDpgtCsgdu 7obhV4g3Yn5uVWTzUJ6pGCk/BmEBphjfJOElG5jWUgmT98TFhV2H7NTpgeEPuy7R3PvM nOkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=qgoX2qy8; 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=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ov6si775021ejb.196.2019.11.13.01.05.32; Wed, 13 Nov 2019 01:05:56 -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=@nvidia.com header.s=n1 header.b=qgoX2qy8; 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=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727237AbfKMJEw (ORCPT + 99 others); Wed, 13 Nov 2019 04:04:52 -0500 Received: from hqemgate15.nvidia.com ([216.228.121.64]:2292 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726086AbfKMJEv (ORCPT ); Wed, 13 Nov 2019 04:04:51 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 13 Nov 2019 01:04:48 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Wed, 13 Nov 2019 01:04:48 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Wed, 13 Nov 2019 01:04:48 -0800 Received: from [10.2.160.173] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 13 Nov 2019 09:04:48 +0000 Subject: Re: [PATCH v3 00/23] mm/gup: track dma-pinned pages: FOLL_PIN, FOLL_LONGTERM To: Daniel Vetter CC: Jason Gunthorpe , Andrew Morton , Al Viro , Alex Williamson , Benjamin Herrenschmidt , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Christoph Hellwig , Dan Williams , Dave Chinner , David Airlie , "David S . Miller" , Ira Weiny , Jan Kara , Jens Axboe , Jonathan Corbet , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Magnus Karlsson , Mauro Carvalho Chehab , Michael Ellerman , Michal Hocko , Mike Kravetz , Paul Mackerras , Shuah Khan , Vlastimil Babka , bpf , dri-devel , , , Linux Doc Mailing List , , "open list:KERNEL SELFTEST FRAMEWORK" , "open list:DMA BUFFER SHARING FRAMEWORK" , , linuxppc-dev , netdev , Linux MM , LKML References: <20191112000700.3455038-1-jhubbard@nvidia.com> <20191112203802.GD5584@ziepe.ca> <02fa935c-3469-b766-b691-5660084b60b9@nvidia.com> X-Nvconfidentiality: public From: John Hubbard Message-ID: <7b671bf9-4d94-f2cc-8453-863acd5a1115@nvidia.com> Date: Wed, 13 Nov 2019 01:02:02 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1573635888; bh=WuCLw1mNhRSSrQbzE2XtsJC46JZuOt82gJ5Z6A5sU6M=; h=X-PGP-Universal:Subject:To:CC:References:X-Nvconfidentiality:From: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=qgoX2qy8q+Pz4xwaUpJCPUDYqLc7AOyeowDXx94iSygezEmzpCR7ZZxo0cljsfswu ukE0Cm+f0R483iPntRfn/ABXBRqJdTjYQOd5BMk3/+ahH8sNYpooo8xojMC+j2QKMp YnZN0Muwss41C3UGdYFy5MS6hRmL0789DFptbHHfPd5vitO0CxsRYBJyPt01+pG4cX 6cPdl9NwtrthmFzBA5/mOnD1+FGwYZl+/Gsvcsk8njJ9ZjDk+S/T82e3qWgu+CaLxi GAWOKJgmoqYLWXc9CemtInbG0/tG5R+23jPdDf2TY9FLXzVWhi+Ia12J1oxABZoP9Y i24f/CxZw1J0Q== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/13/19 12:22 AM, Daniel Vetter wrote: ... >>> Why are we doing this? I think things got confused here someplace, as >> >> >> Because: >> >> a) These need put_page() calls, and >> >> b) there is no put_pages() call, but there is a release_pages() call that >> is, arguably, what put_pages() would be. >> >> >>> the comment still says: >>> >>> /** >>> * put_user_page() - release a gup-pinned page >>> * @page: pointer to page to be released >>> * >>> * Pages that were pinned via get_user_pages*() must be released via >>> * either put_user_page(), or one of the put_user_pages*() routines >>> * below. >> >> >> Ohhh, I missed those comments. They need to all be changed over to >> say "pages that were pinned via pin_user_pages*() or >> pin_longterm_pages*() must be released via put_user_page*()." >> >> The get_user_pages*() pages must still be released via put_page. >> >> The churn is due to a fairly significant change in strategy, whis >> is: instead of changing all get_user_pages*() sites to call >> put_user_page(), change selected sites to call pin_user_pages*() or >> pin_longterm_pages*(), plus put_user_page(). > > Can't we call this unpin_user_page then, for some symmetry? Or is that > even more churn? > > Looking from afar the naming here seems really confusing. That look from afar is valuable, because I'm too close to the problem to see how the naming looks. :) unpin_user_page() sounds symmetrical. It's true that it would cause more churn (which is why I started off with a proposal that avoids changing the names of put_user_page*() APIs). But OTOH, the amount of churn is proportional to the change in direction here, and it's really only 10 or 20 lines changed, in the end. So I'm open to changing to that naming. It would be nice to hear what others prefer, too... thanks, -- John Hubbard NVIDIA