lkml.org 
[lkml]   [2023]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 03/12] writeback: Factor should_writeback_folio() out of write_cache_pages()
On Tue, Jun 27, 2023 at 12:16:34PM +0100, Matthew Wilcox wrote:
> This might be a good point to share that I'm considering (eventually)
> not taking the folio lock here.
>
> My plan looks something like this (not fully baked):
>
> truncation (and similar) paths currently lock the folio, They would both
> lock the folio _and_ claim that they were doing writeback on the folio.
>
> Filesystems would receive the folio from the writeback iterator with
> the writeback flag already set.
>
>
> This allows, eg, folio mapping/unmapping to take place completely
> independent of writeback. That seems like a good thing; I can't see
> why the two should be connected.

Ah, i_size is a problem. With an extending write, i_size is updated
while holding the folio lock. If we're writing back a partial folio,
we zero the tail. That must not race with an extending write. So
either we'd need to take both the folio lock & wb_lock when updating
i_size, or we'd need to take both the lock and wb_lock when writing
back the last page of a file.

\
 
 \ /
  Last update: 2023-06-27 16:52    [W:0.068 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site