mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daejun Park <daejun7.park@samsung.com>
To: Brian Foster <bfoster@redhat.com>
Cc: Carlos Maiolino <cem@kernel.org>,
	"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>,
	Christoph Hellwig <hch@lst.de>,
	Dave Chinner <david@fromorbit.com>,
	"Darrick J. Wong" <djwong@kernel.org>,
	Amir Goldstein <amir73il@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Daejun Park <daejun7.park@samsung.com>
Subject: RE:(2) [PATCH 2/2] xfs: skip the fsync flush when a later flush has completed
Date: Wed, 11 Nov 2026 10:05:40 +0900	[thread overview]
Message-ID: <20261111010540epcms2p1ac660f3ce4c6c2ed55836c8b1615a4d6@epcms2p1> (raw)
In-Reply-To: <avIGmcLZPKIDlf06@bfoster>

On Mon, Nov 09, 2026 at 12:44:57PM -0500, Brian Foster wrote:
> > 16 fio jobs of 4k append + fsync, QEMU guest on a 990 PRO without
> > power loss protection (virtio-blk, cache=none): 809 -> 4185 fsyncs/s,
> > mean fsync latency 19.8 -> 3.8 ms.
>
> Can you include this in the commit log so we have a record of the perf
> impact?

Thanks, will do in v2. I measured both kernels again on the current
for-next, so the numbers differ from the ones above, and added a single
job line.

[...]
> I think it would be helpful if the comment here and perhaps above
> xfs_buftarg_flush_seq() referred to the submit/completion ordering logic
> being applied. Maybe even rename seq -> submit_seq as well to make it
> more clear. For example, something like:
>
> "Return true if a flush has been submitted and completed since
> @submit_seq was sampled. If so, this guarantees writes completed before
> @submit_seq are flushed to disk."

Agreed. v2 will rename the argument of xfs_buftarg_flushed_since() to
submit_seq and reword its comment along those lines. The comment above
xfs_buftarg_flush_seq() will say that it samples the submit counter, and
that a flush numbered above the sample was submitted after the sample.

[...]
> Ok, so I think I follow the logic. We write the file, sample the submit
> sequence (after write completes), then can optimize away our own flush
> if we can confirm that a flush submitted after write completion has
> already completed. Right?

Yes, that is the logic.

> That kind of makes me wonder whether we could do something like "flush
> or wait on any flush submitted after this seq," but maybe that's
> something for another day. ;)

I'd like to leave waiting for an in-flight flush to a follow-up.

[...]
> > -	 * If the log force was a no-op, we may still need to flush the
> > -	 * file data target cache here. This can happen for fdatasync/O_DSYNC
> > -	 * when no metadata needed to be committed.
>
> Did we intend to remove the comment on why we flush in the first place?

No, that was not intended. Thanks for catching it. The paragraph was
deleted while I was cleaning up the comment changes. v2 keeps it and
adds the new condition after it.

      parent reply	other threads:[~2026-11-11  1:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05  2:49 [PATCH 0/2] xfs: skip redundant fsync cache flushes Daejun Park via B4 Relay
2026-11-05  2:49 ` [PATCH 1/2] xfs: number the cache flushes submitted to each buftarg Daejun Park via B4 Relay
2026-11-09 17:44   ` Brian Foster
     [not found]   ` <CGME20261109174425epcas2p37306753cba345ce4909a28d2a77fb208@epcms2p7>
2026-11-11  1:04     ` Daejun Park
2026-11-05  2:49 ` [PATCH 2/2] xfs: skip the fsync flush when a later flush has completed Daejun Park via B4 Relay
2026-11-09 17:44   ` Brian Foster
     [not found]   ` <CGME20261109174511epcas2p22eb1ad7fec0b96837feb110984f57fa7@epcms2p1>
2026-11-11  1:05     ` Daejun Park [this message]

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=20261111010540epcms2p1ac660f3ce4c6c2ed55836c8b1615a4d6@epcms2p1 \
    --to=daejun7.park@samsung.com \
    --cc=amir73il@gmail.com \
    --cc=bfoster@redhat.com \
    --cc=cem@kernel.org \
    --cc=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®