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

From: NeilBrown
Date: Tue Nov 16 2021 - 16:35:32 EST


On Tue, 16 Nov 2021, Christoph Hellwig wrote:
> 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.

Yes, that's a good idea. Something like this....

Thanks,
NeilBrown