diff mbox

[02/10] migration: Add counters of updating the dirty bitmap

Message ID 1394542415-5152-3-git-send-email-arei.gonglei@huawei.com
State New
Headers show

Commit Message

Gonglei (Arei) March 11, 2014, 12:53 p.m. UTC
From: ChenLiang <chenliang88@huawei.com>

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>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
 arch_init.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Comments

Eric Blake March 11, 2014, 1:09 p.m. UTC | #1
On 03/11/2014 06:53 AM, arei.gonglei@huawei.com wrote:
> From: ChenLiang <chenliang88@huawei.com>
> 
> 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>
> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>

Wait - how did my Reviewed-by get here?  There is no [PATCHv2] in the
subject line to indicate that I reviewed an earlier revision. and the
only other mail I see from me in the archives with the same subject line
is here:
https://lists.gnu.org/archive/html/qemu-devel/2014-02/msg05143.html

where I made a comment, but did NOT give my signature on the patch.

Please follow http://wiki.qemu.org/Contribute/SubmitAPatch when using
Reviewed-by: tags and subject lines.  Otherwise, you are making life
harder for yourself and for reviewers.

> ---
>  arch_init.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/arch_init.c b/arch_init.c
> index 2ac68c2..37e4aa5 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)

Isn't static inline a bit much in a .c file?  You generally want inline
functions to appear in .h.  For this particular file, I think these
functions are overkill...

>  
> +    increase_bitmap_sync_cnt();

and that you could just directly write 'bitmap_sync_cnt++' here.

When you send v3, do NOT add my Reviewed-by yet, because I still want to
make sure that the new version is correct.
Gonglei (Arei) March 11, 2014, 1:34 p.m. UTC | #2
> On 03/11/2014 06:53 AM, arei.gonglei@huawei.com wrote:

> > From: ChenLiang <chenliang88@huawei.com>

> >

> > 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>

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

> > Reviewed-by: Eric Blake <eblake@redhat.com>

> 

> Wait - how did my Reviewed-by get here?  There is no [PATCHv2] in the

> subject line to indicate that I reviewed an earlier revision. and the

> only other mail I see from me in the archives with the same subject line

> is here:

> https://lists.gnu.org/archive/html/qemu-devel/2014-02/msg05143.html

> 

> where I made a comment, but did NOT give my signature on the patch.

> 

> Please follow http://wiki.qemu.org/Contribute/SubmitAPatch when using

> Reviewed-by: tags and subject lines.  Otherwise, you are making life

> harder for yourself and for reviewers.

> 

I'm so sorry for those, and will post a new version.

> > ---

> >  arch_init.c | 20 ++++++++++++++++++++

> >  1 file changed, 20 insertions(+)

> >

> > diff --git a/arch_init.c b/arch_init.c

> > index 2ac68c2..37e4aa5 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)

> 

> Isn't static inline a bit much in a .c file?  You generally want inline

> functions to appear in .h.  For this particular file, I think these

> functions are overkill...

> 

> >

> > +    increase_bitmap_sync_cnt();

> 

> and that you could just directly write 'bitmap_sync_cnt++' here.

> 

> When you send v3, do NOT add my Reviewed-by yet, because I still want to

> make sure that the new version is correct.

> 

I see.

> --

> Eric Blake   eblake redhat com    +1-919-301-3266

> Libvirt virtualization library http://libvirt.org


Best regards,
-Gonglei
Juan Quintela March 11, 2014, 8:28 p.m. UTC | #3
"Gonglei (Arei)" <arei.gonglei@huawei.com> wrote:
>> On 03/11/2014 06:53 AM, arei.gonglei@huawei.com wrote:
>> > From: ChenLiang <chenliang88@huawei.com>
>> >
>> > 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>
>> > Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
>> > Reviewed-by: Eric Blake <eblake@redhat.com>
>> 
>> Wait - how did my Reviewed-by get here?  There is no [PATCHv2] in the
>> subject line to indicate that I reviewed an earlier revision. and the
>> only other mail I see from me in the archives with the same subject line
>> is here:
>> https://lists.gnu.org/archive/html/qemu-devel/2014-02/msg05143.html
>> 
>> where I made a comment, but did NOT give my signature on the patch.
>> 
>> Please follow http://wiki.qemu.org/Contribute/SubmitAPatch when using
>> Reviewed-by: tags and subject lines.  Otherwise, you are making life
>> harder for yourself and for reviewers.
>> 
> I'm so sorry for those, and will post a new version.

>> > +static uint64_t bitmap_sync_cnt;

If you change, you can do s/_cnt/_count/?  As suggested in the output
string?

Thanks, Juan.

Later, Juan.
diff mbox

Patch

diff --git a/arch_init.c b/arch_init.c
index 2ac68c2..37e4aa5 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 */
 
@@ -487,6 +504,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();
     }
@@ -734,6 +753,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()) {
         qemu_mutex_lock_iothread();