Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1655455ybc; Wed, 13 Nov 2019 02:13:22 -0800 (PST) X-Google-Smtp-Source: APXvYqwbHOIjN5qZbvF5R96mQTINzEuhaK6StSp+r1qVmSxpMy1xqdZvwf8x6Ysc3cxnLwjAto7y X-Received: by 2002:a17:906:2615:: with SMTP id h21mr1914356ejc.212.1573640001867; Wed, 13 Nov 2019 02:13:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573640001; cv=none; d=google.com; s=arc-20160816; b=wnp3X7nuZIWbBRxFUaM90n4ubnc/H2TC3JnrgYPobbE+rxhdr4Nc2POcUswtZ9jYSs 3KXv3lXWBfiKHR2QIYGinPopdgwG0GWQailAcLGlP7ttfiuh6RpWOJacFJHzMMXY380A x/f7vHApH/JYuyXEe08ovkk7n2BdDQbJfGyLfRIm72b7LD+P9D+4StNBklCJQkRZNSat uRbE5GP2gDViCSQcBKqLDNYgHTwoVoBc0yC1GkFpIiqs21xTae0sRNPhTKq/X0OG8N9G 1eSkhYYgbZh1TUZC2vFE4AC9I2x8wngJXFkF0Ek9KlRHQAPJubpm/J85KZmBhNcLhaBX Zpnw== 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; bh=qlJbiYqoC+q/aYp59mzqlJHEIVobc7B0kkcF3ntn6UE=; b=MrCNbUaX4CtBCk+g9AH8FNNkgO5AhTms3MjVasxn07TkWH9WULlz8M7VFm3/NCjtMA Fy5nBjEC21Y07z+qbzAYX1XwXvBFuhQTiV48Ig/zEKPwe6G1Sr3ewtqkhWgLVnS3mOl3 z7j01/TsiURpnLlXz/mh74097bQMXLDL+syIrgw1qtg+TaztuBr0VifQg3DFV5TaPEvM ddx52SnC3mENc8ub5cF3u8gKTucK3M6un/hxEuaLXSDVBBspEU8YqmXW629qvZF+ADAq wX07BF+R+AUNTROcnJ9IOqRUOX14aVMoPwAKVuZ8KKjcMUUw4PgZVEiuvgzI8cdc/KmR ID7Q== ARC-Authentication-Results: i=1; mx.google.com; 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 e21si866134ejt.77.2019.11.13.02.12.57; Wed, 13 Nov 2019 02:13:21 -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; 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 S1727515AbfKMKMV (ORCPT + 99 others); Wed, 13 Nov 2019 05:12:21 -0500 Received: from mx2.suse.de ([195.135.220.15]:39804 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726389AbfKMKMU (ORCPT ); Wed, 13 Nov 2019 05:12:20 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 826B9B3ED; Wed, 13 Nov 2019 10:12:15 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id CA3AA1E1498; Wed, 13 Nov 2019 11:12:10 +0100 (CET) Date: Wed, 13 Nov 2019 11:12:10 +0100 From: Jan Kara To: John Hubbard Cc: Daniel Vetter , Jason Gunthorpe , Andrew Morton , Al Viro , Alex Williamson , Benjamin Herrenschmidt , =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , Christoph Hellwig , Dan Williams , Dave Chinner , David Airlie , "David S . Miller" , Ira Weiny , Jan Kara , 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 , dri-devel , kvm@vger.kernel.org, linux-block@vger.kernel.org, Linux Doc Mailing List , linux-fsdevel@vger.kernel.org, "open list:KERNEL SELFTEST FRAMEWORK" , "open list:DMA BUFFER SHARING FRAMEWORK" , linux-rdma@vger.kernel.org, linuxppc-dev , netdev , Linux MM , LKML Subject: Re: [PATCH v3 00/23] mm/gup: track dma-pinned pages: FOLL_PIN, FOLL_LONGTERM Message-ID: <20191113101210.GD6367@quack2.suse.cz> References: <20191112000700.3455038-1-jhubbard@nvidia.com> <20191112203802.GD5584@ziepe.ca> <02fa935c-3469-b766-b691-5660084b60b9@nvidia.com> <7b671bf9-4d94-f2cc-8453-863acd5a1115@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7b671bf9-4d94-f2cc-8453-863acd5a1115@nvidia.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 13-11-19 01:02:02, John Hubbard wrote: > 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... FWIW I'd find unpin_user_page() also better than put_user_page() as a counterpart to pin_user_pages(). Honza -- Jan Kara SUSE Labs, CR