[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <345f3293-51fd-1f2c-9d6a-7e6e8950102d@nvidia.com>
Date: Sat, 27 Aug 2022 18:07:48 -0700
From: John Hubbard <jhubbard@...dia.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Jens Axboe <axboe@...nel.dk>,
Alexander Viro <viro@...iv.linux.org.uk>,
Miklos Szeredi <miklos@...redi.hu>,
Christoph Hellwig <hch@...radead.org>,
"Darrick J . Wong" <djwong@...nel.org>,
Trond Myklebust <trond.myklebust@...merspace.com>,
Anna Schumaker <anna@...nel.org>, Jan Kara <jack@...e.cz>,
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 2/6] block: add dio_w_*() wrappers for pin, unpin user
pages
On 8/27/22 17:31, John Hubbard wrote:
> On 8/27/22 17:12, Andrew Morton wrote:
>> On Sat, 27 Aug 2022 16:59:32 -0700 John Hubbard <jhubbard@...dia.com> wrote:
>>
>>> Anyway, I'll change my patch locally for now, to this:
>>>
>>> static inline void dio_w_unpin_user_pages(struct page **pages,
>>> unsigned long npages)
>>> {
>>> /* Careful, release_pages() uses a smaller integer type for npages: */
>>> if (WARN_ON_ONCE(npages > (unsigned long)INT_MAX))
>>> return;
>>>
>>> release_pages(pages, (int)npages);
>>> }
>>
>> Well, it might be slower. release_pages() has a ton of fluff.
>>
>> As mentioned, the above might be faster if the pages tend
>> to have page_count()==1??
>>
>
> I don't think we can know the answer to that. This code is called
To clarify: I mean, I don't think we can know whether or not these pages
usually have page_count()==1.
thanks,
--
John Hubbard
NVIDIA
Powered by blists - more mailing lists