qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [RFC] block-backend: fix double inc/dec inflight reques


From: Stefan Hajnoczi
Subject: Re: [Qemu-block] [RFC] block-backend: fix double inc/dec inflight requests number
Date: Thu, 25 Jan 2018 11:37:24 +0000
User-agent: Mutt/1.9.1 (2017-09-22)

On Mon, Jan 22, 2018 at 05:45:49PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> Is it a bug or a feature? Why do we call inc/dec twice for read/write?
> We don't do this for flush and discard..

It's non-obvious and I asked Paolo the same question previously.

> -    bdrv_inc_in_flight(bs);
> -
>      /* throttling disk I/O */
>      if (blk->public.throttle_group_member.throttle_state) {
>          
> throttle_group_co_io_limits_intercept(&blk->public.throttle_group_member,
>                  bytes, false);
>      }

^^^ HINT HINT HINT ^^^

>  
> -    ret = bdrv_co_preadv(blk->root, offset, bytes, qiov, flags);
> -    bdrv_dec_in_flight(bs);
> -    return ret;
> +    return bdrv_co_preadv(blk->root, offset, bytes, qiov, flags);

The problem is what happens if the request is throttled?

Even throttled requests must be counted so that bdrv_drain() and friends
work.

It may be possible to eliminate this now that throttling is a BDS node.
It used to be implemented as a completely separate API outside the BDS
node graph.  Now there is a throttling node in the graph, so maybe we
can stop taking the extra reference but some refactoring may be
necessary.

Stefan

Attachment: signature.asc
Description: PGP signature


reply via email to

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