[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <37817ef0-88d6-e12d-3576-50e79ef02883@nvidia.com>
Date: Tue, 6 Sep 2022 00:16:11 -0700
From: John Hubbard <jhubbard@...dia.com>
To: Christoph Hellwig <hch@...radead.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Jens Axboe <axboe@...nel.dk>,
Alexander Viro <viro@...iv.linux.org.uk>,
Miklos Szeredi <miklos@...redi.hu>,
"Darrick J . Wong" <djwong@...nel.org>,
Trond Myklebust <trond.myklebust@...merspace.com>,
Anna Schumaker <anna@...nel.org>, Jan Kara <jack@...e.cz>,
David Hildenbrand <david@...hat.com>,
Logan Gunthorpe <logang@...tatee.com>,
linux-block@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-xfs@...r.kernel.org, linux-nfs@...r.kernel.org,
linux-mm@...ck.org, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 6/7] NFS: direct-io: convert to FOLL_PIN pages
On 9/5/22 23:49, Christoph Hellwig wrote:
> On Tue, Aug 30, 2022 at 09:18:42PM -0700, John Hubbard wrote:
> static void nfs_direct_release_pages(struct iov_iter *iter, struct page **pages,
> unsigned int npages)
>> {
>> - unsigned int i;
>> - for (i = 0; i < npages; i++)
>> - put_page(pages[i]);
>> + if (user_backed_iter(iter) || iov_iter_is_bvec(iter))
>> + dio_w_unpin_user_pages(pages, npages);
>> + else
>> + release_pages(pages, npages);
>
> Instead of having this magic in all kinds of places, we need a helper
> that takes the page array, npages and iter->type and does the right
> thing.
Yes, Miklos asked for much the same thing, too. :)
thanks,
--
John Hubbard
NVIDIA
Powered by blists - more mailing lists