Re: [RFC PATCH 34/40] btrfs: allocate eb-attached btree pages as movable
From: David Sterba
Date: Sat May 23 2026 - 11:59:12 EST
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.