[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6507b474-6f91-f99d-1dff-d7c21462813e@gmail.com>
Date: Fri, 11 Dec 2020 15:47:23 +0000
From: Pavel Begunkov <asml.silence@...il.com>
To: Johannes Weiner <hannes@...xchg.org>
Cc: Christoph Hellwig <hch@...radead.org>,
Jens Axboe <axboe@...nel.dk>,
Alexander Viro <viro@...iv.linux.org.uk>,
linux-fsdevel@...r.kernel.org, io-uring@...r.kernel.org,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
Matthew Wilcox <willy@...radead.org>
Subject: Re: [PATCH 2/2] block: no-copy bvec for direct IO
On 11/12/2020 15:38, Johannes Weiner wrote:
> On Fri, Dec 11, 2020 at 02:20:11PM +0000, Pavel Begunkov wrote:
>> On 11/12/2020 14:06, Johannes Weiner wrote:
>>> On Wed, Dec 09, 2020 at 08:40:05AM +0000, Christoph Hellwig wrote:
>>>>> + /*
>>>>> + * In practice groups of pages tend to be accessed/reclaimed/refaulted
>>>>> + * together. To not go over bvec for those who didn't set BIO_WORKINGSET
>>>>> + * approximate it by looking at the first page and inducing it to the
>>>>> + * whole bio
>>>>> + */
>>>>> + if (unlikely(PageWorkingset(iter->bvec->bv_page)))
>>>>> + bio_set_flag(bio, BIO_WORKINGSET);
>>>>
>>>> IIRC the feedback was that we do not need to deal with BIO_WORKINGSET
>>>> at all for direct I/O.
>>>
>>> Yes, this hunk is incorrect. We must not use this flag for direct IO.
>>> It's only for paging IO, when you bring in the data at page->mapping +
>>> page->index. Otherwise you tell the pressure accounting code that you
>>> are paging in a thrashing page, when really you're just reading new
>>> data into a page frame that happens to be hot.
>>>
>>> (As per the other thread, bio_add_page() currently makes that same
>>> mistake for direct IO. I'm fixing that.)
>>
>> I have that stuff fixed, it just didn't go into the RFC. That's basically
>> removing replacing add_page() with its version without BIO_WORKINGSET
I wrote something strange... Should have been "replacing add_page() in
those functions with a version without BIO_WORKINGSET".
>> in bio_iov_iter_get_pages() and all __bio_iov_*_{add,get}_pages() +
>> fix up ./fs/direct-io.c. Should cover all direct cases if I didn't miss
>> some.
>
> Ah, that's fantastic! Thanks for clarifying.
To keep it clear, do we go with what I have stashed (I'm planning to
reiterate this weekend)? or you're going to write it up yourself?
Just in case there is some cooler way you have in mind :)
--
Pavel Begunkov
Powered by blists - more mailing lists