public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: John Garry <john.g.garry@oracle.com>
To: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Cc: Zorro Lang <zlang@redhat.com>,
	fstests@vger.kernel.org, Ritesh Harjani <ritesh.list@gmail.com>,
	djwong@kernel.org, tytso@mit.edu
Subject: Re: [PATCH v2 05/13] generic/1226: Add atomic write test using fio crc check verifier
Date: Tue, 8 Jul 2025 13:34:39 +0100	[thread overview]
Message-ID: <2678a0c0-e075-41dc-aad5-3191703c7359@oracle.com> (raw)
In-Reply-To: <aG0IsTJ88ia4TWmn@li-dc0c254c-257c-11b2-a85c-98b6c1322444.ibm.com>

On 08/07/2025 13:01, Ojaswin Mujoo wrote:
>> You could do the statx call on the mounted bdev, and see if atomics are
>> supported there. If not, skip the test.
>>
>> But even for xfs when HW support is available, we can still use software
>> fallback when HW support is not possible, i.e. misaligned. So, in that
>> regard, we really should only test this on ext4.
> Hmm, okay so I'm a bit confused now. What is different in ext4 vs xfs.
> Why does the software fallback for xfs matter in this case?

For xfs, software fallback-based atomic writes are not even serialized 
against other software fallback-based atomic writes. They can trample on 
one another. That is a reason I say that this test should only be for 
HW-based atomic writes.

But even if the bs <= HW limit, on xfs may rarely still use atomic write 
software fallback if HW-based atomic write is not possible, e.g. 
misaligned, multiple extents, etc. I will emphasis that this would be 
rare, but it is still possible.

For ext4, since alignment is always guaranteed, and HW-based atomics 
will only ever be used.

> If we limit
> io to 16KB hoping that reads don't break, then either ways the fio
> verify should work. And if reads break then both ext4 and xfs suffer
> irrespective of hardware or software fallback. (We also saw that
> hardware atomic writes also suffer with same issue when max_sectors is
> low)
> 
>>> Im not sure if returning non-zero for ext4 is also correct as per the
>>> documented behavior from 5d894321c49e613.
>>>
>>>      When zero, it means that there is no such performance boundary.
>>>
>>> Anyways, I think there might be a simpler solution...
>>>>> The simplest way seems to be to just limit the $blocksize to
>>>>> something like $(_min 16KB awu_max) and hope that 16KB is small enough
>>>>> to not be split during reads. We anyways have other tests like
>>>>> generic/1230 that can be used to test larger atomic write sizes
>>>>>
>>>>> Thoughts?
>>>> As I said at the start, we never had guarantees of serialization of reads
>>>> and atomic writes.
>>>>
>>>> However I still think that this is a useful test. It's just it is
>>>> theoretically possible to give false positives.
>>>>
>>>> You could get the test to read max_sectors_kb, and check whether it is
>>>> greater than the bs. Again, more complexity.
>>> I think this might work. So i can set the iosize as 16kb which is
>>> already low enought. Incase the max_sectors is < than 16kb then we bail
>>> out. (but then maybe there is a very small chance of read split still)
>> Sure, that seems fine.
>>
>>> OR another approach is to do the verify at the very end when all threads
>>> are done writing so the reads don't race. The tradeoff is that this
>>> will reduce the effictiveness of the test though to some extent.
>> Yeah, right. We would want this test to prove that atomic writes are not
>> getting split by the block stack, so racing reads can help prove that.
> Yeahh, but now i'm leaning towards this approach of keeping verify at
> the very end instead of parallel. 

I don't think that fio supports such a mode. Or does it?

> Yes, it is a bit less effective but
> then having a data integrity test that can theoretically return false
> positives is not good, it'll always keep me guessing about any failure.
> Having verify at end will not have false failures for sure. Even though
> it comes at a cost of less coverage.
> 
> Maybe we can also get some other prespectives on this.
> @Zorro, @Darrick, can you please give your thoughts on this?
> 
> As a sidenote, with this issue of fio's verify read splitting, it seems
> like the parallel verify feature in fio itself is flawed for non-atomic
> writes as well since the read can always split and race with the writes.

fio does warn that multiple read and writers in verify mode is unsafe.

