[Qemu-devel] [PATCH v2 3/3] migration: update ram_counters for multifd sync packet

Ivan Ren posted 3 patches 6 years, 3 months ago
Maintainers: "Dr. David Alan Gilbert" <dgilbert@redhat.com>, Juan Quintela <quintela@redhat.com>
[Qemu-devel] [PATCH v2 3/3] migration: update ram_counters for multifd sync packet
Posted by Ivan Ren 6 years, 3 months ago
Multifd sync will send MULTIFD_FLAG_SYNC flag info to destination, add
these bytes to ram_counters record.

Signed-off-by: Ivan Ren <ivanren@tencent.com>
---
 migration/ram.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/migration/ram.c b/migration/ram.c
index 88ddd2bbe2..20b6eebb7c 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1085,6 +1085,8 @@ static void multifd_send_sync_main(RAMState *rs)
         p->flags |= MULTIFD_FLAG_SYNC;
         p->pending_job++;
         qemu_file_update_transfer(rs->f, p->packet_len);
+        ram_counters.multifd_bytes += p->packet_len;
+        ram_counters.transferred += p->packet_len;
         qemu_mutex_unlock(&p->mutex);
         qemu_sem_post(&p->sem);
     }
-- 
2.17.2 (Apple Git-113)


Re: [Qemu-devel] [PATCH v2 3/3] migration: update ram_counters for multifd sync packet
Posted by Wei Yang 6 years, 3 months ago
On Mon, Jul 29, 2019 at 04:01:21PM +0800, Ivan Ren wrote:
>Multifd sync will send MULTIFD_FLAG_SYNC flag info to destination, add
>these bytes to ram_counters record.
>
>Signed-off-by: Ivan Ren <ivanren@tencent.com>

Also this is suggested by me, it would be better to add Suggested-by.

>---
> migration/ram.c | 2 ++
> 1 file changed, 2 insertions(+)
>
>diff --git a/migration/ram.c b/migration/ram.c
>index 88ddd2bbe2..20b6eebb7c 100644
>--- a/migration/ram.c
>+++ b/migration/ram.c
>@@ -1085,6 +1085,8 @@ static void multifd_send_sync_main(RAMState *rs)
>         p->flags |= MULTIFD_FLAG_SYNC;
>         p->pending_job++;
>         qemu_file_update_transfer(rs->f, p->packet_len);
>+        ram_counters.multifd_bytes += p->packet_len;
>+        ram_counters.transferred += p->packet_len;
>         qemu_mutex_unlock(&p->mutex);
>         qemu_sem_post(&p->sem);
>     }
>-- 
>2.17.2 (Apple Git-113)
>

-- 
Wei Yang
Help you, Help me

Re: [Qemu-devel] [PATCH v2 3/3] migration: update ram_counters for multifd sync packet
Posted by Ivan Ren 6 years, 3 months ago
Thanks
I'll send a new version with these suggest info and review info.

On Tue, Jul 30, 2019 at 8:42 AM Wei Yang <richardw.yang@linux.intel.com>
wrote:

> On Mon, Jul 29, 2019 at 04:01:21PM +0800, Ivan Ren wrote:
> >Multifd sync will send MULTIFD_FLAG_SYNC flag info to destination, add
> >these bytes to ram_counters record.
> >
> >Signed-off-by: Ivan Ren <ivanren@tencent.com>
>
> Also this is suggested by me, it would be better to add Suggested-by.
>
> >---
> > migration/ram.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> >diff --git a/migration/ram.c b/migration/ram.c
> >index 88ddd2bbe2..20b6eebb7c 100644
> >--- a/migration/ram.c
> >+++ b/migration/ram.c
> >@@ -1085,6 +1085,8 @@ static void multifd_send_sync_main(RAMState *rs)
> >         p->flags |= MULTIFD_FLAG_SYNC;
> >         p->pending_job++;
> >         qemu_file_update_transfer(rs->f, p->packet_len);
> >+        ram_counters.multifd_bytes += p->packet_len;
> >+        ram_counters.transferred += p->packet_len;
> >         qemu_mutex_unlock(&p->mutex);
> >         qemu_sem_post(&p->sem);
> >     }
> >--
> >2.17.2 (Apple Git-113)
> >
>
> --
> Wei Yang
> Help you, Help me
>