qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH 01/17] blockjob: Track job ratelimits via bytes,


From: Eric Blake
Subject: Re: [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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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