> 
> Not sure what the solution is here, maybe time for non splittable atomic
> writes (:p)

I just think that fio in verify mode for ext4 is ok, as long as 
max_sectors_kb is large.

But fundamentally we are trying to test a feature of RWF_ATOMIC which is 
not guaranteed.

Thanks,
John


  reply	other threads:[~2025-07-08 12:34 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-26 11:58 [PATCH v2 00/13] Add more tests for multi fs block atomic writes Ojaswin Mujoo
2025-06-26 11:58 ` [PATCH v2 01/13] common/rc: Add _min() and _max() helpers Ojaswin Mujoo
2025-06-26 11:58 ` [PATCH v2 02/13] common/rc: Fix fsx for ext4 with bigalloc Ojaswin Mujoo
2025-06-26 13:32   ` Theodore Ts'o
2025-06-30 15:28     ` Darrick J. Wong
2025-07-01  6:26       ` Ojaswin Mujoo
2025-07-02 15:13         ` Darrick J. Wong
2025-06-26 11:58 ` [PATCH v2 03/13] common/rc: Add a helper to run fsx on a given file Ojaswin Mujoo
2025-06-26 11:58 ` [PATCH v2 04/13] ltp/fsx.c: Add atomic writes support to fsx Ojaswin Mujoo
2025-06-26 11:58 ` [PATCH v2 05/13] generic/1226: Add atomic write test using fio crc check verifier Ojaswin Mujoo
2025-06-27 14:09   ` John Garry
2025-07-01 16:18     ` Ojaswin Mujoo
2025-07-02  7:46       ` John Garry
2025-07-03  6:42         ` Ojaswin Mujoo
2025-07-03 16:26           ` John Garry
2025-07-04 14:35             ` Ojaswin Mujoo
2025-07-04 15:23               ` Ojaswin Mujoo
2025-07-07  8:18                 ` John Garry
2025-07-08  6:50                   ` Ojaswin Mujoo
2025-07-08 11:11                     ` John Garry
2025-07-08 12:01                       ` Ojaswin Mujoo
2025-07-08 12:34                         ` John Garry [this message]
2025-07-11 10:39                           ` Ojaswin Mujoo
2025-07-11 10:51                             ` John Garry
2025-07-11 18:16                               ` Ojaswin Mujoo
2025-07-07  8:02               ` John Garry
2025-06-26 11:58 ` [PATCH v2 06/13] generic/1227: Add atomic write test using fio verify on file mixed mappings Ojaswin Mujoo
2025-06-27 14:48   ` John Garry
2025-06-26 11:58 ` [PATCH v2 07/13] generic/1228: Add atomic write multi-fsblock O_[D]SYNC tests Ojaswin Mujoo
2025-06-26 11:58 ` [PATCH v2 08/13] generic/1229: Stress fsx with atomic writes enabled Ojaswin Mujoo
2025-06-26 11:59 ` [PATCH v2 09/13] generic/1230: Add sudden shutdown tests for multi block atomic writes Ojaswin Mujoo
2025-06-27 16:11   ` John Garry
2025-07-01  6:34     ` Ojaswin Mujoo
2025-06-26 11:59 ` [PATCH v2 10/13] ext4/061: Atomic writes stress test for bigalloc using fio crc verifier Ojaswin Mujoo
2025-06-26 11:59 ` [PATCH v2 11/13] ext4/062: Atomic writes test for bigalloc using fio crc verifier on multiple files Ojaswin Mujoo
2025-06-26 11:59 ` [PATCH v2 12/13] ext4/063: Atomic write test for extent split across leaf nodes Ojaswin Mujoo
2025-06-26 11:59 ` [PATCH v2 13/13] ext4/064: Add atomic write tests for journal credit calculation Ojaswin Mujoo
2025-06-27 13:56 ` [PATCH v2 00/13] Add more tests for multi fs block atomic writes John Garry

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=2678a0c0-e075-41dc-aad5-3191703c7359@oracle.com \
    --to=john.g.garry@oracle.com \
    --cc=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=ojaswin@linux.ibm.com \
    --cc=ritesh.list@gmail.com \
    --cc=tytso@mit.edu \
    --cc=zlang@redhat.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