[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bf3edf11-02d1-128c-ebc0-11bb38404ac9@nvidia.com>
Date: Thu, 26 Jan 2023 14:49:17 -0800
From: John Hubbard <jhubbard@...dia.com>
To: Al Viro <viro@...iv.linux.org.uk>,
David Howells <dhowells@...hat.com>
CC: Christoph Hellwig <hch@...radead.org>,
Matthew Wilcox <willy@...radead.org>,
Jens Axboe <axboe@...nel.dk>, Jan Kara <jack@...e.cz>,
Jeff Layton <jlayton@...nel.org>,
David Hildenbrand <david@...hat.com>,
"Jason Gunthorpe" <jgg@...dia.com>,
Logan Gunthorpe <logang@...tatee.com>,
<linux-fsdevel@...r.kernel.org>, <linux-block@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linux-mm@...ck.org>,
Christoph Hellwig <hch@....de>
Subject: Re: [PATCH v11 2/8] iov_iter: Add a function to extract a page list
from an iterator
On 1/26/23 14:36, Al Viro wrote:
...
>>> +static inline bool iov_iter_extract_will_pin(const struct iov_iter *iter)
>>> +{
>>> + return user_backed_iter(iter);
>>> +}
>>> +
>>
>> Wait a sec; why would we want a pin for pages we won't be modifying?
>> A reference - sure, but...
>
> After having looked through the earlier iterations of the patchset -
> sorry, but that won't fly for (at least) vmsplice(). There we can't
> pin those suckers; thankfully, we don't need to - they are used only
> for fetches, so FOLL_GET is sufficient. With your "we'll just pin them,
> source or destination" you won't be able to convert at least that
> call of iov_iter_get_pages2(). And there might be other similar cases;
> I won't swear there's more, but ISTR running into more than one of
> the "pin won't be OK here, but fortunately it's a data source" places.
Assuming that "page is a data source" means that we are writing out from
the page to a block device (so, a WRITE operation, which of course
actually *reads* from the page), then...
...one thing I'm worried about now is whether Jan's original problem
report [1] can be fixed, because that involves page writeback. And it
seems like we need to mark the pages involved as "maybe dma-pinned" via
FOLL_PIN pins, in order to solve it.
Or am I missing a key point (I hope)?
[1] https://lore.kernel.org/linux-mm/20180103100430.GE4911@quack2.suse.cz/T/#u
thanks,
--
John Hubbard
NVIDIA
Powered by blists - more mailing lists