On Mon, Jan 24, 2022 at 02:48:32PM +1100, NeilBrown wrote: > If swap-out is using filesystem operations (SWP_FS_OPS), then it is not > safe to enter the FS for reclaim. > So only down-grade the requirement for swap pages to __GFP_IO after > checking that SWP_FS_OPS are not being used. > > This makes the calculation of "may_enter_fs" slightly more complex, so > move it into a separate function. with that done, there is little value > in maintaining the bool variable any more. So replace the > may_enter_fs variable with a may_enter_fs() function. This removes any > risk for the variable becoming out-of-date. Looks good, Reviewed-by: Christoph Hellwig <hch@xxxxxx>