From: Matthew Wilcox <willy@infradead.org>
To: Tal Zussman <tz2294@columbia.edu>
Cc: Ilya Dryomov <idryomov@gmail.com>,
Alex Markuze <amarkuze@redhat.com>,
Viacheslav Dubeyko <slava@dubeyko.com>, Jan Kara <jack@suse.cz>,
Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@kernel.org>,
Lorenzo Stoakes <ljs@kernel.org>,
"Liam R. Howlett" <liam@infradead.org>,
Vlastimil Babka <vbabka@kernel.org>,
Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>, Zi Yan <ziy@nvidia.com>,
ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 4/4] ceph: remove page_snap_context()
Date: Mon, 3 Aug 2026 03:06:27 +0100 [thread overview]
Message-ID: <am_3oyOJAoFeBFTC@casper.infradead.org> (raw)
In-Reply-To: <20260802-remove-wait-on-page-writeback-v1-4-6c35d6b3ad36@columbia.edu>
On Sun, Aug 02, 2026 at 12:50:05PM -0400, Tal Zussman wrote:
> Convert the final caller in get_writepages_data_length() to use a folio
> and ceph_folio_snap_context(), then remove page_snap_context().
>
> This drops the last open-coded use of page->private in ceph's writeback
> path.
This one I'm deeply conflicted about. It's adding an extra call to
compound_head() ... and we're not getting much for it.
I'd feel better about it if it started with::
static u64 get_writepages_data_length(struct inode *inode,
struct page *page, u64 start)
{
+ struct folio *folio = page_folio(page);
and then we had a ceph_fscrypt_pagecache_folio() function and
ceph_fscrypt_folio_offset() (we already have a fscrypt_is_bounce_page())
That way we'd have this function entirely converted except for its
argument, and a future patch can do the conversion with little fuss.
And we'd get rid of one of the four remaining calls to
fscrypt_is_bounce_page()
> Signed-off-by: Tal Zussman <tz2294@columbia.edu>
> ---
> fs/ceph/addr.c | 15 ++++-----------
> 1 file changed, 4 insertions(+), 11 deletions(-)
>
> diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
> index f4aaf9a5f196..702cf5fc1eab 100644
> --- a/fs/ceph/addr.c
> +++ b/fs/ceph/addr.c
> @@ -29,9 +29,9 @@
> *
> * There are a few funny things going on here.
> *
> - * The page->private field is used to reference a struct
> - * ceph_snap_context for _every_ dirty page. This indicates which
> - * snapshot the page was logically dirtied in, and thus which snap
> + * The folio->private field is used to reference a struct
> + * ceph_snap_context for _every_ dirty folio. This indicates which
> + * snapshot the folio was logically dirtied in, and thus which snap
> * context needs to be associated with the osd write during writeback.
> *
> * Similarly, struct ceph_inode_info maintains a set of counters to
> @@ -68,13 +68,6 @@
> static int ceph_netfs_check_write_begin(struct file *file, loff_t pos, unsigned int len,
> struct folio **foliop, void **_fsdata);
>
> -static inline struct ceph_snap_context *page_snap_context(struct page *page)
> -{
> - if (PagePrivate(page))
> - return (void *)page->private;
> - return NULL;
> -}
> -
> static inline struct ceph_snap_context *ceph_folio_snap_context(struct folio *folio)
> {
> if (folio_test_private(folio))
> @@ -697,7 +690,7 @@ static u64 get_writepages_data_length(struct inode *inode,
> u64 end = i_size_read(inode);
> u64 ret;
>
> - snapc = page_snap_context(ceph_fscrypt_pagecache_page(page));
> + snapc = ceph_folio_snap_context(page_folio(ceph_fscrypt_pagecache_page(page)));
> if (snapc != ci->i_head_snapc) {
> bool found = false;
> spin_lock(&ci->i_ceph_lock);
>
> --
> 2.39.5
>
next prev parent reply other threads:[~2026-08-03 2:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-02 16:50 [PATCH 0/4] mm, ceph: remove wait_on_page_writeback() Tal Zussman
2026-08-02 16:50 ` [PATCH 1/4] ceph: add ceph_folio_snap_context() Tal Zussman
2026-08-02 21:52 ` Matthew Wilcox
2026-08-02 22:44 ` Zi Yan
2026-08-03 10:17 ` Tal Zussman
2026-08-02 16:50 ` [PATCH 2/4] ceph: convert ceph_wait_until_current_writes_complete() to folios Tal Zussman
2026-08-02 23:22 ` Matthew Wilcox
2026-08-02 16:50 ` [PATCH 3/4] mm: remove wait_on_page_writeback() Tal Zussman
2026-08-02 23:23 ` Matthew Wilcox
2026-08-03 12:34 ` David Hildenbrand (Arm)
2026-08-02 16:50 ` [PATCH 4/4] ceph: remove page_snap_context() Tal Zussman
2026-08-03 2:06 ` Matthew Wilcox [this message]
2026-08-03 11:03 ` Tal Zussman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=am_3oyOJAoFeBFTC@casper.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=amarkuze@redhat.com \
--cc=ceph-devel@vger.kernel.org \
--cc=david@kernel.org \
--cc=idryomov@gmail.com \
--cc=jack@suse.cz \
--cc=liam@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mhocko@suse.com \
--cc=rppt@kernel.org \
--cc=slava@dubeyko.com \
--cc=surenb@google.com \
--cc=tz2294@columbia.edu \
--cc=vbabka@kernel.org \
--cc=ziy@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox