From: Jens Axboe <axboe@kernel.dk>
To: John Garry <john.g.garry@oracle.com>, fio@vger.kernel.org
Cc: martin.petersen@oracle.com, djwong@kernel.org, mcgrof@kernel.org,
david@fromorbit.com
Subject: Re: [PATCH 0/7] fio: atomic write support
Date: Tue, 10 Sep 2024 10:56:03 -0600 [thread overview]
Message-ID: <3660f96b-ab31-40f9-9cfe-ebf5e84b0a4c@kernel.dk> (raw)
In-Reply-To: <df880559-4408-4bc7-811b-353699c467cd@oracle.com>
On 9/10/24 10:38 AM, John Garry wrote:
> On 10/09/2024 16:56, Jens Axboe wrote:
>>>> t drop that patch.
>> (side note - please wrap your email lines, I always re-wrap when
>> replying)
>
> ok
This one too :)
>>> Some background is that main selling point of atomic writes is that we
>>> guarantee writes to storage will not be torn for a power failure or
>>> kernel crash.
>>>
>>> Another aspect of atomic writes is that they handle racing writes and
>>> reads, such that a read racing with a write will see all the data from
>>> the write or none. Well, SCSI and NVMe guarantee this if using
>>> RWF_ATOMIC, but it is not formally stated as a feature of RWF_ATOMIC.
>>>
>>> It can be argued that having racing reads and writes is an application
>>> bug. Furthermore, as I understand, even if posix guarantees that
>>> regular writes are "atomic", it is not the case generally.
>>>
>>> So one part of the relevance of atomic writes to fio verify is that we
>>> can verify that atomic writes "safely" handle racing read and writes.
>>> For this, the CRC checks would be successful if we have many jobs;
>>> however header sequence numbers are not. Hence patch 4/7.
>>>
>>> I had also been using the verify feature to test atomic writes for
>>> power failures. In this case, I run a single verify job with
>>> --rw=write, power fail, and use verify in read mode to prove no
>>> invalid data in the file, like:
>>>
>>> fio --filename=mnt/file --direct=1 --rw=read --bs=8k --iodepth=100 --na
>>> me=iops --numjobs=1 --loops=1 --verify=crc64 --ioengine=libaio
>>> --verify_fatal=1 --group_reporting --exitall_on_error
>>>
>>> This power fail test is what I am mostly interested in.
>>>
>>> So my point is that the patch to ignore invalid headers could be
>>> dropped, but let me know your thoughts.
>> Gotcha, that makes sense. For atomic writes, it's totally fine to have
>> overlapping writers if the write size is in the atomic units, but we can
>> of course expect sequences to be out of order depending on which one
>> makes it to stable storage. But you have no checks for whether or not
>> the write size is within the atomic range?
>
> I don't currently. If an atomic write size is out-of-range, the kernel
> will reject it with -EINVAL. However -EINVAL can be returned for a
> multitude of issues, so not much help. So I could add a statx call to
> get the limits and then error the fio config (if bs is out-of-range).
Good point, I guess that's good enough then. If it's an invalid
configuration, then the writes will get errored anyway.
>> I think dropping patch 4 and adding a verify option to specifically
>> ignore the sequence would make sense, leaving the control in the hands
>> of the user.
>
> I already saw verify modes "no header" and "header only", so I was
> reluctant to add a potentially conflicting new separate option to
> ignore the header sequence. However, I can look to add a new verify
> option to ignore the header sequence and ensure it respects those
> mentioned verify modes.
I think you'd be fine adding a verify_write_sequence bool and just have
it default to true.
>> And then bonus points for adding an example job file (with
>> comments) in your series that shows how to use atomic writes (and uses
>> that option) would be useful.
>
> ok, I'm happy to do that.
Great, thanks.
--
Jens Axboe
next prev parent reply other threads:[~2024-09-10 16:56 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-29 12:31 [PATCH 0/7] fio: atomic write support John Garry
2024-08-29 12:31 ` [PATCH 1/7] os-linux: Renumber RWF_UNCACHED John Garry
2024-08-29 13:16 ` Jens Axboe
2024-08-29 12:31 ` [PATCH 2/7] os-linux: Define RWF_ATOMIC John Garry
2024-08-29 12:31 ` [PATCH 3/7] os: Reintroduce atomic write support John Garry
2024-08-29 12:31 ` [PATCH 4/7] verify: Ignore sequence number errors for atomic writes John Garry
2024-08-29 12:31 ` [PATCH 5/7] pvsync2: Support RWF_ATOMIC John Garry
2024-08-29 12:31 ` [PATCH 6/7] libaio: " John Garry
2024-08-29 12:31 ` [PATCH 7/7] io_uring: " John Garry
2024-09-05 9:37 ` [PATCH 0/7] fio: atomic write support Luis Chamberlain
2024-09-06 15:22 ` John Garry
2024-09-06 23:29 ` Luis Chamberlain
2024-09-09 8:12 ` John Garry
2024-09-09 19:48 ` Jens Axboe
2024-09-09 20:20 ` John Garry
2024-09-09 21:03 ` Luis Chamberlain
2024-09-09 19:53 ` Jens Axboe
2024-09-09 20:28 ` John Garry
2024-09-10 1:01 ` Jens Axboe
2024-09-10 10:03 ` John Garry
2024-09-10 15:56 ` Jens Axboe
2024-09-10 16:38 ` John Garry
2024-09-10 16:56 ` Jens Axboe [this message]
2024-09-10 17:17 ` 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=3660f96b-ab31-40f9-9cfe-ebf5e84b0a4c@kernel.dk \
--to=axboe@kernel.dk \
--cc=david@fromorbit.com \
--cc=djwong@kernel.org \
--cc=fio@vger.kernel.org \
--cc=john.g.garry@oracle.com \
--cc=martin.petersen@oracle.com \
--cc=mcgrof@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.