All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 2/7] migration: Add counters of updating the dirty bitmap
@ 2014-02-28  4:08 Gonglei (Arei)
  2014-02-28  9:37 ` Dr. David Alan Gilbert
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Gonglei (Arei) @ 2014-02-28  4:08 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Juan Quintela, pl, owasserm, aliguori,
	chenliang (T),
	pbonzini

Add counters to log the times of updating the dirty bitmap.

Signed-off-by: ChenLiang <chenliang88@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
 arch_init.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/arch_init.c b/arch_init.c
index bc8d0eb..6823c5a 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -110,6 +110,23 @@ static bool mig_throttle_on;
 static int dirty_rate_high_cnt;
 static void check_guest_throttling(void);
 
+static uint64_t bitmap_sync_cnt;
+/* the functions *_bitmap_sync_cnt only run in migrate thread */
+static inline void reset_bitmap_sync_cnt(void)
+{
+    bitmap_sync_cnt = 0;
+}
+
+static inline void increase_bitmap_sync_cnt(void)
+{
+    bitmap_sync_cnt++;
+}
+
+static inline uint64_t get_bitmap_sync_cnt(void)
+{
+    return bitmap_sync_cnt;
+}
+
 /***********************************************************/
 /* ram save/restore */
 
@@ -450,6 +467,8 @@ static void migration_bitmap_sync(void)
     int64_t end_time;
     int64_t bytes_xfer_now;
 
+    increase_bitmap_sync_cnt();
+
     if (!bytes_xfer_prev) {
         bytes_xfer_prev = ram_bytes_transferred();
     }
@@ -692,6 +711,7 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
     migration_dirty_pages = ram_pages;
     mig_throttle_on = false;
     dirty_rate_high_cnt = 0;
+    reset_bitmap_sync_cnt();
 
     if (migrate_use_xbzrle()) {
         XBZRLE.cache = cache_init(migrate_xbzrle_cache_size() /
-- 
1.7.12.4


Best regards,
-Gonglei

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 2/7] migration: Add counters of updating the dirty bitmap
  2014-02-28  4:08 [Qemu-devel] [PATCH 2/7] migration: Add counters of updating the dirty bitmap Gonglei (Arei)
@ 2014-02-28  9:37 ` Dr. David Alan Gilbert
  2014-02-28 13:11 ` Eric Blake
  2014-03-05 16:18 ` Juan Quintela
  2 siblings, 0 replies; 7+ messages in thread
From: Dr. David Alan Gilbert @ 2014-02-28  9:37 UTC (permalink / raw)
  To: Gonglei (Arei)
  Cc: chenliang (T),
	Peter Maydell, Juan Quintela, pl, qemu-devel, aliguori, pbonzini

* Gonglei (Arei) (arei.gonglei@huawei.com) wrote:
> Add counters to log the times of updating the dirty bitmap.

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> Signed-off-by: ChenLiang <chenliang88@huawei.com>
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> ---
>  arch_init.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/arch_init.c b/arch_init.c
> index bc8d0eb..6823c5a 100644
> --- a/arch_init.c
> +++ b/arch_init.c
> @@ -110,6 +110,23 @@ static bool mig_throttle_on;
>  static int dirty_rate_high_cnt;
>  static void check_guest_throttling(void);
>  
> +static uint64_t bitmap_sync_cnt;
> +/* the functions *_bitmap_sync_cnt only run in migrate thread */
> +static inline void reset_bitmap_sync_cnt(void)
> +{
> +    bitmap_sync_cnt = 0;
> +}
> +
> +static inline void increase_bitmap_sync_cnt(void)
> +{
> +    bitmap_sync_cnt++;
> +}
> +
> +static inline uint64_t get_bitmap_sync_cnt(void)
> +{
> +    return bitmap_sync_cnt;
> +}
> +
>  /***********************************************************/
>  /* ram save/restore */
>  
> @@ -450,6 +467,8 @@ static void migration_bitmap_sync(void)
>      int64_t end_time;
>      int64_t bytes_xfer_now;
>  
> +    increase_bitmap_sync_cnt();
> +
>      if (!bytes_xfer_prev) {
>          bytes_xfer_prev = ram_bytes_transferred();
>      }
> @@ -692,6 +711,7 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
>      migration_dirty_pages = ram_pages;
>      mig_throttle_on = false;
>      dirty_rate_high_cnt = 0;
> +    reset_bitmap_sync_cnt();
>  
>      if (migrate_use_xbzrle()) {
>          XBZRLE.cache = cache_init(migrate_xbzrle_cache_size() /
> -- 
> 1.7.12.4
> 
> 
> Best regards,
> -Gonglei
> 
> 
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 2/7] migration: Add counters of updating the dirty bitmap
  2014-02-28  4:08 [Qemu-devel] [PATCH 2/7] migration: Add counters of updating the dirty bitmap Gonglei (Arei)
  2014-02-28  9:37 ` Dr. David Alan Gilbert
@ 2014-02-28 13:11 ` Eric Blake
  2014-02-28 13:26   ` 陈梁
  2014-03-05 16:18 ` Juan Quintela
  2 siblings, 1 reply; 7+ messages in thread
From: Eric Blake @ 2014-02-28 13:11 UTC (permalink / raw)
  To: Gonglei (Arei), qemu-devel
  Cc: Peter Maydell, Juan Quintela, pl, owasserm, aliguori,
	chenliang (T),
	pbonzini

[-- Attachment #1: Type: text/plain, Size: 607 bytes --]

On 02/27/2014 09:08 PM, Gonglei (Arei) wrote:
> Add counters to log the times of updating the dirty bitmap.
> 
> Signed-off-by: ChenLiang <chenliang88@huawei.com>
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> ---
>  arch_init.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)

Is it also worth updating MigrationStats in qapi-schema.json to expose
these counts to the end user, to help benchmarking decide how often your
optimizations hit for a given workload?


-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 2/7] migration: Add counters of updating the dirty bitmap
  2014-02-28 13:11 ` Eric Blake
@ 2014-02-28 13:26   ` 陈梁
  0 siblings, 0 replies; 7+ messages in thread
