From: Stefan Hajnoczi <stefanha@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-block@nongnu.org, sgarzare@redhat.com, qemu-devel@nongnu.org
Subject: Re: [PATCH] blkio: Respect memory-alignment for bounce buffer allocations
Date: Wed, 31 Jan 2024 15:07:53 -0500 [thread overview]
Message-ID: <20240131200753.GA396296@fedora> (raw)
In-Reply-To: <20240131173140.42398-1-kwolf@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 890 bytes --]
On Wed, Jan 31, 2024 at 06:31:40PM +0100, Kevin Wolf wrote:
> blkio_alloc_mem_region() requires that the requested buffer size is a
> multiple of the memory-alignment property. If it isn't, the allocation
> fails with a return value of -EINVAL.
>
> Fix the call in blkio_resize_bounce_pool() to make sure the requested
> size is properly aligned.
>
> I observed this problem with vhost-vdpa, which requires page aligned
> memory. As the virtio-blk device behind it still had 512 byte blocks, we
> got bs->bl.request_alignment = 512, but actually any request that needed
> a bounce buffer and was not aligned to 4k would fail without this fix.
>
> Suggested-by: Stefano Garzarella <sgarzare@redhat.com>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> block/blkio.c | 3 +++
> 1 file changed, 3 insertions(+)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2024-01-31 20:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-31 17:31 [PATCH] blkio: Respect memory-alignment for bounce buffer allocations Kevin Wolf
2024-01-31 17:45 ` Stefano Garzarella
2024-01-31 20:07 ` Stefan Hajnoczi [this message]
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=20240131200753.GA396296@fedora \
--to=stefanha@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=sgarzare@redhat.com \
/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.