[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <07a6549a-6bbf-4e09-9e3b-128e779882a1@kernel.dk>
Date: Fri, 8 Nov 2024 12:25:35 -0700
From: Jens Axboe <axboe@...nel.dk>
To: Matthew Wilcox <willy@...radead.org>
Cc: linux-mm@...ck.org, linux-fsdevel@...r.kernel.org, hannes@...xchg.org,
clm@...a.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 08/13] fs: add read support for RWF_UNCACHED
On 11/8/24 11:33 AM, Matthew Wilcox wrote:
> On Fri, Nov 08, 2024 at 10:43:31AM -0700, Jens Axboe wrote:
>> +++ b/mm/swap.c
>> @@ -472,6 +472,8 @@ static void folio_inc_refs(struct folio *folio)
>> */
>> void folio_mark_accessed(struct folio *folio)
>> {
>> + if (folio_test_uncached(folio))
>> + return;
>> if (lru_gen_enabled()) {
>
> This feels like it might be a problem. If, eg, process A is doing
> uncached IO and process B comes along and, say, mmap()s it, I think
> we'll need to clear the uncached flag in order to have things work
> correctly. It's a performance problem, not a correctness problem.
I'll take a look, should be fine to just unconditionally clear it
here. uncached is a hint after all. We'll try our best to honor it,
but there will be cases where inline reclaim will fail and you'll
get cached contents, particularly if you mix uncached and buffered,
or uncached and mmap.
--
Jens Axboe
Powered by blists - more mailing lists