From: "Pankaj Raghav (Samsung)" <pankaj.raghav@linux.dev>
To: John Garry <john.garry@linux.dev>
Cc: Wayne Gao <Wayne.Gao1@solidigm.com>,
"cem@kernel.org" <cem@kernel.org>,
"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>,
"linux-api@vger.kernel.org" <linux-api@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
gost.dev@samsung.com, pankaj.raghav@linux.dev
Subject: Re: [RFC PATCH] xfs: add a per-filesystem switch to force atomic CoW
Date: Mon, 23 Nov 2026 14:42:57 +0100 [thread overview]
Message-ID: <awRASEIJGTYGOx46@quentin> (raw)
In-Reply-To: <1801b5bf-6cb2-40ee-b553-5bcba04875b4@linux.dev>
On Mon, Nov 23, 2026 at 11:44:19AM +0000, John Garry wrote:
> On 11/21/26 15:47, Wayne Gao wrote:
> >
>
> Christoph was proposing something similar here:
>
> https://lore.kernel.org/linux-xfs/20250714131713.GA8742@lst.de/
>
> Plesse check it. But it is for a difference purpose to what you propose,
> below. Actually, I am not sure on the motivation.
>
> >
> > Hardware-capable devices normally prefer hardware atomic writes, making
> > it difficult to exercise the software CoW path deterministically without
> > changing file layouts or affecting ordinary writes.
> >
> > Add a non-debug force_atomic_cow sysfs control for each filesystem.
Why do you think this should be a non-debug interface? Why would anyone
want to disable HW atomics if the device supports it in production?
> > When enabled, route RWF_ATOMIC writes directly to the existing software
> > CoW path regardless of hardware eligibility. Keep automatic selection
> > as the default and reject enabling the control without software atomic
> > write support.
> >
> > Sample the setting once per I/O so in-flight requests retain their
> > selected path. Preserve existing validation, completion and error
> > handling, and leave non-atomic writes unchanged.
> >
> > Report no separate optimized atomic write limit while CoW is forced
> > and document the control's runtime scope and lifetime.
> >
> > Validation: strict checkpatch passed. Linux kernel build and mounted-XFS
> > runtime tests have not been run.
> >
>
> Hmmm.. you are just describing what it does. Not why.
>
> > Signed-off-by: Wayne Gao <wayne.gao1@solidigm.com>
> > ---
> > Hi Carlos and XFS developers,
> >
> > I would appreciate feedback on this proposed interface.
> >
> > The intended use is a controlled comparison of hardware-backed and
> > software-backed RWF_ATOMIC writes on the same hardware, without having
> > to construct misaligned mappings to trigger fallback.
>
> Why do you want to compare?
>
Probably to measure the performance of HW atomics vs SW atomics?
If the goal is to compare HW atomics vs SW atomics, then a simple module
parameter in the nvme driver (or scsi) to disable atomics even on HW atomic
capable device should force SW atomics from XFS. I am not sure if it
needs to be in the upstream kernel.
--
Pankaj
next prev parent reply other threads:[~2026-11-23 13:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-21 15:47 Wayne Gao
2026-11-23 11:44 ` John Garry
2026-11-23 13:42 ` Pankaj Raghav (Samsung) [this message]
2026-11-23 20:11 ` Dave Chinner
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=awRASEIJGTYGOx46@quentin \
--to=pankaj.raghav@linux.dev \
--cc=Wayne.Gao1@solidigm.com \
--cc=cem@kernel.org \
--cc=gost.dev@samsung.com \
--cc=john.garry@linux.dev \
--cc=linux-api@vger.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
all inboxes | Powered by JetHome®