On Tue, 01 Feb 2022, Matthew Wilcox wrote: > On Mon, Jan 31, 2022 at 03:55:22PM +1100, NeilBrown wrote: > > On Mon, 31 Jan 2022, Matthew Wilcox wrote: > > > On Mon, Jan 31, 2022 at 03:03:53PM +1100, NeilBrown wrote: > > > > - .writepage to return AOP_WRITEPAGE_ACTIVATE if WB_SYNC_NONE > > > > and the flag is set. > > > > > > Is this actually useful? I ask because Dave Chinner believes > > > the call to ->writepage in vmscan to be essentially unused. > > > > He would be wrong ... unless "essentially" means "mostly" rather than > > "totally". > > swap-out to NFS results in that ->writepage call. > > For writes, SWP_FS_OPS uses ->direct_IO, not ->writepage. Confused. > I shouldn't have mentioned NFS - that is an irrelevant distraction. The "call to ->writepage in vmscan" is used, at least for swap. For swapout it is the ->writepage from swap_aops, not the ->writepage of any filesystem. This is swap_writepage(), and for SWP_FS_OPS that maps to a ->direct_IO call. Dave may well be right that the ->writepage in vmscan never calls xfs_writepage or many others. To get to the ->writepage of a filesystem it would need to be called from kswapd. You would need to have no swap configured, and 90% of memory consumed with anon pages so that the dirty_background_ratio of 10% didn't kick off writeback. Then I would expect to kswapd to write out to a filesystem before writeback would do it. Nonetheless, without clear evidence to the contrary, I think it is safest to add this test to the ->writepage function for any filesystem which currently sets the bdi async congested flag. Thanks, NeilBrown