From: Wei Yang <richard.weiyang@gmail.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: qemu-trivial@nongnu.org, amit.shah@redhat.com,
quintela@redhat.com, qemu-devel <qemu-devel@nongnu.org>,
Wei Yang <richard.weiyang@gmail.com>
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 [thread overview]
Message-ID: <20160201125453.GB18246@vultr.guest> (raw)
In-Reply-To: <56AC8637.20304@msgid.tls.msk.ru>
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 <richard.weiyang@gmail.com>
>> ---
>> 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 parent reply other threads:[~2016-02-01 12:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-24 14:09 [Qemu-trivial] [PATCH 1/2] rdma: remove check on time_spent when calculating mbs Wei Yang
2016-01-24 14:09 ` [Qemu-trivial] [PATCH 2/2] qmp-spec: fix index in doc Wei Yang
2016-01-30 9:46 ` Michael Tokarev
2016-02-01 12:52 ` Wei Yang
2016-01-29 14:03 ` [Qemu-trivial] [PATCH 1/2] rdma: remove check on time_spent when calculating mbs Wei Yang
2016-01-29 14:37 ` Amit Shah
2016-01-30 9:45 ` Michael Tokarev
2016-02-01 12:54 ` Wei Yang [this message]
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=20160201125453.GB18246@vultr.guest \
--to=richard.weiyang@gmail.com \
--cc=amit.shah@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=quintela@redhat.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).