[PATCH 06/11] migrate: Remove call to ->writepage
Zi Yan
ziy at nvidia.com
Thu Mar 27 17:22:38 UTC 2025
On Thu Mar 27, 2025 at 12:52 PM EDT, Matthew Wilcox wrote:
> On Thu, Mar 27, 2025 at 11:04:57AM -0400, Zi Yan wrote:
>> On Fri Mar 7, 2025 at 8:54 AM EST, Matthew Wilcox (Oracle) wrote:
>> > The writepage callback is going away; filesystems must implement
>> > migrate_folio or else dirty folios will not be migratable.
>>
>> What is the impact of this? Are there any filesystem that has
>> a_ops->writepage() without migrate_folio()? I wonder if it could make
>> the un-migratable problem worse[1] when such FS exists.
>
> As Christoph and I have been going through filesystems removing their
> ->writepage operations, we've been careful to add ->migrate_folio
> callbacks at the same time. But we haven't fixed any out-of-tree
> filesystems, and we can't fix the filesystems which will be written in
> the future.
>
> So maybe what we should do is WARN_ON_ONCE() for filesystems which
> have a ->writepages, but do not have a ->migrate_folio()?
Sounds good to me. Oh, ->writepage is removed and there is still
->writepages. Presumably, it is possible to use ->writepages in place of
->writepage in the removed writeout(), but that is meaningless since
->migrate_folio should be used.
>
>> > static int fallback_migrate_folio(struct address_space *mapping,
>> > struct folio *dst, struct folio *src, enum migrate_mode mode)
>> > {
>> > - if (folio_test_dirty(src)) {
>> > - /* Only writeback folios in full synchronous migration */
>> > - switch (mode) {
>> > - case MIGRATE_SYNC:
>> > - break;
>> > - default:
>> > - return -EBUSY;
>> > - }
>> > - return writeout(mapping, src);
>> > - }
>>
>> Now fallback_migrate_folio() no longer writes out page for FS, so it is
>> the responsibilty of migrate_folio()?
>
> ->migrate_folio() doesn't need to write out the page. It can migrate
> dirty folios (just not folios currently under writeback, obviously)
Got it. And I just noticed that Joanne's change is in
migrate_folio_unmap() for folios under writeback and irrelevant to this
change.
--
Best Regards,
Yan, Zi
More information about the Intel-gfx
mailing list