From: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
To: "willy@infradead.org" <willy@infradead.org>
Cc: Xiubo Li <xiubli@redhat.com>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>,
David Howells <dhowells@redhat.com>,
"netfs@lists.linux.dev" <netfs@lists.linux.dev>,
Alex Markuze <amarkuze@redhat.com>,
"jlayton@kernel.org" <jlayton@kernel.org>,
"idryomov@gmail.com" <idryomov@gmail.com>
Subject: RE: Ceph and Netfslib
Date: Thu, 9 Jan 2025 00:53:18 +0000 [thread overview]
Message-ID: <01486f0a36164e9e3bb774adc40bebf9dcdc5e94.camel@ibm.com> (raw)
In-Reply-To: <Z2qvlXf08wuZ81bv@casper.infradead.org>
On Tue, 2024-12-24 at 12:56 +0000, Matthew Wilcox wrote:
> On Mon, Dec 23, 2024 at 11:13:47PM +0000, Viacheslav Dubeyko wrote:
> > * On writeback, we must submit writes to the osd IN SNAP ORDER.
> > So,
> > * we look for the first capsnap in i_cap_snaps and write out pages
> > in
> > * that snap context _only_. Then we move on to the next capsnap,
> > * eventually reaching the "live" or "head" context (i.e., pages
> > that
> > * are not yet snapped) and are writing the most recently dirtied
> > * pages
>
> Speaking of writeback, ceph doesn't need a writepage operation.
> We're
> removing ->writepage from filesystems in favour of using -
> >migrate_folio
> for migration and ->writepages for writeback. As far as I can tell,
> filemap_migrate_folio() will be perfect for ceph (as the
> ceph_snap_context
> contains no references to the address of the memory). And ceph
> already
> has a ->writepages. So I think this patch should work. Can you give
> it
> a try?
>
Sorry for some delay.
I did the testing of this modification. As far as I can see, as ceph
related as generic xfstests are going into ceph_writepages_start
(writepages). Even if I am creating a small file (<= 4096), then it is
processed by ceph_writepages_start() again. So, as far as I can see,
this modification should be safe enough. Running xfstests didn't reveal
any critical issues related to writepage family in Ceph. If I am
missing something, then I am ready to execute additional testing.
Thanks,
Slava.
> diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
> index 85936f6d2bf7..5a5a870b6aee 100644
> --- a/fs/ceph/addr.c
> +++ b/fs/ceph/addr.c
> @@ -810,32 +810,6 @@ static int writepage_nounlock(struct page *page,
> struct writeback_control *wbc)
> return err;
> }
>
> -static int ceph_writepage(struct page *page, struct
> writeback_control *wbc)
> -{
> - int err;
> - struct inode *inode = page->mapping->host;
> - BUG_ON(!inode);
> - ihold(inode);
> -
> - if (wbc->sync_mode == WB_SYNC_NONE &&
> - ceph_inode_to_fs_client(inode)->write_congested) {
> - redirty_page_for_writepage(wbc, page);
> - return AOP_WRITEPAGE_ACTIVATE;
> - }
> -
> - folio_wait_private_2(page_folio(page)); /* [DEPRECATED] */
> -
> - err = writepage_nounlock(page, wbc);
> - if (err == -ERESTARTSYS) {
> - /* direct memory reclaimer was killed by SIGKILL.
> return 0
> - * to prevent caller from setting mapping/page error
> */
> - err = 0;
> - }
> - unlock_page(page);
> - iput(inode);
> - return err;
> -}
> -
> /*
> * async writeback completion handler.
> *
> @@ -1584,7 +1558,6 @@ static int ceph_write_end(struct file *file,
> struct address_space *mapping,
> const struct address_space_operations ceph_aops = {
> .read_folio = netfs_read_folio,
> .readahead = netfs_readahead,
> - .writepage = ceph_writepage,
> .writepages = ceph_writepages_start,
> .write_begin = ceph_write_begin,
> .write_end = ceph_write_end,
> @@ -1592,6 +1565,7 @@ const struct address_space_operations ceph_aops
> = {
> .invalidate_folio = ceph_invalidate_folio,
> .release_folio = netfs_release_folio,
> .direct_IO = noop_direct_IO,
> + .migrate_folio = filemap_migrate_folio,
> };
>
> static void ceph_block_sigs(sigset_t *oldset)
next prev parent reply other threads:[~2025-01-09 0:54 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-18 18:33 Ceph and Netfslib David Howells
2024-12-18 18:47 ` Patrick Donnelly
2024-12-18 19:36 ` David Howells
2024-12-18 19:06 ` Viacheslav Dubeyko
2024-12-18 19:48 ` David Howells
2024-12-23 23:13 ` Viacheslav Dubeyko
2024-12-24 12:56 ` Matthew Wilcox
2024-12-24 21:52 ` Viacheslav Dubeyko
2025-01-09 0:53 ` Viacheslav Dubeyko [this message]
2024-12-18 19:43 ` David Howells
2025-03-05 16:34 ` Is EOLDSNAPC actually generated? -- " David Howells
2025-03-05 19:23 ` Alex Markuze
2025-03-05 20:22 ` David Howells
2025-03-06 13:19 ` Alex Markuze
2025-03-06 13:48 ` David Howells
2025-03-06 13:55 ` Alex Markuze
2025-03-06 13:58 ` Venky Shankar
2025-03-06 14:13 ` David Howells
2025-03-06 14:23 ` Alex Markuze
2025-03-06 16:21 ` Gregory Farnum
2025-03-06 17:18 ` Alex Markuze
2025-03-06 15:55 ` David Howells
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=01486f0a36164e9e3bb774adc40bebf9dcdc5e94.camel@ibm.com \
--to=slava.dubeyko@ibm.com \
--cc=amarkuze@redhat.com \
--cc=ceph-devel@vger.kernel.org \
--cc=dhowells@redhat.com \
--cc=idryomov@gmail.com \
--cc=jlayton@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=netfs@lists.linux.dev \
--cc=willy@infradead.org \
--cc=xiubli@redhat.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