We currently have three near-identical implementations of the set_page_dirty address_space op: __set_page_dirty_no_writeback added 2007 by Ken Chen (767193253bba) (return value fixed by Bob Liu in 2011 (c3f0da631539)) anon_set_page_dirty added 2009 by Peter Zijlstra (d3a9262e59f7) noop_set_page_dirty added 2018 by Dan Williams (f44c77630d26) I persuaded Mike to remove hugetlbfs_set_page_dirty and Daniel Vetter to remove fb_deferred_io_set_page_dirty (in -next) so we're down from five to three. I'd like to get it down to zero. After all, the !mapping case in set_page_dirty() is exactly what we want. So is there a problem with doing this? +++ b/mm/page-writeback.c @@ -2562 +2562 @@ int set_page_dirty(struct page *page) - if (likely(mapping)) { + if (likely(mapping && mapping_can_writeback(mapping))) { But then I noticed that we have both mapping_can_writeback() and mapping_use_writeback_tags(), and I'm no longer sure which one to use. Also, why don't we mirror the results of inode_to_bdi(mapping->host)->capabilities & BDI_CAP_WRITEBACK into a mapping->flags & AS_something bit? We have lots available, and inode_to_bdi seems relatively complicated to be a static inline that gets evaluated every time we call pagecache_get_page(FGP_CREAT | FGP_WRITE).