From: Stefan Hajnoczi <stefanha@gmail.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, kwolf@redhat.com,
den@openvz.org, mreitz@redhat.com
Subject: Re: [Qemu-devel] [Qemu-block] [RFC] block-backend: fix double inc/dec inflight requests number
Date: Thu, 25 Jan 2018 11:37:24 +0000 [thread overview]
Message-ID: <20180125113724.GA28396@stefanha-x1.localdomain> (raw)
In-Reply-To: <20180122144549.25318-1-vsementsov@virtuozzo.com>
[-- Attachment #1: Type: text/plain, Size: 1205 bytes --]
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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
next prev parent reply other threads:[~2018-01-25 11:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-22 14:45 [Qemu-devel] [RFC] block-backend: fix double inc/dec inflight requests number Vladimir Sementsov-Ogievskiy
2018-01-25 11:37 ` Stefan Hajnoczi [this message]
2018-01-29 15:30 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
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=20180125113724.GA28396@stefanha-x1.localdomain \
--to=stefanha@gmail.com \
--cc=den@openvz.org \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).