Re: [PATCH 03/13] MM: reclaim mustn't enter FS for swap-over-NFS

From: Christoph Hellwig
Date: Tue Nov 16 2021 - 03:32:59 EST


On Tue, Nov 16, 2021 at 01:44:04PM +1100, NeilBrown wrote:
> + /* ->flags can be updated non-atomicially (scan_swap_map_slots),
> + * but that will never affect SWP_FS_OPS, so the data_race
> + * is safe.
> + */
> may_enter_fs = (sc->gfp_mask & __GFP_FS) ||
> + (PageSwapCache(page) &&
> + !data_race(page_swap_info(page)->flags & SWP_FS_OPS) &&
> + (sc->gfp_mask & __GFP_IO));

You might want to move the comment and SWP_FS_OPS into a little
inline helper. That makes it a lot more readable and also avoids the
overly long line in the second hunk.