qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 11/12] blkio: implement BDRV_REQ_REGISTERED_BUF optimizati


From: Stefan Hajnoczi
Subject: Re: [PATCH v5 11/12] blkio: implement BDRV_REQ_REGISTERED_BUF optimization
Date: Thu, 6 Oct 2022 14:46:49 -0400

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@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
refined.

Stefan

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]