From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794246261; b=wHO2rX2dQxKMViLiVh6Y8rw0imaWfKe2V/7L9FLjZXiO8qmXGmdv7bOv9bnyeaCZv0EH 5E5NqIJdkqBhFehcUKpVmhYQdovHEOA3QheoDQlz4RHGpSe2mtXNNloU25Bzkdg6WPK94 75QluYPupeoOYumiLGYonTvkzb2sxRNow6Za93CCzHlA/GwTUmm8XNwTHiFh5EAk8os8v eBoZpj2x5eISfv96IiVHf9ob6n7pPVewRA8YDNbSAe5MDsxCHKrHhbjveUidlOt+4DviY pACRf1uxTxQUirAViWvVwy9lPeLdGhziOOqFI4qpdOUohEHUHGAuGCoZh2kKZ9bsQnQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794246261; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:Received:Date:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To:X-Scanned-By; bh=eVAHGU5PSbZXKclTl1jGH8UX/dsV2fmTA+WOr1aEOQU=; b=uX8l15p5nSY/MXz9Wp5EDmNkKdT0WmWFXJrbHXMZtESBJMVWaBNxnzEZjRrnJYw5fptu fThfWIZPHTLXRmDuIbdFUZ/309mCF8SyZeUw612GwyWYdASYsB9LtV3thTcD6UK5MkXCR RB4rGeQxa21XYeek/9IC33WcSfbIKgJT/GXeBRd0IzPWL8K44GxOEVLKBxE5Q96G2BT11 b/sXCXV42CZ3AgpuPiJSysiBsTtQObiapwNJL14b22QETMx3xKiSW8UMYsNV3sTgntR7q ujzie721f7OtOOs8nPCDrTAdmu3xcd1JLnN6DbXE7zZ6UvzeAKKVCWOlBKv49XpcVRg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=a46M4ZOM; arc=none smtp.remote-ip=170.10.129.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30FA3606A330 for ; Mon, 9 Nov 2026 17:44:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 30FA3606A330 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=a46M4ZOM DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794246260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eVAHGU5PSbZXKclTl1jGH8UX/dsV2fmTA+WOr1aEOQU=; b=a46M4ZOMuaqPoESHvS4m0Z8TwZ0JEtr7jxZb4nlhuxx9iFVvWLySHpLZtug20CblomqqkC S+4JMCUkqvvLNVDQtJs5hmdsVs5FeNQ0utCsSp8Xu5MBb4bYJUKgAZdMZ+scT4ZWMBRp0Y x/hb/b2eAE5s2KcNOe0wGNHuzhj3UTQ= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-21-pBjjCsViOXmzSb4IHp4UOw-1; Mon, 09 Nov 2026 12:44:14 -0500 X-MC-Unique: pBjjCsViOXmzSb4IHp4UOw-1 X-Mimecast-MFC-AGG-ID: pBjjCsViOXmzSb4IHp4UOw_1794246252 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7E1661801337; Mon, 9 Nov 2026 17:44:11 +0000 (UTC) Received: from bfoster (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CDA39431; Mon, 9 Nov 2026 17:44:09 +0000 (UTC) Date: Mon, 9 Nov 2026 12:44:07 -0500 From: Brian Foster To: daejun7.park@samsung.com Cc: Carlos Maiolino , linux-xfs@vger.kernel.org, Christoph Hellwig , Dave Chinner , "Darrick J. Wong" , Amir Goldstein , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] xfs: number the cache flushes submitted to each buftarg Message-ID: References: <20261105-xfs-fsync-flush-seq-v1-0-299bdf5e28c3@samsung.com> <20261105-xfs-fsync-flush-seq-v1-1-299bdf5e28c3@samsung.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261105-xfs-fsync-flush-seq-v1-1-299bdf5e28c3@samsung.com> X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 On Thu, Nov 05, 2026 at 11:49:12AM +0900, Daejun Park via B4 Relay wrote: > From: Daejun Park > > 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 > --- > 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 > > >