linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Merge PG_private_2 and PG_mappedtodisk
@ 2024-08-14 17:36 Matthew Wilcox
  2024-08-15 21:41 ` David Hildenbrand
  0 siblings, 1 reply; 3+ messages in thread
From: Matthew Wilcox @ 2024-08-14 17:36 UTC (permalink / raw)
  To: linux-fsdevel, linux-mm

I believe these two flags have entirely disjoint uses and there will
be no confusion in amalgamating them.

Anonymous memory (re)uses mappedtodisk for anon_exclusive.
Anonymous memory does not use PG_private_2.

$ git grep -El '(folio.*mappedtodisk)|PageMappedToDisk'
fs/buffer.c
fs/ext4/readpage.c
fs/f2fs/data.c
fs/f2fs/file.c
fs/fuse/dev.c
fs/mpage.c
fs/nilfs2/file.c
fs/nilfs2/page.c
include/trace/events/pagemap.h
mm/memory.c
mm/migrate.c
mm/truncate.c

$ git grep -El '(folio.*private_2)|PagePrivate2'
fs/btrfs/ctree.h
fs/ceph/addr.c
fs/netfs/buffered_read.c
fs/netfs/fscache_io.c
fs/netfs/io.c
fs/nfs/file.c
fs/nfs/fscache.h
fs/nfs/write.c
include/linux/netfs.h
include/linux/pagemap.h
mm/filemap.c
mm/migrate.c

The one thing that's going to stand in the way of this is that various
parts of the VFS treat private_2 as a "wait for this bit to be clear",
due to its use in fscache (which is going away).

So my approach here is going to be:

 - Rename mappedtodisk to be PG_owner_priv_2 (add appropriate aliases)
 - Switch btrfs to use owner_priv_2 instead of private_2
 - Wait for the fscache use of private2 to finish its deprecation cycle
 - Remove private_2 entirely

Sound good?


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

* Re: [RFC] Merge PG_private_2 and PG_mappedtodisk
  2024-08-14 17:36 [RFC] Merge PG_private_2 and PG_mappedtodisk Matthew Wilcox
@ 2024-08-15 21:41 ` David Hildenbrand
  2024-08-16  3:42   ` Matthew Wilcox
  0 siblings, 1 reply; 3+ messages in thread
From: David Hildenbrand @ 2024-08-15 21:41 UTC (permalink / raw)
  To: Matthew Wilcox, linux-fsdevel, linux-mm

On 14.08.24 19:36, Matthew Wilcox wrote:
> I believe these two flags have entirely disjoint uses and there will
> be no confusion in amalgamating them.
> 
> Anonymous memory (re)uses mappedtodisk for anon_exclusive.
> Anonymous memory does not use PG_private_2.

Also not when they are in the swapcache, right?

> 
> $ git grep -El '(folio.*mappedtodisk)|PageMappedToDisk'
> fs/buffer.c
> fs/ext4/readpage.c
> fs/f2fs/data.c
> fs/f2fs/file.c
> fs/fuse/dev.c
> fs/mpage.c
> fs/nilfs2/file.c
> fs/nilfs2/page.c
> include/trace/events/pagemap.h
> mm/memory.c
> mm/migrate.c
> mm/truncate.c
> 
> $ git grep -El '(folio.*private_2)|PagePrivate2'
> fs/btrfs/ctree.h
> fs/ceph/addr.c
> fs/netfs/buffered_read.c
> fs/netfs/fscache_io.c
> fs/netfs/io.c
> fs/nfs/file.c
> fs/nfs/fscache.h
> fs/nfs/write.c
> include/linux/netfs.h
> include/linux/pagemap.h
> mm/filemap.c
> mm/migrate.c
> 
> The one thing that's going to stand in the way of this is that various
> parts of the VFS treat private_2 as a "wait for this bit to be clear",
> due to its use in fscache (which is going away).
> 
> So my approach here is going to be:
> 
>   - Rename mappedtodisk to be PG_owner_priv_2 (add appropriate aliases)
>   - Switch btrfs to use owner_priv_2 instead of private_2
>   - Wait for the fscache use of private2 to finish its deprecation cycle
>   - Remove private_2 entirely
> 
> Sound good?

Yes, one step into the right direction.

-- 
Cheers,

David / dhildenb



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

* Re: [RFC] Merge PG_private_2 and PG_mappedtodisk
  2024-08-15 21:41 ` David Hildenbrand
@ 2024-08-16  3:42   ` Matthew Wilcox
  0 siblings, 0 replies; 3+ messages in thread
From: Matthew Wilcox @ 2024-08-16  3:42 UTC (permalink / raw)
  To: David Hildenbrand; +Cc: linux-fsdevel, linux-mm

On Thu, Aug 15, 2024 at 11:41:23PM +0200, David Hildenbrand wrote:
> On 14.08.24 19:36, Matthew Wilcox wrote:
> > I believe these two flags have entirely disjoint uses and there will
> > be no confusion in amalgamating them.
> > 
> > Anonymous memory (re)uses mappedtodisk for anon_exclusive.
> > Anonymous memory does not use PG_private_2.
> 
> Also not when they are in the swapcache, right?

Correct, swapcache has no use of PG_private_2.

> > The one thing that's going to stand in the way of this is that various
> > parts of the VFS treat private_2 as a "wait for this bit to be clear",
> > due to its use in fscache (which is going away).
> > 
> > So my approach here is going to be:
> > 
> >   - Rename mappedtodisk to be PG_owner_priv_2 (add appropriate aliases)
> >   - Switch btrfs to use owner_priv_2 instead of private_2
> >   - Wait for the fscache use of private2 to finish its deprecation cycle
> >   - Remove private_2 entirely
> > 
> > Sound good?
> 
> Yes, one step into the right direction.

Cool, thanks.


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

end of thread, other threads:[~2024-08-16  3:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-14 17:36 [RFC] Merge PG_private_2 and PG_mappedtodisk Matthew Wilcox
2024-08-15 21:41 ` David Hildenbrand
2024-08-16  3:42   ` Matthew Wilcox

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