[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aKh-9nOqiSbMAtwo@kbusch-mbp>
Date: Fri, 22 Aug 2025 08:30:14 -0600
From: Keith Busch <kbusch@...nel.org>
To: Ritesh Harjani <ritesh.list@...il.com>
Cc: Keith Busch <kbusch@...a.com>, linux-block@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-ext4@...r.kernel.org, snitzer@...nel.org, axboe@...nel.dk,
dw@...idwei.uk, brauner@...nel.org, hch@....de,
martin.petersen@...cle.com, djwong@...nel.org,
linux-xfs@...r.kernel.org, viro@...iv.linux.org.uk,
Jan Kara <jack@...e.com>
Subject: Re: [PATCHv3 0/8] direct-io: even more flexible io vectors
On Fri, Aug 22, 2025 at 06:57:08PM +0530, Ritesh Harjani wrote:
> Keith Busch <kbusch@...a.com> writes:
>
> BTW - I did some basic testing of the series against block device, XFS &
> EXT4 and it worked as expected (for both DIO & AIO-DIO) i.e.
> 1. Individial iov_len need not be aligned to the logical block size anymore.
> 2. Total length of iovecs should be logical block size aligned though.
>
> i.e. this combination works with this patch series now:
>
> posix_memalign((void**)&aligned_buf, mem_align, 2 * BLOCK_SIZE);
> struct iovec iov[4] = {
> {.iov_base = aligned_buf, .iov_len = 500},
> {.iov_base = aligned_buf + 500, .iov_len = 1500},
> {.iov_base = aligned_buf + 2000, .iov_len = 2000},
> {.iov_base = aligned_buf + 4000, .iov_len = 4192}
> }; // 500 + 1500 + 2000 + 4192 = 8192
Yep, the kernel would have rejected that before, but should work now. An
added bonus, the code doesn't spend CPU cycles walking the iovec early
anymore.
Your test, though, is not getting to the real good stuff! :) Your
vectors are virtually contiguous, so the block layer will merge them to
maybe only one block sized segment. Add some offsets to create gaps, but
still adhere to your device's dma and virtual boundary limits. Your
offset options may be constrained if you're using NVMe, but I have a
follow up series fixing that for capable hardware.
Powered by blists - more mailing lists