On Wed 09-04-25 18:49:44, Luis Chamberlain wrote: > From: Davidlohr Bueso <dave@xxxxxxxxxxxx> > > Add semantics to enable future optimizations for buffer head noref jbd2 > migration. This adds a new BH_Migrate flag which ensures we can bail > on the lookup path. This should enable jbd2 to get semantics of when > a buffer head is under folio migration, and should yield to it and to > eventually remove the buffer_meta() check skipping current jbd2 folio > migration. > > Suggested-by: Jan Kara <jack@xxxxxxx> > Co-developed-by: Luis Chamberlain <mcgrof@xxxxxxxxxx> > Signed-off-by: Davidlohr Bueso <dave@xxxxxxxxxxxx> > Signed-off-by: Luis Chamberlain <mcgrof@xxxxxxxxxx> .. > diff --git a/mm/migrate.c b/mm/migrate.c > index 32fa72ba10b4..8fed2655f2e8 100644 > --- a/mm/migrate.c > +++ b/mm/migrate.c > @@ -851,6 +851,8 @@ static int __buffer_migrate_folio(struct address_space *mapping, > bool busy; > bool invalidated = false; > > + VM_WARN_ON_ONCE(test_and_set_bit_lock(BH_Migrate, > + &head->b_state)); Careful here. This breaks the logic with !CONFIG_DEBUG_VM. Honza -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR