[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5c6b9c45-25fd-4a6a-bfcd-781431f5c6e0@kernel.dk>
Date: Fri, 15 Nov 2024 08:01:34 -0700
From: Jens Axboe <axboe@...nel.dk>
To: "Kirill A. Shutemov" <kirill@...temov.name>
Cc: linux-mm@...ck.org, linux-fsdevel@...r.kernel.org, hannes@...xchg.org,
clm@...a.com, linux-kernel@...r.kernel.org, willy@...radead.org,
linux-btrfs@...r.kernel.org, linux-ext4@...r.kernel.org,
linux-xfs@...r.kernel.org, bfoster@...hat.com
Subject: Re: [PATCH 08/17] mm/filemap: add read support for RWF_UNCACHED
On 11/15/24 1:49 AM, Kirill A. Shutemov wrote:
> On Thu, Nov 14, 2024 at 08:25:12AM -0700, Jens Axboe wrote:
>> @@ -2595,6 +2601,20 @@ static inline bool pos_same_folio(loff_t pos1, loff_t pos2, struct folio *folio)
>> return (pos1 >> shift == pos2 >> shift);
>> }
>>
>> +static void filemap_uncached_read(struct address_space *mapping,
>> + struct folio *folio)
>> +{
>> + if (!folio_test_uncached(folio))
>> + return;
>> + if (folio_test_writeback(folio))
>> + return;
>
> Do we want to drop out here if the folio is dirty, but not yet under
> writeback?
>
> It is checked inside folio_unmap_invalidate(), but we will lose
> PG_uncached if we get there.
True, seems prudent to skip if it's dirty as well, if only to avoid
losing uncached for that particular case. I'll add the tweak, thanks.
--
Jens Axboe
Powered by blists - more mailing lists