From: Pankaj Raghav <pankaj.raghav@linux.dev>
To: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>,
Pankaj Raghav <p.raghav@samsung.com>
Cc: Ojaswin Mujoo <ojaswin@linux.ibm.com>,
Baokun Li <libaokun@linux.alibaba.com>,
Zhang Yi <yi.zhang@huawei.com>,
Andreas Dilger <adilger.kernel@dilger.ca>,
Jan Kara <jack@suse.cz>,
linux-ext4@vger.kernel.org, Theodore Ts'o <tytso@mit.edu>,
pankaj.raghav@linux.dev, John Garry <john.garry@linux.dev>,
SSDR Gost Dev <gost.dev@samsung.com>
Subject: Re: [PATCH] ext4: set awu_max_opt to awu_max
Date: Wed, 28 Oct 2026 09:27:01 +0100 [thread overview]
Message-ID: <37bb5b7c-c29c-46b6-a87f-ac1a6e19fe0d@linux.dev> (raw)
In-Reply-To: <y0d9yw6z.ritesh.list@gmail.com>
Sorry for the late reply.
On 9/10/26 17:15, Ritesh Harjani (IBM) wrote:
> Pankaj Raghav <p.raghav@samsung.com> writes:
>
>> commit 5d894321c49e ("fs: add atomic write unit max opt to statx")
>> added atomic write max optimal to statx. As XFS can support large atomic
>> writes through SW, max_opt exposes the value that will be HW accelerated
>> atomics.
>>
>> As ext4 does not support SW atomics, set awu_max_opt to awu_max.
>>
>
> As per the man page the awu_max_opt=0 means:
>
> A value of zero indicates that stx_atomic_write_unit_max is the
> optimised limit.
>
> [1]: https://man7.org/linux/man-pages/man2/statx.2.html
>
> But the value of 0 isn't wrong either. Jan, added that it might be more
Yes.
> clear to report awu_max there instead of 0. So, if are going to do it -
> let's add this info to the commit msg. So it doesn't look like we were
> trying to fix anything here ;)
>
That is why I did not put any fixes tag, as 0 just indicates awu_max is the supported value.
I can update the commit message to make this more explicit.
I guess this is not a problem for ext4, but for XFS, is there a way for the applications to reliably
know whether the atomic command will be HW accelerated or not?
For normal SSDs:
ext4: awu_min and awu_max = 0, awu_max_opt = 0
XFS: awu_min = fs block size, awu_max = SW atomic max, awu_max_opt = 0
For Atomic SSDs:
ext4 with bigalloc (without these patches): awu_min = fs block size, awu_max= HW atomic limit
awu_max_opt = 0
XFS: awu_min = fs block size, awu_max = SW atomic max, awu_max_opt = HW atomic limit
As a user who would only like HW atomic path, it is very hard to know which value to use unless
they know what each filesystem does.
Even though statx says zero to indicate stx_atomic_write_unit_max is the optimized limit, I think
it is better for all the filesystems who support HW atomics to set the max_opt to the HW optimized
limit to make life easier for the users.
> btw note that bdev_statx() still reports 0 for awu_max_opt.
>
I will send a separate patch for this as well. Thanks.
--
Pankaj
next prev parent reply other threads:[~2026-10-28 8:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-10 10:08 [PATCH] ext4: set awu_max_opt to awu_max Pankaj Raghav
2026-09-10 10:10 ` sashiko-bot
2026-09-10 11:17 ` Jan Kara
2026-09-10 15:15 ` Ritesh Harjani
2026-10-28 8:27 ` Pankaj Raghav [this message]
2026-09-11 14:15 ` Ojaswin Mujoo
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=37bb5b7c-c29c-46b6-a87f-ac1a6e19fe0d@linux.dev \
--to=pankaj.raghav@linux.dev \
--cc=adilger.kernel@dilger.ca \
--cc=gost.dev@samsung.com \
--cc=jack@suse.cz \
--cc=john.garry@linux.dev \
--cc=libaokun@linux.alibaba.com \
--cc=linux-ext4@vger.kernel.org \
--cc=ojaswin@linux.ibm.com \
--cc=p.raghav@samsung.com \
--cc=ritesh.list@gmail.com \
--cc=tytso@mit.edu \
--cc=yi.zhang@huawei.com \
/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