From: Joanne Koong <joannelkoong@gmail.com>
To: Horst Birthelmer <horst@birthelmer.de>
Cc: Horst Birthelmer <horst@birthelmer.com>,
Miklos Szeredi <miklos@szeredi.hu>,
Bernd Schubert <bernd@bsbernd.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Horst Birthelmer <hbirthelmer@ddn.com>
Subject: Re: Re: Re: [PATCH] fuse: when copying a folio delay the mark dirty until the end
Date: Wed, 18 Mar 2026 14:19:04 -0700 [thread overview]
Message-ID: <CAJnrk1bF0JFAWOF=4hjMhiciSLrvob268fcQgv3P28Po8J=qwQ@mail.gmail.com> (raw)
In-Reply-To: <abqvmS4adTXVxFIW@fedora.fritz.box>
On Wed, Mar 18, 2026 at 7:03 AM Horst Birthelmer <horst@birthelmer.de> wrote:
>
> Hi Joanne,
>
> I wonder, would something like this help for large folios?
Hi Horst,
I don't think it's likely that the pages backing the userspace buffer
are large folios, so I think this may actually add extra overhead with
the extra folio_test_dirty() check.
From what I've seen, the main cost that dwarfs everything else for
writes/reads is the actual IO, the context switches, and the memcpys.
I think compared to these things, the set_page_dirty_lock() cost is
negligible and pretty much undetectable.
Thanks,
Joanne
>
> @@ -856,8 +856,11 @@ void fuse_copy_finish(struct fuse_copy_state *cs)
> cs->currbuf = NULL;
> } else if (cs->pg) {
> if (cs->write) {
> + struct folio *folio = page_folio(cs->pg);
> +
> flush_dcache_page(cs->pg);
> - set_page_dirty_lock(cs->pg);
> + if (!folio_test_dirty(folio))
> + set_page_dirty_lock(cs->pg);
> }
> put_page(cs->pg);
> }
>
> Do you have seen any problems with spin locks being way too costly while
> doing writes?
>
> That was actually why I started looking into this.
>
> Thanks,
> Horst
next prev parent reply other threads:[~2026-03-18 21:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-16 15:16 [PATCH] fuse: when copying a folio delay the mark dirty until the end Horst Birthelmer
2026-03-16 17:29 ` Joanne Koong
2026-03-16 20:02 ` Horst Birthelmer
2026-03-16 22:06 ` Joanne Koong
2026-03-18 14:03 ` Horst Birthelmer
2026-03-18 21:19 ` Joanne Koong [this message]
2026-03-18 21:52 ` Bernd Schubert
2026-03-19 1:32 ` Joanne Koong
2026-03-19 4:27 ` Darrick J. Wong
2026-03-20 17:24 ` Joanne Koong
2026-03-19 8:32 ` Horst Birthelmer
2026-03-20 17:18 ` Joanne Koong
2026-03-26 6:35 ` kernel test robot
2026-03-26 15:05 ` [LTP] " Cyril Hrubis
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='CAJnrk1bF0JFAWOF=4hjMhiciSLrvob268fcQgv3P28Po8J=qwQ@mail.gmail.com' \
--to=joannelkoong@gmail.com \
--cc=bernd@bsbernd.com \
--cc=hbirthelmer@ddn.com \
--cc=horst@birthelmer.com \
--cc=horst@birthelmer.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/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