mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
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>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] xfs: number the cache flushes submitted to each buftarg
Date: Mon, 9 Nov 2026 12:44:07 -0500	[thread overview]
Message-ID: <avIGZ9ABd_pXSy1L@bfoster> (raw)
In-Reply-To: <20261105-xfs-fsync-flush-seq-v1-1-299bdf5e28c3@samsung.com>

On Thu, Nov 05, 2026 at 11:49:12AM +0900, Daejun Park via B4 Relay wrote:
> From: Daejun Park <daejun7.park@samsung.com>
> 
> fsync can only skip its own cache flush when its log force wrote out
> the iclog. It cannot tell whether a flush that another task submitted
> covers its data.
> 
> Number the cache flushes that the log code submits to each buftarg,
> and record the highest number that completed without error. Nothing
> reads the numbers yet.
> 
> Signed-off-by: Daejun Park <daejun7.park@samsung.com>
> ---
>  fs/xfs/xfs_buf.c      | 13 +++++++++++++
>  fs/xfs/xfs_buf.h      | 21 +++++++++++++++++++++
>  fs/xfs/xfs_log.c      | 25 +++++++++++++++++++------
>  fs/xfs/xfs_log_priv.h |  1 +
>  4 files changed, 54 insertions(+), 6 deletions(-)
> 
...
> diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
> index 74b324f915a..734daa4e99b 100644
> --- a/fs/xfs/xfs_log.c
> +++ b/fs/xfs/xfs_log.c
...
> @@ -1688,6 +1698,9 @@ xlog_write_iclog(
>  		iclog->ic_bio.bi_opf |= REQ_PREFLUSH;
>  	if (iclog->ic_flags & XLOG_ICL_NEED_FUA)
>  		iclog->ic_bio.bi_opf |= REQ_FUA;
> +	iclog->ic_flush_seq = 0;
> +	if (iclog->ic_bio.bi_opf & REQ_PREFLUSH)
> +		iclog->ic_flush_seq = xfs_buftarg_flush_start(log->l_targ);

Bit of a nit, but it looks like this would be cleaner if we moved both
of these a bit further up. I.e., zero ->ic_flush_seq right after where
we init the iclog->ic_bio fields, and then move the assignment under the
same block where we set the PREFLUSH flag. Hm?

Brian

>  
>  	iclog->ic_flags &= ~(XLOG_ICL_NEED_FLUSH | XLOG_ICL_NEED_FLUSH_LOG |
>  			     XLOG_ICL_NEED_FUA);
> diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h
> index 529720a4984..df0f13c4e04 100644
> --- a/fs/xfs/xfs_log_priv.h
> +++ b/fs/xfs/xfs_log_priv.h
> @@ -222,6 +222,7 @@ struct xlog_in_core {
>  #endif
>  	struct semaphore	ic_sema;
>  	struct work_struct	ic_end_io_work;
> +	s64			ic_flush_seq;	/* buftarg flush number */
>  	struct bio		ic_bio;
>  	struct bio_vec		ic_bvec[];
>  };
> 
> -- 
> 2.43.0
> 
> 
> 


  reply	other threads:[~2026-11-09 17:44 UTC|newest]

Thread overview: 5+ 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 [this message]
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

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=avIGZ9ABd_pXSy1L@bfoster \
    --to=bfoster@redhat.com \
    --cc=amir73il@gmail.com \
    --cc=cem@kernel.org \
    --cc=daejun7.park@samsung.com \
    --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®