From: 陈梁 @ 2014-02-28 13:26 UTC (permalink / raw)
  To: Eric Blake
  Cc: Peter Maydell, Gonglei (Arei),
	Juan Quintela, pl, qemu-devel, owasserm, 陈梁,
	aliguori, chenliang (T),
	pbonzini


> On 02/27/2014 09:08 PM, Gonglei (Arei) wrote:
>> Add counters to log the times of updating the dirty bitmap.
>> 
>> Signed-off-by: ChenLiang <chenliang88@huawei.com>
>> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
>> ---
>> arch_init.c | 20 ++++++++++++++++++++
>> 1 file changed, 20 insertions(+)
> 
> Is it also worth updating MigrationStats in qapi-schema.json to expose
> these counts to the end user, to help benchmarking decide how often your
> optimizations hit for a given workload?
> 
> 
> -- 
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
> 
good idea,  I will think about it.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 2/7] migration: Add counters of updating the dirty bitmap
  2014-02-28  4:08 [Qemu-devel] [PATCH 2/7] migration: Add counters of updating the dirty bitmap Gonglei (Arei)
  2014-02-28  9:37 ` Dr. David Alan Gilbert
  2014-02-28 13:11 ` Eric Blake
@ 2014-03-05 16:18 ` Juan Quintela
  2014-03-06 10:50   ` Gonglei
  2 siblings, 1 reply; 7+ messages in thread
From: Juan Quintela @ 2014-03-05 16:18 UTC (permalink / raw)
  To: Gonglei (Arei)
  Cc: Peter Maydell, chenliang (T),
	pl, qemu-devel, owasserm, aliguori, pbonzini

"Gonglei (Arei)" <arei.gonglei@huawei.com> wrote:
> Add counters to log the times of updating the dirty bitmap.
>
> Signed-off-by: ChenLiang <chenliang88@huawei.com>
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>

As told by Eric, I am with this change, but can we move the code to the
same place that the rest of the statistics?

Thanks, Juan.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 2/7] migration: Add counters of updating the dirty bitmap
  2014-03-05 16:18 ` Juan Quintela
@ 2014-03-06 10:50   ` Gonglei
  2014-03-06 13:19     ` Juan Quintela
  0 siblings, 1 reply; 7+ messages in thread
From: Gonglei @ 2014-03-06 10:50 UTC (permalink / raw)
  To: quintela
  Cc: Peter Maydell, chenliang (T),
	pl, qemu-devel, owasserm, aliguori, pbonzini

On 2014/3/6 0:18, Juan Quintela wrote:

> "Gonglei (Arei)" <arei.gonglei@huawei.com> wrote:
>> Add counters to log the times of updating the dirty bitmap.
>>
>> Signed-off-by: ChenLiang <chenliang88@huawei.com>
>> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> 
> As told by Eric, I am with this change, but can we move the code to the
> same place that the rest of the statistics?
> 
> Thanks, Juan.

OK, I'm pleasure to do it. What's your plan?

Best regards,
-Gonglei

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 2/7] migration: Add counters of updating the dirty bitmap
  2014-03-06 10:50   ` Gonglei
@ 2014-03-06 13:19     ` Juan Quintela
  0 siblings, 0 replies; 7+ messages in thread
From: Juan Quintela @ 2014-03-06 13:19 UTC (permalink / raw)
  To: Gonglei
  Cc: Peter Maydell, chenliang (T),
	pl, qemu-devel, owasserm, aliguori, pbonzini

Gonglei <arei.gonglei@huawei.com> wrote:
> On 2014/3/6 0:18, Juan Quintela wrote:
>
>> "Gonglei (Arei)" <arei.gonglei@huawei.com> wrote:
>>> Add counters to log the times of updating the dirty bitmap.
>>>
>>> Signed-off-by: ChenLiang <chenliang88@huawei.com>
>>> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
>> 
>> As told by Eric, I am with this change, but can we move the code to the
>> same place that the rest of the statistics?
>> 
>> Thanks, Juan.
>
> OK, I'm pleasure to do it. What's your plan?

Instead of a local variable, look at includemigration/state/migration.h

inside MigrationState there are variables like setup_time.

You can add your variable there.  Interesting bits is that you need to
add it also to:

qapi-schema.json: MigrationInfo (looks for @setup-time),
qmp-commands.hx: look for setup-time
hmp.c: look again for setup_time
migration.c: look for setup_time inside qemu_qeery_migrate()

That are the places to add something to migration stats and that appears
everywhere.

Thanks, Juan.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-03-06 13:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-28  4:08 [Qemu-devel] [PATCH 2/7] migration: Add counters of updating the dirty bitmap Gonglei (Arei)
2014-02-28  9:37 ` Dr. David Alan Gilbert
2014-02-28 13:11 ` Eric Blake
2014-02-28 13:26   ` 陈梁
2014-03-05 16:18 ` Juan Quintela
2014-03-06 10:50   ` Gonglei
2014-03-06 13:19     ` Juan Quintela

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.