Re: [RFC PATCH 34/40] btrfs: allocate eb-attached btree pages as movable
From: Rik van Riel
Date: Sat May 23 2026 - 21:44:11 EST
On Sat, 2026-05-23 at 17:58 +0200, David Sterba wrote:
> On Wed, May 20, 2026 at 10:47:49AM -0700, Boris Burkov wrote:
> > > @@ -689,14 +704,23 @@ int btrfs_alloc_page_array(unsigned int
> > > nr_pages, struct page **page_array,
> > > * Populate needed folios for the extent buffer.
> > > *
> > > * For now, the folios populated are always in order 0 (aka,
> > > single page).
> > > + *
> > > + * @movable: pass true only when the resulting pages will be
> > > attached to
> > > + * btree_inode->i_mapping (the alloc_extent_buffer
> > > real path).
> > > + * Cloned/dummy extent buffers
> > > (EXTENT_BUFFER_UNMAPPED) leave
> > > + * folio->mapping NULL, never enter the LRU, and never
> > > get the
> > > + * btree_migrate_folio aops, so __GFP_MOVABLE would
> > > violate the
> > > + * page-allocator's migrability contract for them.
> > > */
> >
> > My gut says it is nicer to just transparently pass along a gfp flag
> > rather than a carefully documented movable boolean and let the
> > callers
> > do the right thing. Just a nit, I don't care strongly about it.
>
> Agreed, the GFP flags would be better and also a bit more self
> documenting where the functions are called. The patch is not
> standalone
> so I don't mind having the booleans, we can clean it up later to let
> the
> 40-patch series proceed.
I think this patch could go in by itself. It doesn't
depend on anything else in the series.
I sent it with this series mostly because it's needed
to make the series work, and to provide context on why
it's needed.
I'm happy to resend it with a GFP mask passed in by
each caller. That would look better, indeed!
I'll send you guys a cleaned up patch this coming week.
--
All Rights Reversed.