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:00:15 -0400

On Wed, Sep 28, 2022 at 09:12:36PM +0100, Alberto Campinho Faria wrote:
> On Wed, Sep 28, 2022 at 8:21 PM Stefan Hajnoczi <stefanha@redhat.com> wrote:
> > On Tue, Sep 27, 2022 at 03:34:30PM -0400, Stefan Hajnoczi wrote:
> > > +    ret = blkio_get_bool(s->blkio,
> > > +                         "mem-regions-pinned",
> > > +                         &s->mem_regions_pinned);
> > > +    if (ret < 0) {
> > > +        /* Be conservative (assume pinning) if the property is not 
> > > supported */
> > > +        s->mem_regions_pinned = true;
> >
> > This is too conservative :). It can be changed to:
> >
> >   s->mem_regions_pinned = s->needs_mem_regions;
> >
> > That way we avoid ram_block_discard_disable() for libblkio drivers (like
> > io_uring in libblkio 1.0) that don't use memory regions and don't
> > support the "mem-regions-pinned" property yet.
> 
> Even if a driver doesn't _need_ memory regions to be mapped before
> use, it may still do something special with the ones that _are_
> mapped, so we may have no choice but to set s->mem_regions_pinned =
> true.
> 
> (Unless we are assuming that all future libblkio versions will either
> not have such drivers, or will provide a "mem-regions-pinned"
> property, but that feels brittle.)

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.

Stefan

Attachment: signature.asc
Description: PGP signature


reply via email to

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