[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 07/18] throttle-groups: only start one coroutine
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 07/18] throttle-groups: only start one coroutine from drained_begin |
Date: |
Tue, 16 May 2017 14:54:25 +0100 |
User-agent: |
Mutt/1.8.0 (2017-02-23) |
On Thu, May 11, 2017 at 04:41:57PM +0200, Paolo Bonzini wrote:
> Starting all waiting coroutines from bdrv_drain_all is unnecessary;
> throttle_group_co_io_limits_intercept calls schedule_next_request as
> soon as the coroutine restarts, which in turn will restart the next
> request if possible.
>
> If we only start the first request and let the coroutines dance from
> there the code is simpler and there is more reuse between
> throttle_group_config, throttle_group_restart_blk and timer_cb. The
> next patch will benefit from this.
>
> We also stop accessing from throttle_group_restart_blk the
> blkp->throttled_reqs CoQueues even when there was no
> attached throttling group. This worked but is not pretty.
>
> The only thing that can interrupt the dance is the QEMU_CLOCK_VIRTUAL
> timer when switching from one block device to the next, because the
> timer is set to "now + 1" but QEMU_CLOCK_VIRTUAL might not be running.
> Set that timer to point in the present ("now") rather than the future
> and things work.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> v1->v2: new
>
> block/throttle-groups.c | 45 +++++++++++++++++++++++++--------------------
> 1 file changed, 25 insertions(+), 20 deletions(-)
Reviewed-by: Stefan Hajnoczi <address@hidden>
signature.asc
Description: PGP signature
- Re: [Qemu-devel] [Qemu-block] [PATCH 02/18] block: access quiesce_counter with atomic ops, (continued)
- [Qemu-devel] [PATCH 05/18] block: access wakeup with atomic ops, Paolo Bonzini, 2017/05/11
- [Qemu-devel] [PATCH 09/18] throttle-groups: protect throttled requests with a CoMutex, Paolo Bonzini, 2017/05/11
- [Qemu-devel] [PATCH 06/18] block: access io_plugged with atomic ops, Paolo Bonzini, 2017/05/11
- [Qemu-devel] [PATCH 08/18] throttle-groups: do not use qemu_co_enter_next, Paolo Bonzini, 2017/05/11
- [Qemu-devel] [PATCH 07/18] throttle-groups: only start one coroutine from drained_begin, Paolo Bonzini, 2017/05/11
- [Qemu-devel] [PATCH 10/18] util: add stats64 module, Paolo Bonzini, 2017/05/11
- [Qemu-devel] [PATCH 13/18] block: protect tracked_requests and flush_queue with reqs_lock, Paolo Bonzini, 2017/05/11
- [Qemu-devel] [PATCH 11/18] block: use Stat64 for wr_highest_offset, Paolo Bonzini, 2017/05/11
- [Qemu-devel] [PATCH 12/18] block: access write_gen with atomics, Paolo Bonzini, 2017/05/11
- [Qemu-devel] [PATCH 15/18] migration/block: reset dirty bitmap before reading, Paolo Bonzini, 2017/05/11
- [Qemu-devel] [PATCH 14/18] block: introduce dirty_bitmap_mutex, Paolo Bonzini, 2017/05/11