The migration code used to be able to migrate dirty 9p folios by writing
them back using writepage.  When the writepage method was removed,
we neglected to add a migrate_folio method, which means that dirty 9p
folios have been unmovable ever since.  This reduced our success at
defragmenting memory on machines which use 9p heavily.

Fixes: 80105ed2fd27 (9p: Use netfslib read/write_iter)
Cc: sta...@vger.kernel.org
Cc: David Howells <dhowe...@redhat.com>
Cc: v...@lists.linux.dev
Signed-off-by: Matthew Wilcox (Oracle) <wi...@infradead.org>
---
 fs/9p/vfs_addr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c
index 32619d146cbc..1286d96a29bc 100644
--- a/fs/9p/vfs_addr.c
+++ b/fs/9p/vfs_addr.c
@@ -164,4 +164,5 @@ const struct address_space_operations v9fs_addr_operations 
= {
        .invalidate_folio       = netfs_invalidate_folio,
        .direct_IO              = noop_direct_IO,
        .writepages             = netfs_writepages,
+       .migrate_folio          = filemap_migrate_folio,
 };
-- 
2.47.2

Reply via email to