The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: daejun7.park@samsung.com
Cc: Carlos Maiolino <cem@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>,
	Brian Foster <bfoster@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] xfs: skip the fsync flush when a later flush has completed
Date: Fri, 20 Nov 2026 19:17:06 +0100	[thread overview]
Message-ID: <20261120181706.GB1954@lst.de> (raw)
In-Reply-To: <20261111-xfs-fsync-flush-seq-v2-2-b5c00c25d276@samsung.com>

On Wed, Nov 11, 2026 at 12:17:12PM +0900, Daejun Park via B4 Relay wrote:
> Suggested-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Daejun Park <daejun7.park@samsung.com>
> ---
> Christoph's 2017 mail with the sequence counter idea:
> https://lore.kernel.org/20170830142134.GA650@lst.de

Heh, I was going to say I didn't remember suggesting this publically,
but hey, if it wa 9 years ago I at least have an excuse for the memory
loss :)

> With an internal log, an fsync that takes the new skip can miss a
> failed flush on bio-based dm. dm drops the error of a preflush sent
> with data, unless the table is linear or stripe on a single device.
> The skip trusts the status of the iclog bio, as the log and the fsync
> that wrote the iclog already do. Before this patch the other fsyncs
> sent their own flush and returned its result. With 8 writers on a
> two-device linear table whose second device fails every flush, 2590
> of 4000 fsyncs returned EIO before and 37 do now. From the code,
> bcache in writeback mode drops that error too. md reports no flush
> error at all. Neither was tested.

I think you've fixed this bug in dm in the meantime, right?

> @@ -119,12 +122,21 @@ xfs_file_fsync(
>  	 * file data target cache here. This can happen for fdatasync/O_DSYNC
>  	 * when no metadata needed to be committed.
>  	 *
> +	 * Flush the file data target unless a flush submitted to it after the
> +	 * data writes above completed has already finished. That is usually
> +	 * the flush before an iclog written out by this log force or by
> +	 * another task, or another fsync's flush.
> +	 *
> +	 * DAX writes are not block I/O, so DAX only skips the flush when
> +	 * this log force flushed, as before.

I don't get the DAX part.  As far as cache flushes are concerned we
don't special case DAX anywhere else, why here?


  parent reply	other threads:[~2026-11-20 18:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11  3:17 [PATCH v2 0/2] xfs: skip redundant fsync cache flushes Daejun Park via B4 Relay
2026-11-11  3:17 ` [PATCH v2 1/2] xfs: number the cache flushes submitted to each buftarg Daejun Park via B4 Relay
2026-11-11 14:22   ` Brian Foster
2026-11-20 18:14   ` Christoph Hellwig
2026-11-11  3:17 ` [PATCH v2 2/2] xfs: skip the fsync flush when a later flush has completed Daejun Park via B4 Relay
2026-11-11 14:22   ` Brian Foster
2026-11-12  2:39     ` Daejun Park
2026-11-20 18:17   ` Christoph Hellwig [this message]
2026-11-11  6:47 ` [PATCH v2 0/2] xfs: skip redundant fsync cache flushes Dave Chinner
2026-11-17  2:33   ` Daejun Park

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=20261120181706.GB1954@lst.de \
    --to=hch@lst.de \
    --cc=amir73il@gmail.com \
    --cc=bfoster@redhat.com \
    --cc=cem@kernel.org \
    --cc=daejun7.park@samsung.com \
    --cc=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --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