diff mbox

[03/12] migration: fix counting xbzrle cache_miss_rate

Message ID 20180604095520.8563-4-xiaoguangrong@tencent.com (mailing list archive)
State New, archived
Headers show

Commit Message

Xiao Guangrong June 4, 2018, 9:55 a.m. UTC
From: Xiao Guangrong <xiaoguangrong@tencent.com>

Sync up xbzrle_cache_miss_prev only after migration iteration goes
forward

Signed-off-by: Xiao Guangrong <xiaoguangrong@tencent.com>
---
 migration/ram.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dr. David Alan Gilbert June 13, 2018, 4:09 p.m. UTC | #1
* guangrong.xiao@gmail.com (guangrong.xiao@gmail.com) wrote:
> From: Xiao Guangrong <xiaoguangrong@tencent.com>
> 
> Sync up xbzrle_cache_miss_prev only after migration iteration goes
> forward
> 
> Signed-off-by: Xiao Guangrong <xiaoguangrong@tencent.com>

Yeh, I think you're right.


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

> ---
>  migration/ram.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/migration/ram.c b/migration/ram.c
> index dbf24d8c87..dd1283dd45 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -1189,9 +1189,9 @@ static void migration_bitmap_sync(RAMState *rs)
>                     (double)(xbzrle_counters.cache_miss -
>                              rs->xbzrle_cache_miss_prev) /
>                     (rs->iterations - rs->iterations_prev);
> +                rs->xbzrle_cache_miss_prev = xbzrle_counters.cache_miss;
>              }
>              rs->iterations_prev = rs->iterations;
> -            rs->xbzrle_cache_miss_prev = xbzrle_counters.cache_miss;
>          }
>  
>          /* reset period counters */
> -- 
> 2.14.4
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
Dr. David Alan Gilbert June 15, 2018, 11:30 a.m. UTC | #2
* guangrong.xiao@gmail.com (guangrong.xiao@gmail.com) wrote:
> From: Xiao Guangrong <xiaoguangrong@tencent.com>
> 
> Sync up xbzrle_cache_miss_prev only after migration iteration goes
> forward
> 
> Signed-off-by: Xiao Guangrong <xiaoguangrong@tencent.com>

This patch (not the whole set) queued

> ---
>  migration/ram.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/migration/ram.c b/migration/ram.c
> index dbf24d8c87..dd1283dd45 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -1189,9 +1189,9 @@ static void migration_bitmap_sync(RAMState *rs)
>                     (double)(xbzrle_counters.cache_miss -
>                              rs->xbzrle_cache_miss_prev) /
>                     (rs->iterations - rs->iterations_prev);
> +                rs->xbzrle_cache_miss_prev = xbzrle_counters.cache_miss;
>              }
>              rs->iterations_prev = rs->iterations;
> -            rs->xbzrle_cache_miss_prev = xbzrle_counters.cache_miss;
>          }
>  
>          /* reset period counters */
> -- 
> 2.14.4
> 
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
diff mbox

Patch

diff --git a/migration/ram.c b/migration/ram.c
index dbf24d8c87..dd1283dd45 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1189,9 +1189,9 @@  static void migration_bitmap_sync(RAMState *rs)
                    (double)(xbzrle_counters.cache_miss -
                             rs->xbzrle_cache_miss_prev) /
                    (rs->iterations - rs->iterations_prev);
+                rs->xbzrle_cache_miss_prev = xbzrle_counters.cache_miss;
             }
             rs->iterations_prev = rs->iterations;
-            rs->xbzrle_cache_miss_prev = xbzrle_counters.cache_miss;
         }
 
         /* reset period counters */