Re: [RFC PATCH 34/40] btrfs: allocate eb-attached btree pages as movable
From: Christoph Hellwig
Date: Mon May 25 2026 - 02:58:03 EST
On Sun, May 24, 2026 at 08:59:09PM +0100, Matthew Wilcox wrote:
> Every use of GFP_NOFS is a bad code smell. Filesystems should be using
> memalloc_nofs_save/restore. The problem is that it takes deep filesystem
> knowledge to understand where the memalloc_nofs_save() should start.
> It would be good to lift the GFP_NOFS to the callers of this function as
> it gets us slightly closer to being able to replace it with GFP_KERNEL
> in the places it's not actually needed.
>
> ie what I'm asking for is, please don't do the 'extra_gfp' thing.
> Just pass in gfp from the callers and make them all pass in GFP_NOFS |
> __GFP_MOVABLE (or a plain GFP_NOFS) for now. Someone can come along
> later and change them to GFP_KERNEL later where warranted.
Note that is should be pretty trivial to just bubble it up a layer
for changes like this. This will naturally gravitate to more useful
places. To make it fully correct it will need manual intervention,
but generally bubbling up should improve the situation.
Same for GFP_NOIO.