From: John Garry <john.g.garry@oracle.com>
To: Alejandro Colomar <alx@kernel.org>
Cc: linux-man@vger.kernel.org, linux-fsdevel@vger.kernel.org,
hch@lst.de, djwong@kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH v2] statx.2: Add stx_atomic_write_unit_max_opt
Date: Thu, 19 Jun 2025 12:24:21 +0100 [thread overview]
Message-ID: <22295562-ac0e-41df-a995-a52c0ebcaa12@oracle.com> (raw)
In-Reply-To: <7ret5bl5nbtolpdu2muaoeaheu6klrrfm2pvp3vkdfvfw7jxbr@zwsz2dpx7vxz>
On 19/06/2025 12:05, Alejandro Colomar wrote:
> Hi John,
>
> On Thu, Jun 19, 2025 at 09:05:10AM +0000, John Garry wrote:
>> XFS supports atomic writes - or untorn writes - based on two different
>> methods:
>> - HW offload in the disk
>> - FS method based on out-of-place writes
>>
>> The value reported in stx_atomic_write_unit_max will be the max size of the
>> FS-based method.
>>
>> The max atomic write unit size of the FS-based atomic writes will
>> typically be much larger than what is capable from the HW offload. However,
>> FS-based atomic writes will also be typically much slower.
>>
>> Advertise this HW offload size limit to the user in a new statx member,
>> stx_atomic_write_unit_max_opt.
>>
>> We want STATX_WRITE_ATOMIC to get this new member in addition to the
>> already-existing members, so mention that a value of 0 means that
>> stx_atomic_write_unit_max holds this optimised limit.
>
> Please say a "a value of 0 *in stx_atomic_write_unit_max_opt* means
> that ...", to clarify.
ok
>
>> Linux will zero unused statx members, so stx_atomic_write_unit_max_opt
>> will always hold 0 for older kernel versions which do not support
>> this FS-based atomic write method (for XFS).
>>
>> Signed-off-by: John Garry <john.g.garry@oracle.com>
>> ---
>> Differences to RFC (v1):
>> - general rewrite
>> - mention that linux zeroes unused statx fields
>>
>> diff --git a/man/man2/statx.2 b/man/man2/statx.2
>> index ef7dbbcf9..29400d055 100644
>> --- a/man/man2/statx.2
>> +++ b/man/man2/statx.2
>> @@ -74,6 +74,9 @@ struct statx {
>> \&
>> /* File offset alignment for direct I/O reads */
>> __u32 stx_dio_read_offset_align;
>> +\&
>> + /* Direct I/O atomic write max opt limit */
>> + __u32 stx_atomic_write_unit_max_opt;
>
> Please align the member with the one above.
ok
>
>> };
>> .EE
>> .in
>> @@ -266,7 +269,8 @@ STATX_SUBVOL Want stx_subvol
>> (since Linux 6.10; support varies by filesystem)
>> STATX_WRITE_ATOMIC Want stx_atomic_write_unit_min,
>> stx_atomic_write_unit_max,
>> - and stx_atomic_write_segments_max.
>> + stx_atomic_write_segments_max,
>> + and stx_atomic_write_unit_max_opt.
>> (since Linux 6.11; support varies by filesystem)
>> STATX_DIO_READ_ALIGN Want stx_dio_read_offset_align.
>> (since Linux 6.14; support varies by filesystem)
>> @@ -514,6 +518,20 @@ is supported on block devices since Linux 6.11.
>> The support on regular files varies by filesystem;
>> it is supported by xfs and ext4 since Linux 6.13.
>> .TP
>> +.I stx_atomic_write_unit_max_opt
>> +The maximum size (in bytes) which is optimised for writes issued with
>> +torn-write protection.
>
> Please break the line before 'optimized' and remove the current line
> break.
ok, but I am not sure the issue with the current formatting
>
>> +If non-zero, this value will not exceed the value in
>
> Please break the line after ','.
ok
>
>> +.I stx_atomic_write_unit_max
>> +and will not be less than the value in
>> +.I stx_atomic_write_unit_min.
>
> This should be IR, and the '.' separated by a space, so that the '.' is
> not in italics.
So you mean like the following:
.IR stx_atomic_write_unit_min .
right?
Cheers,
John
next prev parent reply other threads:[~2025-06-19 11:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-19 9:05 [PATCH v2] statx.2: Add stx_atomic_write_unit_max_opt John Garry
2025-06-19 11:05 ` Alejandro Colomar
2025-06-19 11:24 ` John Garry [this message]
2025-06-19 11:30 ` Alejandro Colomar
2025-06-19 13:10 ` John Garry
2025-06-19 13:45 ` Alejandro Colomar
2025-06-19 21:34 ` G. Branden Robinson
2025-06-20 0:00 ` Alejandro Colomar
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=22295562-ac0e-41df-a995-a52c0ebcaa12@oracle.com \
--to=john.g.garry@oracle.com \
--cc=alx@kernel.org \
--cc=djwong@kernel.org \
--cc=hch@lst.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-man@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