[GEDI] [PATCH v5 11/12] blkio: implement BDRV_REQ_REGISTERED_BUF optimization

Stefan Hajnoczi stefanha at redhat.com
Thu Oct 6 18:46:49 UTC 2022

On Thu, Oct 06, 2022 at 07:09:36PM +0100, Alberto Faria wrote:
> On Thu, Oct 6, 2022 at 7:00 PM Stefan Hajnoczi <stefanha at redhat.com> wrote:
> > s->needs_mem_regions determines if we'll use libblkio memory regions at
> > all. When it's false we skip blkio_map_mem_region() and therefore it's
> > safe to set s->mem_regions_pinned to false.
> blkio_register_buf() calls blkio_map_mem_region(). Is the
> bdrv_register_buf callback maybe skipped somehow when
> needs_mem_regions is false?

You're right. blkio_register_buf() will be called by virtio-blk's ram
block registrar even when s->needs_mem_regions is false.

s->mem_regions_pinned therefore has to default to true even when
s->needs_mem_regions is false.

> Regardless, I'd say we want to map memory regions even if we don't
> strictly need to (in cases where we can do so at no additional cost),
> since that may improve performance for some drivers.

The downside is that when s->mem_regions_pinned is true, virtio-mem and
anything else that calls ram discard cannot be used.

I think we can try that for now and see if the policy needs to be

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.gluster.org/pipermail/integration/attachments/20221006/eb0a044b/attachment-0001.sig>

More information about the integration mailing list