On Sun, Mar 30, 2025 at 10:38:37AM +0800, Nanzhe Zhao wrote: > 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.
Just so you know, the per-page dirty flag is not in fact per page. If you call SetPageDirty() on a tail page, it will set the dirty flag on the head page (ie the same bit that is used by folio_set_dirty()). This is intentional as we do not intend for there to be a per-page flags field in the future. > 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. The challenge with that is that iomap does not support all the functionality that f2fs requires. The iomap data structure could be duplicated inside f2fs, but then we hit the problem that f2fs currently stores other information in folio->private. So we'd need to add a flags field to iomap_folio_state to store that information instead. See the part of f2fs.h from PAGE_PRIVATE_GET_FUNC to the end of clear_page_private_all(). You're right that f2fs needs per-block dirty tracking if it is to support large folios. _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel