linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: John Hubbard <jhubbard@nvidia.com>
To: Souptick Joarder <jrdr.linux@gmail.com>, Jan Kara <jack@suse.cz>
Cc: "Tony Luck" <tony.luck@intel.com>,
	fenghua.yu@intel.com, "Rob Springer" <rspringer@google.com>,
	"Todd Poynor" <toddpoynor@google.com>,
	benchan@chromium.org, "Greg KH" <gregkh@linuxfoundation.org>,
	"Jens Wiklander" <jens.wiklander@linaro.org>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	santosh.shilimkar@oracle.com,
	"David S. Miller" <davem@davemloft.net>,
	kuba@kernel.org, "Ira Weiny" <ira.weiny@intel.com>,
	"Jérôme Glisse" <jglisse@redhat.com>,
	inux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org,
	"open list:ANDROID DRIVERS" <devel@driverdev.osuosl.org>,
	tee-dev@lists.linaro.org, Linux-MM <linux-mm@kvack.org>,
	netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	rds-devel@oss.oracle.com
Subject: Re: [RFC] mm/gup.c: Updated return value of {get|pin}_user_pages_fast()
Date: Thu, 7 May 2020 11:44:23 -0700	[thread overview]
Message-ID: <03bbc0f3-8edc-6110-6391-e540f773954c@nvidia.com> (raw)
In-Reply-To: <CAFqt6zZ2pj_6q=5kf9dxOsSkHc7vJEHgCjuRmSELQF9KnoKCxA@mail.gmail.com>

On 2020-05-07 03:32, Souptick Joarder wrote:
...
>> OK, so no real problem with any of these callers. I still don't see a
>> justification for the churn you suggest... Auditting all those code sites
>> is going to be pretty tedious.
> 
> I try to audit all 42 callers of {get|pin}_user_pages_fast() and
> figure out these 5 callers
> which need to be updated and I think, other callers of
> {get|pin}_user_pages_fast() will not be
> effected.
> 
> But I didn't go through other variants of gup/pup except
> {get|pin}_user_pages_fast().


I feel the need to apologize for suggesting that a change to -EINVAL
would help. :)

If you change what the return value means, but only apply it the
gup/pup _fast() variants of this API set, that would make
the API significantly *worse*.

Also, no one has been able to come up with a scenario in which the call
sites actually have a problem handling return values of zero. In fact,
on the contrary: there are call site where returning 0 after being
requested to pin zero pages, helps simplify the code. For example, if
they're just doing math such as "if(nr_expected != nr_pages_pinned) ...".


This looks like a complete dead end, sorry.

thanks,
-- 
John Hubbard
NVIDIA


      reply	other threads:[~2020-05-07 18:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05 19:14 [RFC] mm/gup.c: Updated return value of {get|pin}_user_pages_fast() Souptick Joarder
2020-05-05 19:38 ` John Hubbard
2020-05-05 20:36   ` Souptick Joarder
2020-05-05 20:52     ` John Hubbard
2020-05-06 10:06     ` Jan Kara
2020-05-06 12:21       ` Souptick Joarder
2020-05-06 12:59         ` Jan Kara
2020-05-06 16:08           ` Souptick Joarder
2020-05-07 10:13             ` Jan Kara
2020-05-07 10:32               ` Souptick Joarder
2020-05-07 18:44                 ` John Hubbard [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=03bbc0f3-8edc-6110-6391-e540f773954c@nvidia.com \
    --to=jhubbard@nvidia.com \
    --cc=akpm@linux-foundation.org \
    --cc=benchan@chromium.org \
    --cc=davem@davemloft.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=fenghua.yu@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=inux-ia64@vger.kernel.org \
    --cc=ira.weiny@intel.com \
    --cc=jack@suse.cz \
    --cc=jens.wiklander@linaro.org \
    --cc=jglisse@redhat.com \
    --cc=jrdr.linux@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rds-devel@oss.oracle.com \
    --cc=rspringer@google.com \
    --cc=santosh.shilimkar@oracle.com \
    --cc=tee-dev@lists.linaro.org \
    --cc=toddpoynor@google.com \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).