Re: [PATCH 03/12] writeback: Factor should_writeback_folio() out of write_cache_pages()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux