[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [PATCH 1/2] rdma: remove check on time_spent when cal
From: |
Wei Yang |
Subject: |
Re: [Qemu-trivial] [PATCH 1/2] rdma: remove check on time_spent when calculating mbs |
Date: |
Mon, 1 Feb 2016 12:54:53 +0000 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Sat, Jan 30, 2016 at 12:45:27PM +0300, Michael Tokarev wrote:
>24.01.2016 17:09, Wei Yang wrote:
>> Within the if statement, time_spent is assured to be non-zero.
>>
>> This patch just removes the check on time_spent when calculating mbs.
>
>The if statement is this one:
>
> if (current_time >= initial_time + BUFFER_DELAY) {
>
>Note that we use time_spent as a divisor to calculate
>bandwidth too.
>
>This is indeed a trivial patch, I'm applying it to -trivial,
>but please the next time post it to qemu-devel (the main
>mailinglist), and Cc qemu-trivial if it is trivial.
>
To Amit and Michael,
Yep, thanks. I thought these two are too trivial to post to qemu-devel :)
Will do this next time.
>Thanks!
>
>/mjt
>
>> Signed-off-by: Wei Yang <address@hidden>
>> ---
>> migration/migration.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/migration/migration.c b/migration/migration.c
>> index c842499..40b87f2 100644
>> --- a/migration/migration.c
>> +++ b/migration/migration.c
>> @@ -1677,8 +1677,8 @@ static void *migration_thread(void *opaque)
>> double bandwidth = (double)transferred_bytes / time_spent;
>> max_size = bandwidth * migrate_max_downtime() / 1000000;
>>
>> - s->mbps = time_spent ? (((double) transferred_bytes * 8.0) /
>> - ((double) time_spent / 1000.0)) / 1000.0 / 1000.0 : -1;
>> + s->mbps = (((double) transferred_bytes * 8.0) /
>> + ((double) time_spent / 1000.0)) / 1000.0 / 1000.0;
>>
>> trace_migrate_transferred(transferred_bytes, time_spent,
>> bandwidth, max_size);
>>
--
Wei Yang
Help you, Help me
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-trivial] [PATCH 1/2] rdma: remove check on time_spent when calculating mbs,
Wei Yang <=