Dear f2fs developers, I am writing to discuss a potential issue regarding the dirty_folio implementation in f2fs and its potential impact on write amplification.
Currently, the f2fs implementation of dirty_folio within address_space_operations relies on filemap_dirty_folio. As filemap_dirty_folio marks the entire folio as dirty, this means that during dirty page writeback, if only a single page within a folio has been modified, the entire folio will still be written back to storage. This behavior can lead to write amplification. For f2fs, a log-structured file system, this write amplification issue is particularly concerning. It not only degrades writeback I/O performance but also results in more data blocks being appended to the end of the disk, accelerating the frequency of garbage collection and potentially shortening the lifespan of flash memory. Unlike ext4, f2fs lacks a buffer_head-like per-block data structure. Therefore, the block_dirty_folio approach used by ext4 to mitigate this issue is not directly applicable to f2fs. I have been considering potential solutions to address this. Two approaches I've explored are: Either modifying the f2fs dirty page writeback function to manually mark individual sub-pages within a folio as dirty, rather than relying on the folio-level dirty flag. Or utilizing the per-block dirty state tracking feature introduced in kernel 6.6 within the iomap framework. This would involve using the iomap_folio_state structure to track the dirty status of each block within a folio. I would greatly appreciate it if you could share your insights and perspectives on this issue and the proposed solutions. Any feedback or alternative suggestions would be highly valuable. Best regards. _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel