Thread (19 messages) 19 messages, 4 authors, 2022-07-20

Re: [PATCH v3 1/8] statx: add direct I/O alignment information

From: Christoph Hellwig <hch@infradead.org>
Date: 2022-06-26 07:44:27
Also in: linux-block, linux-ext4, linux-f2fs-devel, linux-fscrypt, linux-fsdevel, linux-xfs, lkml

On Sun, Jun 19, 2022 at 02:30:47PM +0300, Avi Kivity wrote:
quoted
* 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.  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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help