qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 29/31] ram: Remove dirty_bytes_rate


From: Dr. David Alan Gilbert
Subject: Re: [Qemu-devel] [PATCH 29/31] ram: Remove dirty_bytes_rate
Date: Fri, 17 Mar 2017 10:21:02 +0000
User-agent: Mutt/1.8.0 (2017-02-23)

* Juan Quintela (address@hidden) wrote:
> It can be recalculated from dirty_pages_rate.
> 
> Signed-off-by: Juan Quintela <address@hidden>
> ---
>  include/migration/migration.h | 1 -
>  migration/migration.c         | 5 ++---
>  migration/ram.c               | 1 -
>  3 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/include/migration/migration.h b/include/migration/migration.h
> index 54a1a4f..42b9edf 100644
> --- a/include/migration/migration.h
> +++ b/include/migration/migration.h
> @@ -167,7 +167,6 @@ struct MigrationState
>      int64_t downtime;
>      int64_t expected_downtime;
>      int64_t dirty_pages_rate;
> -    int64_t dirty_bytes_rate;
>      bool enabled_capabilities[MIGRATION_CAPABILITY__MAX];
>      int64_t xbzrle_cache_size;
>      int64_t setup_time;
> diff --git a/migration/migration.c b/migration/migration.c
> index 09d02be..2f8c440 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -1107,7 +1107,6 @@ MigrationState *migrate_init(const MigrationParams 
> *params)
>      s->downtime = 0;
>      s->expected_downtime = 0;
>      s->dirty_pages_rate = 0;
> -    s->dirty_bytes_rate = 0;
>      s->setup_time = 0;
>      s->start_postcopy = false;
>      s->postcopy_after_devices = false;
> @@ -1999,8 +1998,8 @@ static void *migration_thread(void *opaque)
>                                        bandwidth, max_size);
>              /* if we haven't sent anything, we don't want to recalculate
>                 10000 is a small enough number for our purposes */
> -            if (s->dirty_bytes_rate && transferred_bytes > 10000) {
> -                s->expected_downtime = s->dirty_bytes_rate / bandwidth;
> +            if (s->dirty_pages_rate && transferred_bytes > 10000) {
> +                s->expected_downtime = s->dirty_pages_rate * (1ul << 
> qemu_target_page_bits())/ bandwidth;

The line got a bit long, please wrap.

Other than that,

Reviewed-by: Dr. David Alan Gilbert <address@hidden>

>              }
>  
>              qemu_file_reset_rate_limit(s->to_dst_file);
> diff --git a/migration/ram.c b/migration/ram.c
> index 4563e3d..1006e60 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -687,7 +687,6 @@ static void migration_bitmap_sync(RAMState *rs)
>          }
>          s->dirty_pages_rate = rs->num_dirty_pages_period * 1000
>              / (end_time - rs->start_time);
> -        s->dirty_bytes_rate = s->dirty_pages_rate * TARGET_PAGE_SIZE;
>          rs->start_time = end_time;
>          rs->num_dirty_pages_period = 0;
>      }
> -- 
> 2.9.3
> 
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK



reply via email to

[Prev in Thread] Current Thread [Next in Thread]