Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH v2 1/9] 9p: Add a migrate_folio method
       [not found] <20250402150005.2309458-1-willy@infradead.org>
@ 2025-04-02 14:59 ` Matthew Wilcox (Oracle)
  2025-04-02 17:10   ` David Howells
  2025-04-03  3:46   ` Dominique Martinet
  0 siblings, 2 replies; 4+ messages in thread
From: Matthew Wilcox (Oracle) @ 2025-04-02 14:59 UTC (permalink / raw)
  To: linux-fsdevel
  Cc: Matthew Wilcox (Oracle), intel-gfx, linux-mm, dri-devel, stable,
	David Howells, v9fs

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: stable@vger.kernel.org
Cc: David Howells <dhowells@redhat.com>
Cc: v9fs@lists.linux.dev
Signed-off-by: Matthew Wilcox (Oracle) <willy@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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 1/9] 9p: Add a migrate_folio method
  2025-04-02 14:59 ` [PATCH v2 1/9] 9p: Add a migrate_folio method Matthew Wilcox (Oracle)
@ 2025-04-02 17:10   ` David Howells
  2025-04-03  3:46   ` Dominique Martinet
  1 sibling, 0 replies; 4+ messages in thread
From: David Howells @ 2025-04-02 17:10 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: dhowells, linux-fsdevel, intel-gfx, linux-mm, dri-devel, stable,
	v9fs

Matthew Wilcox (Oracle) <willy@infradead.org> wrote:

> 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: stable@vger.kernel.org
> Cc: David Howells <dhowells@redhat.com>
> Cc: v9fs@lists.linux.dev
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Reviewed-by: David Howells <dhowells@redhat.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 1/9] 9p: Add a migrate_folio method
  2025-04-02 14:59 ` [PATCH v2 1/9] 9p: Add a migrate_folio method Matthew Wilcox (Oracle)
  2025-04-02 17:10   ` David Howells
@ 2025-04-03  3:46   ` Dominique Martinet
  2025-04-03  3:53     ` Matthew Wilcox
  1 sibling, 1 reply; 4+ messages in thread
From: Dominique Martinet @ 2025-04-03  3:46 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: linux-fsdevel, intel-gfx, linux-mm, dri-devel, stable,
	David Howells, v9fs

Matthew Wilcox (Oracle) wrote on Wed, Apr 02, 2025 at 03:59:55PM +0100:
> 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: stable@vger.kernel.org
> Cc: David Howells <dhowells@redhat.com>
> Cc: v9fs@lists.linux.dev
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Given I'm not in Cc of the whole series I'm lacking context but I assume
that means I'm not supposed to take this in.

I won't pretend I understand folios anyway, but commit messages makes
sense to me:
Acked-by: Dominique Martinet <asmadeus@codewreck.org>

Thanks,
-- 
Dominique Martinet | Asmadeus

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 1/9] 9p: Add a migrate_folio method
  2025-04-03  3:46   ` Dominique Martinet
@ 2025-04-03  3:53     ` Matthew Wilcox
  0 siblings, 0 replies; 4+ messages in thread
From: Matthew Wilcox @ 2025-04-03  3:53 UTC (permalink / raw)
  To: Dominique Martinet
  Cc: linux-fsdevel, intel-gfx, linux-mm, dri-devel, stable,
	David Howells, v9fs

On Thu, Apr 03, 2025 at 12:46:17PM +0900, Dominique Martinet wrote:
> Matthew Wilcox (Oracle) wrote on Wed, Apr 02, 2025 at 03:59:55PM +0100:
> > 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.
> 
> Given I'm not in Cc of the whole series I'm lacking context but I assume
> that means I'm not supposed to take this in.

Right; I'm routing this whole series via Christian.  There's various
bits of the VFS that need to be touched as part of this series, and
it'd take forever to get it all merged by going through individual
maintainer trees.

> I won't pretend I understand folios anyway, but commit messages makes
> sense to me:
> Acked-by: Dominique Martinet <asmadeus@codewreck.org>

Thanks!  Folios aren't really that hard a concept for a filesystem
developer to understand, but dhowells has done a great job of insulating
you from even having to understand them with netfs.  All they are is
a container of one-or-more pages which maintain all the filesystem
state which used to be managed per-page.  eg dirty, writeback, locked,
offset-in-file, number-of-mappings.

There's more to it from a MM point of view, but as a filesystem
developer, that's all you really need to understand.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-04-03  3:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20250402150005.2309458-1-willy@infradead.org>
2025-04-02 14:59 ` [PATCH v2 1/9] 9p: Add a migrate_folio method Matthew Wilcox (Oracle)
2025-04-02 17:10   ` David Howells
2025-04-03  3:46   ` Dominique Martinet
2025-04-03  3:53     ` Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox