[PATCH 0/9] Remove FGP_NOFS

From: Matthew Wilcox (Oracle)

Date: Sun Aug 30 2026 - 00:21:06 EST


There is broad agreement that we should eliminate __GFP_FS in favour of
using memalloc_nofs_save(). This is a small step in that direction by
getting rid of FGP_NOFS. It's also a nice simplification in its own right.

I added the documentation improvement at the start of this series, not
because anything depends on that (obviously it doesn't), but because
I thought the existing documentation was rather MM centric and it needs
to be FS centric. Hopefully the cc'd filesystem maintainers will have
the chance to look at patch 1 and see if it makes sense to them.

There's a few different solutions here:

- Filesystems specifying both FGP_NOWAIT and FGP_NOFS. If you're not
waiting, it doesn't matter if you're allowed to reclaim from FS
context or not, you're just not doing reclaim.
- We're already under memalloc_nofs.
- We can prove that the MM should be allowed to reclaim from
filesystem memory (and so specifying FGP_NOFS was wrong).
- We can add a call to memalloc_nofs_save().

Matthew Wilcox (Oracle) (9):
mm: Improve memalloc_nofs_save() documentation
ext4: Remove uses of FGP_NOFS
erofs: Remove redundant FGP_NOFS
nfs: Remove redundant FGP_NOFS
ntfs: Remove FGP_NOFS from __ntfs_inode_resident_attr_pwrite()
ntfs: Remove redundant FGP_NOFS from ntfs_wof_collect_dest()
squashfs: Remove use of FGP_NOFS
filemap: Remove redundant FGP_NOFS
filemap: Remove FGP_NOFS

fs/erofs/internal.h | 2 +-
fs/ext4/inline.c | 6 ++----
fs/nfs/dir.c | 2 +-
fs/ntfs/inode.c | 2 +-
fs/ntfs/wof.c | 7 +++----
fs/squashfs/file.c | 5 ++++-
include/linux/pagemap.h | 12 +++++-------
include/linux/sched/mm.h | 31 +++++++++++++++++++++++--------
mm/filemap.c | 2 --
mm/readahead.c | 14 ++------------
10 files changed, 42 insertions(+), 41 deletions(-)

--
2.47.3