David Hildenbrand
2022-Jun-07 07:36 UTC
[Ocfs2-devel] [PATCH 15/20] balloon: Convert to migrate_folio
On 06.06.22 22:40, Matthew Wilcox (Oracle) wrote:> This is little more than changing the types over; there's no real work > being done in this function. > > Signed-off-by: Matthew Wilcox (Oracle) <willy at infradead.org> > --- > mm/balloon_compaction.c | 15 +++++++-------- > 1 file changed, 7 insertions(+), 8 deletions(-) > > diff --git a/mm/balloon_compaction.c b/mm/balloon_compaction.c > index 4b8eab4b3f45..3f75b876ad76 100644 > --- a/mm/balloon_compaction.c > +++ b/mm/balloon_compaction.c > @@ -230,11 +230,10 @@ static void balloon_page_putback(struct page *page) > > > /* move_to_new_page() counterpart for a ballooned page */ > -static int balloon_page_migrate(struct address_space *mapping, > - struct page *newpage, struct page *page, > - enum migrate_mode mode) > +static int balloon_migrate_folio(struct address_space *mapping, > + struct folio *dst, struct folio *src, enum migrate_mode mode) > { > - struct balloon_dev_info *balloon = balloon_page_device(page); > + struct balloon_dev_info *balloon = balloon_page_device(&src->page); > > /* > * We can not easily support the no copy case here so ignore it as it > @@ -244,14 +243,14 @@ static int balloon_page_migrate(struct address_space *mapping, > if (mode == MIGRATE_SYNC_NO_COPY) > return -EINVAL; > > - VM_BUG_ON_PAGE(!PageLocked(page), page); > - VM_BUG_ON_PAGE(!PageLocked(newpage), newpage); > + VM_BUG_ON_FOLIO(!folio_test_locked(src), src); > + VM_BUG_ON_FOLIO(!folio_test_locked(dst), dst); > > - return balloon->migratepage(balloon, newpage, page, mode); > + return balloon->migratepage(balloon, &dst->page, &src->page, mode); > } > > const struct address_space_operations balloon_aops = { > - .migratepage = balloon_page_migrate, > + .migrate_folio = balloon_migrate_folio, > .isolate_page = balloon_page_isolate, > .putback_page = balloon_page_putback, > };I assume you're working on conversion of the other callbacks as well, because otherwise, this ends up looking a bit inconsistent and confusing :) Change LGTM. -- Thanks, David / dhildenb
Matthew Wilcox
2022-Jun-07 14:24 UTC
[Ocfs2-devel] [PATCH 15/20] balloon: Convert to migrate_folio
On Tue, Jun 07, 2022 at 09:36:21AM +0200, David Hildenbrand wrote:> On 06.06.22 22:40, Matthew Wilcox (Oracle) wrote: > > const struct address_space_operations balloon_aops = { > > - .migratepage = balloon_page_migrate, > > + .migrate_folio = balloon_migrate_folio, > > .isolate_page = balloon_page_isolate, > > .putback_page = balloon_page_putback, > > }; > > I assume you're working on conversion of the other callbacks as well, > because otherwise, this ends up looking a bit inconsistent and confusing :)My intention was to finish converting aops for the next merge window. However, it seems to me that we goofed back in 2016 by merging commit bda807d44454. isolate_page() and putback_page() should never have been part of address_space_operations. I'm about to embark on creating a new migrate_operations struct for drivers to use that contains only isolate/putback/migrate. No filesystem uses isolate/putback, so those can just be deleted. Both migrate_operations & address_space_operations will contain a migrate callback.