qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hanna Czenczek <hreitz@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org,
	Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
	Kevin Wolf <kwolf@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>, Fam Zheng <fam@euphon.net>
Subject: Re: [PATCH 4/4] iotests/iov-padding: New test
Date: Mon, 3 Apr 2023 16:23:08 +0200	[thread overview]
Message-ID: <2ca93485-4597-8545-8258-a37d2573c45b@redhat.com> (raw)
In-Reply-To: <20230318123907.jvakflmadbqfaszk@redhat.com>

On 18.03.23 13:39, Eric Blake wrote:
> On Fri, Mar 17, 2023 at 06:50:19PM +0100, Hanna Czenczek wrote:
>> Test that even vectored IO requests with 1024 vector elements that are
>> not aligned to the device's request alignment will succeed.
>>
>> Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
>> ---
>> +
>> +# Four combinations:
>> +# - Offset 4096, length 1023 * 512 + 512: Fully aligned to 4k
>> +# - Offset 4096, length 1023 * 512 + 4096: Head is aligned, tail is not
> Making sure I understand - we don't care if intermediate iovs are
> smaller than the alignment requirement, because the scatter-gather
> effects will pool it together and our overall request is still
> aligned.  Correct?

Not trivial to answer, but the short answer is that we don’t care.

The long answer: Padding is only done for head and tail, so intermediate 
alignment doesn’t matter – for the interface. Internally, it does 
actually matter, because every single buffer in the vector must be 
aligned to the memory alignment, and its length must be aligned to the 
request alignment (bdrv_qiov_is_aligned()). If those requirements aren’t 
met, the file-posix driver will mark the request as QEMU_AIO_MISALIGNED, 
and emulate it (with many separate writes) instead of handing it over to 
a kernel interface that would take the full vector.

That doesn’t really matter for the test, but explains why this was no 
issue before we decided to actually internally limited I/O vectors to 
1024 elements: If the guest sees a smaller request alignment than the 
host has, and then submits a 1024-element vectored request, there is for 
sure going to be some buffer in those 1024 elements that isn’t fully 
aligned.  Therefore, qemu will emulate the request, and so it doesn’t 
matter whether we increased its length past 1024 elements.

So what it does mean for the test is that these requests’ I/O vectors 
are never going to be passed to the kernel as-is, so that code path 
isn’t exercised.  But, as laid out in the previous paragraph, that code 
path isn’t exercised with guest OSs either.

> Reviewed-by: Eric Blake <eblake@redhat.com>

Thanks!



  reply	other threads:[~2023-04-03 14:24 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-17 17:50 [PATCH 0/4] block: Split padded I/O vectors exceeding IOV_MAX Hanna Czenczek
2023-03-17 17:50 ` [PATCH 1/4] util/iov: Make qiov_slice() public Hanna Czenczek
2023-03-18 12:06   ` Eric Blake
2023-03-20 10:00   ` Vladimir Sementsov-Ogievskiy
2023-03-17 17:50 ` [PATCH 2/4] block: Split padded I/O vectors exceeding IOV_MAX Hanna Czenczek
2023-03-18 12:19   ` Eric Blake
2023-03-20 10:31   ` Vladimir Sementsov-Ogievskiy
2023-04-03 13:33     ` Hanna Czenczek
2023-04-04  8:10       ` Vladimir Sementsov-Ogievskiy
2023-04-04 17:32         ` Hanna Czenczek
2023-04-05  9:59           ` Vladimir Sementsov-Ogievskiy
2023-04-06 16:51             ` Hanna Czenczek
2023-04-06 21:35               ` Vladimir Sementsov-Ogievskiy
2023-03-17 17:50 ` [PATCH 3/4] util/iov: Remove qemu_iovec_init_extended() Hanna Czenczek
2023-03-18 12:22   ` Eric Blake
2023-03-20 11:59   ` Vladimir Sementsov-Ogievskiy
2023-03-17 17:50 ` [PATCH 4/4] iotests/iov-padding: New test Hanna Czenczek
2023-03-18 12:39   ` Eric Blake
2023-04-03 14:23     ` Hanna Czenczek [this message]
2023-03-20 12:12   ` Vladimir Sementsov-Ogievskiy
2023-04-05 19:44 ` [PATCH 0/4] block: Split padded I/O vectors exceeding IOV_MAX Stefan Hajnoczi

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=2ca93485-4597-8545-8258-a37d2573c45b@redhat.com \
    --to=hreitz@redhat.com \
    --cc=eblake@redhat.com \
    --cc=fam@euphon.net \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vsementsov@yandex-team.ru \
    /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;
as well as URLs for NNTP newsgroup(s).