The patch titled Subject: fs: remove noop_set_page_dirty() has been added to the -mm tree. Its filename is fs-remove-noop_set_page_dirty.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/fs-remove-noop_set_page_dirty.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/fs-remove-noop_set_page_dirty.patch 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 and is updated there every 3-4 working days ------------------------------------------------------ From: "Matthew Wilcox (Oracle)" <willy@xxxxxxxxxxxxx> Subject: fs: remove noop_set_page_dirty() Use __set_page_dirty_no_writeback() instead. This will set the dirty bit on the page, which will be used to avoid calling set_page_dirty() in the future. It will have no effect on actually writing the page back, as the pages are not on any LRU lists. Link: https://lkml.kernel.org/r/20210615162342.1669332-6-willy@xxxxxxxxxxxxx Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx> Cc: Christoph Hellwig <hch@xxxxxx> Cc: Dan Williams <dan.j.williams@xxxxxxxxx> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Cc: Jan Kara <jack@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/dax/device.c | 2 +- fs/ext2/inode.c | 2 +- fs/ext4/inode.c | 2 +- fs/fuse/dax.c | 2 +- fs/libfs.c | 16 ---------------- fs/xfs/xfs_aops.c | 2 +- include/linux/fs.h | 1 - 7 files changed, 5 insertions(+), 22 deletions(-) --- a/drivers/dax/device.c~fs-remove-noop_set_page_dirty +++ a/drivers/dax/device.c @@ -337,7 +337,7 @@ static unsigned long dax_get_unmapped_ar } static const struct address_space_operations dev_dax_aops = { - .set_page_dirty = noop_set_page_dirty, + .set_page_dirty = __set_page_dirty_no_writeback, .invalidatepage = noop_invalidatepage, }; --- a/fs/ext2/inode.c~fs-remove-noop_set_page_dirty +++ a/fs/ext2/inode.c @@ -992,7 +992,7 @@ const struct address_space_operations ex static const struct address_space_operations ext2_dax_aops = { .writepages = ext2_dax_writepages, .direct_IO = noop_direct_IO, - .set_page_dirty = noop_set_page_dirty, + .set_page_dirty = __set_page_dirty_no_writeback, .invalidatepage = noop_invalidatepage, }; --- a/fs/ext4/inode.c~fs-remove-noop_set_page_dirty +++ a/fs/ext4/inode.c @@ -3701,7 +3701,7 @@ static const struct address_space_operat static const struct address_space_operations ext4_dax_aops = { .writepages = ext4_dax_writepages, .direct_IO = noop_direct_IO, - .set_page_dirty = noop_set_page_dirty, + .set_page_dirty = __set_page_dirty_no_writeback, .bmap = ext4_bmap, .invalidatepage = noop_invalidatepage, .swap_activate = ext4_iomap_swap_activate, --- a/fs/fuse/dax.c~fs-remove-noop_set_page_dirty +++ a/fs/fuse/dax.c @@ -1329,7 +1329,7 @@ bool fuse_dax_inode_alloc(struct super_b static const struct address_space_operations fuse_dax_file_aops = { .writepages = fuse_dax_writepages, .direct_IO = noop_direct_IO, - .set_page_dirty = noop_set_page_dirty, + .set_page_dirty = __set_page_dirty_no_writeback, .invalidatepage = noop_invalidatepage, }; --- a/fs/libfs.c~fs-remove-noop_set_page_dirty +++ a/fs/libfs.c @@ -1171,22 +1171,6 @@ int noop_fsync(struct file *file, loff_t } EXPORT_SYMBOL(noop_fsync); -int noop_set_page_dirty(struct page *page) -{ - /* - * Unlike __set_page_dirty_no_writeback that handles dirty page - * tracking in the page object, dax does all dirty tracking in - * the inode address_space in response to mkwrite faults. In the - * dax case we only need to worry about potentially dirty CPU - * caches, not dirty page cache pages to write back. - * - * This callback is defined to prevent fallback to - * __set_page_dirty_buffers() in set_page_dirty(). - */ - return 0; -} -EXPORT_SYMBOL_GPL(noop_set_page_dirty); - void noop_invalidatepage(struct page *page, unsigned int offset, unsigned int length) { --- a/fs/xfs/xfs_aops.c~fs-remove-noop_set_page_dirty +++ a/fs/xfs/xfs_aops.c @@ -575,7 +575,7 @@ const struct address_space_operations xf const struct address_space_operations xfs_dax_aops = { .writepages = xfs_dax_writepages, .direct_IO = noop_direct_IO, - .set_page_dirty = noop_set_page_dirty, + .set_page_dirty = __set_page_dirty_no_writeback, .invalidatepage = noop_invalidatepage, .swap_activate = xfs_iomap_swapfile_activate, }; --- a/include/linux/fs.h~fs-remove-noop_set_page_dirty +++ a/include/linux/fs.h @@ -3418,7 +3418,6 @@ extern int simple_rename(struct user_nam extern void simple_recursive_removal(struct dentry *, void (*callback)(struct dentry *)); extern int noop_fsync(struct file *, loff_t, loff_t, int); -extern int noop_set_page_dirty(struct page *page); extern void noop_invalidatepage(struct page *page, unsigned int offset, unsigned int length); extern ssize_t noop_direct_IO(struct kiocb *iocb, struct iov_iter *iter); _ Patches currently in -mm which might be from willy@xxxxxxxxxxxxx are mm-mark-idle-page-tracking-as-broken.patch writeback-cgroup-release-dying-cgwbs-by-switching-attached-inodes-fix-3.patch mm-writeback-move-__set_page_dirty-to-core-mm.patch mm-writeback-use-__set_page_dirty-in-__set_page_dirty_nobuffers.patch iomap-use-__set_page_dirty_nobuffers.patch fs-remove-anon_set_page_dirty.patch fs-remove-noop_set_page_dirty.patch mm-move-page-dirtying-prototypes-from-mmh.patch mm-make-__dump_page-static.patch mm-debug-factor-pagepoisoned-out-of-__dump_page.patch mm-page_owner-constify-dump_page_owner.patch mm-make-compound_head-const-preserving.patch mm-constify-get_pfnblock_flags_mask-and-get_pfnblock_migratetype.patch mm-constify-page_count-and-page_ref_count.patch mm-optimise-nth_page-for-contiguous-memmap.patch mm-hugetlb-free-the-vmemmap-pages-associated-with-each-hugetlb-page-fix.patch mm-hugetlb-alloc-the-vmemmap-pages-associated-with-each-hugetlb-page-fix-2.patch mm-thp-fix-strncpy-warning.patch