[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <23067de5-7955-7f58-f8ad-70a812602ac8@scylladb.com>
Date: Sun, 26 Jun 2022 13:20:22 +0300
From: Avi Kivity <avi@...lladb.com>
To: Christoph Hellwig <hch@...radead.org>
Cc: Eric Biggers <ebiggers@...nel.org>, linux-fsdevel@...r.kernel.org,
linux-ext4@...r.kernel.org, linux-f2fs-devel@...ts.sourceforge.net,
linux-xfs@...r.kernel.org, linux-api@...r.kernel.org,
linux-fscrypt@...r.kernel.org, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, Keith Busch <kbusch@...nel.org>
Subject: Re: [PATCH v3 1/8] statx: add direct I/O alignment information
On 26/06/2022 10.44, Christoph Hellwig wrote:
> On Sun, Jun 19, 2022 at 02:30:47PM +0300, Avi Kivity wrote:
>>> * stx_dio_offset_align: the alignment (in bytes) required for file
>>> offsets and I/O segment lengths for DIO, or 0 if DIO is not supported
>>> on the file. This will only be nonzero if stx_dio_mem_align is
>>> nonzero, and vice versa.
>>
>> If you consider AIO, this is actually three alignments:
>>
>> 1. offset alignment for reads (sector size in XFS)
>>
>> 2. offset alignment for overwrites (sector size in XFS since ed1128c2d0c87e,
>> block size earlier)
>>
>> 3. offset alignment for appending writes (block size)
>>
>>
>> This is critical for linux-aio since violation of these alignments will
>> stall the io_submit system call. Perhaps io_uring handles it better by
>> bouncing to a workqueue, but there is a significant performance and latency
>> penalty for that.
> I think you are mixing things up here.
Yes.
> We actually have two limits that
> matter:
>
> a) the hard limit, which if violated will return an error.
> This has been sector size for all common file systems for years,
> but can be bigger than that with fscrypt in the game (which
> triggered this series)
> b) an optimal write size, which can be done asynchronous and
> without exclusive locking.
> This is what your cases 2) and 3) above refer to.
>
> Exposting this additional optimal performance size might be a good idea
> in addition to what is proposed here, even if matters a little less
> with io_uring. But I'm not sure I'd additional split it into append
> vs overwrite vs hole filling but just round up to the maximum of those.
Rounding up will penalize database workloads, with and without io_uring.
Database commit logs are characterized by frequent small writes. Telling
the database to round up to 4k vs 512 bytes means large write
amplification. The disk probably won't care (or maybe it will - it will
also have to generate more erase blocks), but the database will run out
of commitlog space much sooner and will have to compensate in expensive
ways.
Of course, people that care can continue to use internal filesystem
knowledge, and maybe there are few enough of those that the API can
choose to ignore them.
Powered by blists - more mailing lists