Skip to contentSkip to conversation

rdma: remove check on time_spent when calculating mbs

PATCH In review Wei Yang 3 participants 8 messages Jan 25, 2016 – Feb 1, 2016

lore
Share & tools
lore

Wei Yang

author
#0 lore raw

PATCH 1/2 rdma: remove check on time_spent when calculating mbs

Within the if statement, time_spent is assured to be non-zero.

This patch just removes the check on time_spent when calculating mbs.

---
 migration/migration.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
migration/migration.c +2 -2
index c842499..40b87f2 100644
@@ -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);
Signature · 1 line
2.5.0
author
#1 lore raw

PATCH 2/2 qmp-spec: fix index in doc

The index is duplicated. Just change it.

---
 docs/qmp-spec.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
docs/qmp-spec.txt +1 -1
index 4fb10a5..8e4bc3d 100644
@@ -180,7 +180,7 @@ Some events are rate-limited to at most one per second.  If additional
 dropped, and the last one is delayed.  "Similar" normally means same
 event type.  See qmp-events.txt for details.
 
-2.5 QGA Synchronization
+2.6 QGA Synchronization
 -----------------------
 
 When using QGA, an additional synchronization feature is built into
Signature · 1 line
2.5.0
#2 lore raw

Re: [Qemu-devel] [PATCH 2/2] qmp-spec: fix index in doc

Quoted 1 line · Wei Yang

The index is duplicated. Just change it.

It is indeed, with previous being 2.5 as well
and the next being 3. Applying to -trivial.

Please the next time send to qemu-devel@ and Cc to -trivial.

Thanks!

/mjt

Quoted 19 lines
---
 docs/qmp-spec.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
docs/qmp-spec.txt +1 -1
index 4fb10a5..8e4bc3d 100644
@@ -180,7 +180,7 @@ Some events are rate-limited to at most one per second.  If additional
 dropped, and the last one is delayed.  "Similar" normally means same
 event type.  See qmp-events.txt for details.
 
-2.5 QGA Synchronization
+2.6 QGA Synchronization
 -----------------------
 
 When using QGA, an additional synchronization feature is built into
author
#3 lore raw

Re: [Qemu-devel] [PATCH 2/2] qmp-spec: fix index in doc

Quoted 8 lines · Michael Tokarev
Quoted 1 line · Wei Yang

The index is duplicated. Just change it.

It is indeed, with previous being 2.5 as well
and the next being 3. Applying to -trivial.

Please the next time send to qemu-devel@ and Cc to -trivial.

Thanks, got the correct procedure.

Quoted 23 lines

Thanks!

/mjt

Quoted 19 lines
---
 docs/qmp-spec.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
docs/qmp-spec.txt +1 -1
index 4fb10a5..8e4bc3d 100644
@@ -180,7 +180,7 @@ Some events are rate-limited to at most one per second.  If additional
 dropped, and the last one is delayed.  "Similar" normally means same
 event type.  See qmp-events.txt for details.
 
-2.5 QGA Synchronization
+2.6 QGA Synchronization
 -----------------------
 
 When using QGA, an additional synchronization feature is built into
Signature · 2 lines
Wei Yang
Help you, Help me
author
#4 lore raw
In reply to Wei Yang

Someone like these two patches? :)

Quoted 26 lines · Wei Yang

Within the if statement, time_spent is assured to be non-zero.

This patch just removes the check on time_spent when calculating mbs.

---
migration/migration.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
migration/migration.c +2 -2
index c842499..40b87f2 100644
@@ -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);
Signature · 1 line
2.5.0
Signature · 2 lines
Wei Yang
Help you, Help me
#5 lore raw
Quoted 1 line · Wei Yang

Someone like these two patches? :)

Could you please post these to qemu-devel as well?

Thanks,

Amit

#6 lore raw
In reply to Wei Yang
Quoted 3 lines · Wei Yang

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.

Thanks!

/mjt

Quoted 21 lines
---
 migration/migration.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
migration/migration.c +2 -2
index c842499..40b87f2 100644
@@ -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);
author
#7 lore raw
Quoted 7 lines · Michael Tokarev
Quoted 3 lines · Wei Yang

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:

Quoted 9 lines
       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.

Quoted 25 lines

Thanks!

/mjt

Quoted 21 lines
---
 migration/migration.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
migration/migration.c +2 -2
index c842499..40b87f2 100644
@@ -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);
Signature · 2 lines
Wei Yang
Help you, Help me