[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Qemu-block] [PATCH 01/17] blockjob: Track job ratelimi
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [Qemu-block] [PATCH 01/17] blockjob: Track job ratelimits via bytes, not sectors |
Date: |
Mon, 17 Apr 2017 14:51:29 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 |
On 04/17/2017 02:18 PM, John Snow wrote:
>
>
> On 04/11/2017 06:29 PM, Eric Blake wrote:
>> The user interface specifies job rate limits in bytes/second.
>> It's pointless to have our internal representation track things
>> in sectors/second, particularly since we want to move away from
>> sector-based interfaces.
>>
>> Fix up a doc typo found while verifying that the ratelimit
>> code handles the scaling difference.
>>
>> Signed-off-by: Eric Blake <address@hidden>
>> ---
>> +++ b/block/commit.c
>> @@ -195,7 +195,8 @@ static void coroutine_fn commit_run(void *opaque)
>> s->common.offset += n * BDRV_SECTOR_SIZE;
>>
>> if (copy && s->common.speed) {
>> - delay_ns = ratelimit_calculate_delay(&s->limit, n);
>> + delay_ns = ratelimit_calculate_delay(&s->limit,
>> + n * BDRV_SECTOR_SIZE);
>
> You could probably factor out this calculation in conjunction with the
> offset update above, but no matter.
It gets simplified in a later patch, when I switch the entire function
to track by bytes instead of sectors.
>> +++ b/block/stream.c
>> @@ -191,7 +191,8 @@ static void coroutine_fn stream_run(void *opaque)
>> /* Publish progress */
>> s->common.offset += n * BDRV_SECTOR_SIZE;
>> if (copy && s->common.speed) {
>> - delay_ns = ratelimit_calculate_delay(&s->limit, n);
>> + delay_ns = ratelimit_calculate_delay(&s->limit,
>> + n * BDRV_SECTOR_SIZE);
>
> Same kind of comment here.
And same response :)
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 00/17] make bdrv_is_allocated[_above] byte-based, Eric Blake, 2017/04/11
- [Qemu-devel] [PATCH 01/17] blockjob: Track job ratelimits via bytes, not sectors, Eric Blake, 2017/04/11
- [Qemu-devel] [PATCH 03/17] stream: Switch stream_populate() to byte-based, Eric Blake, 2017/04/11
- [Qemu-devel] [PATCH 04/17] stream: Switch stream_run() to byte-based, Eric Blake, 2017/04/11
- [Qemu-devel] [PATCH 02/17] trace: Show blockjob actions via bytes, not sectors, Eric Blake, 2017/04/11
- [Qemu-devel] [PATCH 05/17] commit: Switch commit_populate() to byte-based, Eric Blake, 2017/04/11
- [Qemu-devel] [PATCH 06/17] commit: Switch commit_run() to byte-based, Eric Blake, 2017/04/11
- [Qemu-devel] [PATCH 08/17] mirror: Switch mirror_do_zero_or_discard() to byte-based, Eric Blake, 2017/04/11
- [Qemu-devel] [PATCH 07/17] mirror: Switch MirrorBlockJob to byte-based, Eric Blake, 2017/04/11