The patch titled Subject: nilfs2: convert metadata aops from writepage to writepages has been added to the -mm mm-nonmm-unstable branch. Its filename is nilfs2-convert-metadata-aops-from-writepage-to-writepages.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/nilfs2-convert-metadata-aops-from-writepage-to-writepages.patch This patch will later appear in the mm-nonmm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: "Matthew Wilcox (Oracle)" <willy@xxxxxxxxxxxxx> Subject: nilfs2: convert metadata aops from writepage to writepages Date: Thu, 24 Oct 2024 18:25:46 +0900 By implementing ->writepages instead of ->writepage, we remove a layer of indirect function calls from the writeback path and the last use of struct page in nilfs2. [konishi.ryusuke@xxxxxxxxx: fixed panic by using buffer_migrate_folio_norefs] Link: https://lkml.kernel.org/r/20241002150036.1339475-5-willy@xxxxxxxxxxxxx Link: https://lkml.kernel.org/r/20241024092602.13395-13-konishi.ryusuke@xxxxxxxxx Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> Signed-off-by: Ryusuke Konishi <konishi.ryusuke@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/nilfs2/mdt.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) --- a/fs/nilfs2/mdt.c~nilfs2-convert-metadata-aops-from-writepage-to-writepages +++ a/fs/nilfs2/mdt.c @@ -399,10 +399,9 @@ int nilfs_mdt_fetch_dirty(struct inode * return test_bit(NILFS_I_DIRTY, &ii->i_state); } -static int -nilfs_mdt_write_page(struct page *page, struct writeback_control *wbc) +static int nilfs_mdt_write_folio(struct folio *folio, + struct writeback_control *wbc) { - struct folio *folio = page_folio(page); struct inode *inode = folio->mapping->host; struct super_block *sb; int err = 0; @@ -435,11 +434,23 @@ nilfs_mdt_write_page(struct page *page, return err; } +static int nilfs_mdt_writeback(struct address_space *mapping, + struct writeback_control *wbc) +{ + struct folio *folio = NULL; + int error; + + while ((folio = writeback_iter(mapping, wbc, folio, &error))) + error = nilfs_mdt_write_folio(folio, wbc); + + return error; +} static const struct address_space_operations def_mdt_aops = { .dirty_folio = block_dirty_folio, .invalidate_folio = block_invalidate_folio, - .writepage = nilfs_mdt_write_page, + .writepages = nilfs_mdt_writeback, + .migrate_folio = buffer_migrate_folio_norefs, }; static const struct inode_operations def_mdt_iops; _ Patches currently in -mm which might be from willy@xxxxxxxxxxxxx are ksm-use-a-folio-in-try_to_merge_one_page.patch ksm-convert-cmp_and_merge_page-to-use-a-folio.patch ksm-convert-should_skip_rmap_item-to-take-a-folio.patch mm-add-pageanonnotksm.patch mm-add-pageanonnotksm-fix.patch mm-remove-pageksm.patch gup-convert-foll_touch-case-in-follow_page_pte-to-folio.patch mm-convert-page_to_pgoff-to-page_pgoff.patch mm-use-page_pgoff-in-more-places.patch mm-renovate-page_address_in_vma.patch mm-mass-constification-of-folio-page-pointers.patch bootmem-stop-using-page-index.patch mm-remove-references-to-page-index-in-huge_memoryc.patch mm-use-page-private-instead-of-page-index-in-percpu.patch nilfs2-remove-nilfs_writepage.patch nilfs2-convert-nilfs_page_count_clean_buffers-to-take-a-folio.patch nilfs2-convert-nilfs_recovery_copy_block-to-take-a-folio.patch nilfs2-convert-metadata-aops-from-writepage-to-writepages.patch