All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] Reclaiming PG_private
@ 2021-04-22 15:47 ` Matthew Wilcox
  0 siblings, 0 replies; 3+ messages in thread
From: Matthew Wilcox @ 2021-04-22 15:47 UTC (permalink / raw)
  To: linux-mm, linux-fsdevel; +Cc: linux-f2fs-devel

We're perenially short of page flags, and I don't really see the need
for PG_private to exist.  We have 32/64 bits available in page->private,
and we don't seem to need the extra bit.

Most users store a pointer in page->private, and so PagePrivate() being
implemented as page->private != 0 is appropriate.

Some users simply SetPagePrivate() and don't touch page->private.
Those users could instead set page->private to 1.

Do we have any users which want to SetPagePrivate() and want to put a
meaningful zero value in page->private?

AFS stores a pair of integers in page->private, but the second integer
must be greater than the first one, so they can't both be zero.  btrfs
stores a real or fake pointer.  buffer_head filesystems generally store
a buffer_head pointer.  fscrypt stores a pointer.  erofs stores a real or
fake pointer.  f2fs does set PagePrivate and also set the pointer to NULL,
but it's not clear whether that's intentional.  iomap stores a pointer.
jfs stores a pointer.  nfs stores a pointer.  ntfs stores a pointer.
orangefs stores a pointer.

So ... what's going on with f2fs?  Does it need to distinguish between
a page which has f2fs_set_page_private(page, 0) called on it, and a page
which has had f2fs_clear_page_private() called on it?

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

* [f2fs-dev] [RFC] Reclaiming PG_private
@ 2021-04-22 15:47 ` Matthew Wilcox
  0 siblings, 0 replies; 3+ messages in thread
From: Matthew Wilcox @ 2021-04-22 15:47 UTC (permalink / raw)
  To: linux-mm, linux-fsdevel; +Cc: linux-f2fs-devel

We're perenially short of page flags, and I don't really see the need
for PG_private to exist.  We have 32/64 bits available in page->private,
and we don't seem to need the extra bit.

Most users store a pointer in page->private, and so PagePrivate() being
implemented as page->private != 0 is appropriate.

Some users simply SetPagePrivate() and don't touch page->private.
Those users could instead set page->private to 1.

Do we have any users which want to SetPagePrivate() and want to put a
meaningful zero value in page->private?

AFS stores a pair of integers in page->private, but the second integer
must be greater than the first one, so they can't both be zero.  btrfs
stores a real or fake pointer.  buffer_head filesystems generally store
a buffer_head pointer.  fscrypt stores a pointer.  erofs stores a real or
fake pointer.  f2fs does set PagePrivate and also set the pointer to NULL,
but it's not clear whether that's intentional.  iomap stores a pointer.
jfs stores a pointer.  nfs stores a pointer.  ntfs stores a pointer.
orangefs stores a pointer.

So ... what's going on with f2fs?  Does it need to distinguish between
a page which has f2fs_set_page_private(page, 0) called on it, and a page
which has had f2fs_clear_page_private() called on it?


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

* Re: [RFC] Reclaiming PG_private
  2021-04-22 15:47 ` [f2fs-dev] " Matthew Wilcox
  (?)
@ 2021-04-23 10:26 ` Chao Yu
  -1 siblings, 0 replies; 3+ messages in thread
From: Chao Yu @ 2021-04-23 10:26 UTC (permalink / raw)
  To: Matthew Wilcox, linux-mm, linux-fsdevel; +Cc: linux-f2fs-devel

On 2021/4/22 23:47, Matthew Wilcox wrote:
> So ... what's going on with f2fs?  Does it need to distinguish between
> a page which has f2fs_set_page_private(page, 0) called on it, and a page
> which has had f2fs_clear_page_private() called on it?

Yes, its intention here is just using Pageprivate to indicate there is
some reference counts related to a dirty page, so value in page.private
is meaningless.

I guess we can avoid f2fs_set_page_private(page, 0) usage, instead, try to
use SetPagePrivate() and assign page.private with non-zero value at the time.

Thanks,

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

end of thread, other threads:[~2021-04-23 10:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-22 15:47 [RFC] Reclaiming PG_private Matthew Wilcox
2021-04-22 15:47 ` [f2fs-dev] " Matthew Wilcox
2021-04-23 10:26 ` Chao Yu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.