[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201027093301.GA16090@quack2.suse.cz>
Date: Tue, 27 Oct 2020 10:33:01 +0100
From: Jan Kara <jack@...e.cz>
To: John Hubbard <jhubbard@...dia.com>
Cc: Jason Gunthorpe <jgg@...dia.com>, linux-kernel@...r.kernel.org,
Andrea Arcangeli <aarcange@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Christoph Hellwig <hch@....de>,
Hugh Dickins <hughd@...gle.com>, Jan Kara <jack@...e.cz>,
Jann Horn <jannh@...gle.com>,
Kirill Shutemov <kirill@...temov.name>,
Kirill Tkhai <ktkhai@...tuozzo.com>,
Linux-MM <linux-mm@...ck.org>, Michal Hocko <mhocko@...e.com>,
Oleg Nesterov <oleg@...hat.com>, Peter Xu <peterx@...hat.com>
Subject: Re: [PATCH 1/2] mm: reorganize internal_get_user_pages_fast()
On Fri 23-10-20 21:44:17, John Hubbard wrote:
> On 10/23/20 5:19 PM, Jason Gunthorpe wrote:
> > + start += (unsigned long)nr_pinned << PAGE_SHIFT;
> > + pages += nr_pinned;
> > + ret = __gup_longterm_unlocked(start, nr_pages - nr_pinned, gup_flags,
> > + pages);
> > + if (ret < 0) {
> > /* Have to be a bit careful with return values */
>
> ...and can we move that comment up one level, so that it reads:
>
> /* Have to be a bit careful with return values */
> if (ret < 0) {
> if (nr_pinned)
> return nr_pinned;
> return ret;
> }
> return ret + nr_pinned;
>
> Thinking about this longer term, it would be nice if the whole gup/pup API
> set just stopped pretending that anyone cares about partial success, because
> they *don't*. If we had return values of "0 or -ERRNO" throughout, and an
> additional set of API wrappers that did some sort of limited retry just like
> some of the callers do, that would be a happier story.
Actually there are callers that care about partial success. See e.g.
iov_iter_get_pages() usage in fs/direct_io.c:dio_refill_pages() or
bio_iov_iter_get_pages(). These places handle partial success just fine and
not allowing partial success from GUP could regress things...
Honza
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists