Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1745350ybc; Wed, 13 Nov 2019 03:44:40 -0800 (PST) X-Google-Smtp-Source: APXvYqxAvZlKvS1UcsYmyaAxZHnNzaRK3JEzzytHNuRlF7J8550Q60AETSjkobGHHP2L/DQlrgYt X-Received: by 2002:a17:907:2078:: with SMTP id qp24mr2229376ejb.157.1573645480302; Wed, 13 Nov 2019 03:44:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573645480; cv=none; d=google.com; s=arc-20160816; b=Wb0rMkGzYXDIL2pkfrnhXSaE1E26LmSTOEpUTqtbHsFlBJk6z9aUMSgMQm9dEkRHgi b0qd26MyI2oT7rrFi8cCvsGSmFDJzevSbVUhR6G0ca34/sRQVG4qfKXCWU0u/pXS1tft m97wU0OhPhU+VVflOiZu9zMbHcd/ZNooZ0b1tlnXR/4cXIzyBrf1zggyB5VythCX2qvc O6yrN62ww8baav3/ZbSo1QHH8WKrGOXSbHDYPkVRXEKz9rl7+YTKIZFOGSb4mv+8ebZI YdRmi0BQ7ZhEroT8jcFB8rj2Bw6pFwci7P1FCJ+lgSuu5Y1JryS10soR0oyPsICDIirU JK6g== 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:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=NWmx5zlrVzI636UV5zn7jwNNYyPpT2kzazOSeqZFCPQ=; b=t6squj2KYP+daN+eLm1lQyjNh2ccQYjavaJH4u7cgcJCwDZ+iHwGoRK5YDXCnbBipM a25Hsr2XbGWQYCMJt9H8I8SV+icPvvs1foZuIhicnV5XSg9c6Wa1F1L7MCRJPzWHfmL8 gE7lnQ35N8bkf8DfC88n6CKGHoTNYEvgHoXItlLt+JYgh3XC2EdGoJcmK29DQ9KMwaTK zX5RC0W6o9t9PnmZ0PlBRFaXijWWJHjZIHZoADjAEBGw7h+gJihj1rRzNuvPx1Y9vV9F UbLqWAqIIlCJfUnbNU9syODWEc83e388r06gc9VqSoUjmFbiw8dYao2G5OBrGkG4lbhl IwiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=C0Dbe7TC; 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 c13si1098666edv.320.2019.11.13.03.44.16; Wed, 13 Nov 2019 03:44:40 -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=fail header.i=@ffwll.ch header.s=google header.b=C0Dbe7TC; 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 S1727961AbfKMLnW (ORCPT + 99 others); Wed, 13 Nov 2019 06:43:22 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:42296 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727693AbfKMLnS (ORCPT ); Wed, 13 Nov 2019 06:43:18 -0500 Received: by mail-wr1-f65.google.com with SMTP id a15so1972680wrf.9 for ; Wed, 13 Nov 2019 03:43:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=NWmx5zlrVzI636UV5zn7jwNNYyPpT2kzazOSeqZFCPQ=; b=C0Dbe7TCduZqSim4I/9b7E74bGQO34GH/iKoO+dE+3EHLfWv1lLPGbvorBCoaRGMDb 48v7HTSQHP1LaVgvLNGy/yOxyJTlvTeKuq2CZR/Q7GIgmnQIbkvYhHi8TV/Ec+0WSA8P awH+k+k5IQBNK5RO6uqKbJl7dFmz19ED4sy2I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=NWmx5zlrVzI636UV5zn7jwNNYyPpT2kzazOSeqZFCPQ=; b=cFw6MFxdY0y4hXhuP6CsmSAOwIIWsLoeYTGSilxdGA9l5yJwL8Zd5lHzuuO0EmN/w/ vPySY05h/jcZTz9o8OH5zHqLqDOnXQ2yU9QGzvH/quvXqaBx0EXsBmodymKZwZnSkSAv Du8HXcJzAOqtkTi1IJG5+LGalSyjt5g+tuiAF4s/Az1Lzf8aKIEkRUHj8aBVINI4swyj ujBSMs1wvbl+dmVnqeLmSOWbwymbmUy1SmbhRX7QCo4p+wI1iPNGkn/keOtT8uYVMfay yaG1ZneRUsIi2HJf84mNKwGVEkf7FEqMoDqUlqmzVliBGFnadYHKEW9UIuQ7iqyH65RL TaZw== X-Gm-Message-State: APjAAAXScJkcfsPGxME2usrs4/dMM0qHGCP12fs2geycU6xgSwm1H3GE +0j8a5zJVHe6eOPZg6Wf3Dvikg== X-Received: by 2002:a5d:50ce:: with SMTP id f14mr2625324wrt.219.1573645394576; Wed, 13 Nov 2019 03:43:14 -0800 (PST) Received: from phenom.ffwll.local (212-51-149-96.fiber7.init7.net. [212.51.149.96]) by smtp.gmail.com with ESMTPSA id w4sm2544060wrs.1.2019.11.13.03.43.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2019 03:43:13 -0800 (PST) Date: Wed, 13 Nov 2019 12:43:11 +0100 From: Daniel Vetter To: Jan Kara Cc: John Hubbard , 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 , 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: <20191113114311.GP23790@phenom.ffwll.local> Mail-Followup-To: Jan Kara , John Hubbard , 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 , 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 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> <20191113101210.GD6367@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191113101210.GD6367@quack2.suse.cz> X-Operating-System: Linux phenom 5.2.0-3-amd64 User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 13, 2019 at 11:12:10AM +0100, Jan Kara wrote: > 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(). One more point from afar on pin/unpin: We use that a lot in graphics for permanently pinned graphics buffer objects. Which really only should be used for scanout. So at least graphics folks should have an appropriate mindset and try to make sure we don't overuse this stuff. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch