All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Juan Quintela <quintela@redhat.com>
Cc: qemu-devel@nongnu.org, amit.shah@redhat.com
Subject: Re: [Qemu-devel] [PATCH 02/31] ram: Add dirty_rate_high_cnt to RAMState
Date: Thu, 16 Mar 2017 12:20:27 +0000	[thread overview]
Message-ID: <20170316122026.GB2567@work-vm> (raw)
In-Reply-To: <20170315135021.6978-3-quintela@redhat.com>

* Juan Quintela (quintela@redhat.com) wrote:
> We need to add a parameter to several functions to make this work.
> 
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
>  migration/ram.c | 23 ++++++++++++-----------
>  1 file changed, 12 insertions(+), 11 deletions(-)
> 
> diff --git a/migration/ram.c b/migration/ram.c
> index c20a539..9120755 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -45,8 +45,6 @@
>  #include "qemu/rcu_queue.h"
>  #include "migration/colo.h"
>  
> -static int dirty_rate_high_cnt;
> -
>  static uint64_t bitmap_sync_count;
>  
>  /***********************************************************/
> @@ -148,6 +146,8 @@ struct RAMState {
>      uint32_t last_version;
>      /* We are in the first round */
>      bool ram_bulk_stage;
> +    /* How many times we have dirty too many pages */
> +    int dirty_rate_high_cnt;
>  };
>  typedef struct RAMState RAMState;
>  
> @@ -626,7 +626,7 @@ uint64_t ram_pagesize_summary(void)
>      return summary;
>  }
>  
> -static void migration_bitmap_sync(void)
> +static void migration_bitmap_sync(RAMState *rs)
>  {
>      RAMBlock *block;
>      uint64_t num_dirty_pages_init = migration_dirty_pages;
> @@ -673,9 +673,9 @@ static void migration_bitmap_sync(void)
>              if (s->dirty_pages_rate &&
>                 (num_dirty_pages_period * TARGET_PAGE_SIZE >
>                     (bytes_xfer_now - bytes_xfer_prev)/2) &&
> -               (dirty_rate_high_cnt++ >= 2)) {
> +               (rs->dirty_rate_high_cnt++ >= 2)) {
>                      trace_migration_throttle();
> -                    dirty_rate_high_cnt = 0;
> +                    rs->dirty_rate_high_cnt = 0;
>                      mig_throttle_guest_down();
>               }
>               bytes_xfer_prev = bytes_xfer_now;
> @@ -1859,7 +1859,7 @@ int ram_postcopy_send_discard_bitmap(MigrationState *ms)
>      rcu_read_lock();
>  
>      /* This should be our last sync, the src is now paused */
> -    migration_bitmap_sync();
> +    migration_bitmap_sync(&ram_state);
>  
>      unsentmap = atomic_rcu_read(&migration_bitmap_rcu)->unsentmap;
>      if (!unsentmap) {
> @@ -1935,7 +1935,7 @@ static int ram_save_init_globals(RAMState *rs)
>  {
>      int64_t ram_bitmap_pages; /* Size of bitmap in pages, including gaps */
>  
> -    dirty_rate_high_cnt = 0;
> +    rs->dirty_rate_high_cnt = 0;
>      bitmap_sync_count = 0;
>      migration_bitmap_sync_init();
>      qemu_mutex_init(&migration_bitmap_mutex);
> @@ -1999,7 +1999,7 @@ static int ram_save_init_globals(RAMState *rs)
>      migration_dirty_pages = ram_bytes_total() >> TARGET_PAGE_BITS;
>  
>      memory_global_dirty_log_start();
> -    migration_bitmap_sync();
> +    migration_bitmap_sync(rs);
>      qemu_mutex_unlock_ramlist();
>      qemu_mutex_unlock_iothread();
>      rcu_read_unlock();
> @@ -2117,11 +2117,11 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
>  static int ram_save_complete(QEMUFile *f, void *opaque)
>  {
>      RAMState *rs = opaque;
> -    
> +

Is that undoing false spaces from the previous patch?

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

>      rcu_read_lock();
>  
>      if (!migration_in_postcopy(migrate_get_current())) {
> -        migration_bitmap_sync();
> +        migration_bitmap_sync(rs);
>      }
>  
>      ram_control_before_iterate(f, RAM_CONTROL_FINISH);
> @@ -2154,6 +2154,7 @@ static void ram_save_pending(QEMUFile *f, void *opaque, uint64_t max_size,
>                               uint64_t *non_postcopiable_pending,
>                               uint64_t *postcopiable_pending)
>  {
> +    RAMState *rs = opaque;
>      uint64_t remaining_size;
>  
>      remaining_size = ram_save_remaining() * TARGET_PAGE_SIZE;
> @@ -2162,7 +2163,7 @@ static void ram_save_pending(QEMUFile *f, void *opaque, uint64_t max_size,
>          remaining_size < max_size) {
>          qemu_mutex_lock_iothread();
>          rcu_read_lock();
> -        migration_bitmap_sync();
> +        migration_bitmap_sync(rs);
>          rcu_read_unlock();
>          qemu_mutex_unlock_iothread();
>          remaining_size = ram_save_remaining() * TARGET_PAGE_SIZE;
> -- 
> 2.9.3
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

  reply	other threads:[~2017-03-16 12:20 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-15 13:49 [Qemu-devel] [PATCH 00/31] Creating RAMState for migration Juan Quintela
2017-03-15 13:49 ` [Qemu-devel] [PATCH 01/31] ram: move more fields into RAMState Juan Quintela
2017-03-16 12:09   ` Dr. David Alan Gilbert
2017-03-16 21:32     ` Philippe Mathieu-Daudé
2017-03-20 19:36     ` Juan Quintela
2017-03-15 13:49 ` [Qemu-devel] [PATCH 02/31] ram: Add dirty_rate_high_cnt to RAMState Juan Quintela
2017-03-16 12:20   ` Dr. David Alan Gilbert [this message]
2017-03-16 21:32     ` Philippe Mathieu-Daudé
2017-03-20 19:39     ` Juan Quintela
2017-03-15 13:49 ` [Qemu-devel] [PATCH 03/31] ram: move bitmap_sync_count into RAMState Juan Quintela
2017-03-16 12:21   ` Dr. David Alan Gilbert
2017-03-16 21:33     ` Philippe Mathieu-Daudé
2017-03-15 13:49 ` [Qemu-devel] [PATCH 04/31] ram: Move start time " Juan Quintela
2017-03-16 12:21   ` Dr. David Alan Gilbert
2017-03-16 21:33     ` Philippe Mathieu-Daudé
2017-03-15 13:49 ` [Qemu-devel] [PATCH 05/31] ram: Move bytes_xfer_prev " Juan Quintela
2017-03-16 12:22   ` Dr. David Alan Gilbert
2017-03-16 21:34     ` Philippe Mathieu-Daudé
2017-03-15 13:49 ` [Qemu-devel] [PATCH 06/31] ram: Move num_dirty_pages_period " Juan Quintela
2017-03-16 12:23   ` Dr. David Alan Gilbert
2017-03-16 21:35     ` Philippe Mathieu-Daudé
2017-03-15 13:49 ` [Qemu-devel] [PATCH 07/31] ram: Move xbzrle_cache_miss_prev " Juan Quintela
2017-03-16 12:24   ` Dr. David Alan Gilbert
2017-03-16 21:35     ` Philippe Mathieu-Daudé
2017-03-15 13:49 ` [Qemu-devel] [PATCH 08/31] ram: Move iterations_prev " Juan Quintela
2017-03-16 12:26   ` Dr. David Alan Gilbert
2017-03-16 21:36     ` Philippe Mathieu-Daudé
2017-03-15 13:49 ` [Qemu-devel] [PATCH 09/31] ram: Move dup_pages " Juan Quintela
2017-03-16 12:27   ` Dr. David Alan Gilbert
2017-03-15 13:50 ` [Qemu-devel] [PATCH 10/31] ram: Remove unused dump_mig_dbytes_transferred() Juan Quintela
2017-03-16 15:48   ` Dr. David Alan Gilbert
2017-03-15 13:50 ` [Qemu-devel] [PATCH 11/31] ram: Remove unused pages_skiped variable Juan Quintela
2017-03-16 15:52   ` Dr. David Alan Gilbert
2017-03-15 13:50 ` [Qemu-devel] [PATCH 12/31] ram: Move norm_pages to RAMState Juan Quintela
2017-03-16 16:09   ` Dr. David Alan Gilbert
2017-03-15 13:50 ` [Qemu-devel] [PATCH 13/31] ram: Remove norm_mig_bytes_transferred Juan Quintela
2017-03-16 16:14   ` Dr. David Alan Gilbert
2017-03-15 13:50 ` [Qemu-devel] [PATCH 14/31] ram: Move iterations into RAMState Juan Quintela
2017-03-16 20:04   ` Dr. David Alan Gilbert
2017-03-16 21:40     ` Philippe Mathieu-Daudé
2017-03-15 13:50 ` [Qemu-devel] [PATCH 15/31] ram: Move xbzrle_bytes " Juan Quintela
2017-03-15 13:50 ` [Qemu-devel] [PATCH 16/31] ram: Move xbzrle_pages " Juan Quintela
2017-03-15 13:50 ` [Qemu-devel] [PATCH 17/31] ram: Move xbzrle_cache_miss " Juan Quintela
2017-03-15 13:50 ` [Qemu-devel] [PATCH 18/31] ram: move xbzrle_cache_miss_rate " Juan Quintela
2017-03-15 13:50 ` [Qemu-devel] [PATCH 19/31] ram: move xbzrle_overflows " Juan Quintela
2017-03-16 20:07   ` Dr. David Alan Gilbert
2017-03-15 13:50 ` [Qemu-devel] [PATCH 20/31] ram: move migration_dirty_pages to RAMState Juan Quintela
2017-03-15 13:50 ` [Qemu-devel] [PATCH 21/31] ram: Everything was init to zero, so use memset Juan Quintela
2017-03-16 20:15   ` Dr. David Alan Gilbert
2017-03-15 13:50 ` [Qemu-devel] [PATCH 22/31] ram: move migration_bitmap_mutex into RAMState Juan Quintela
2017-03-16 20:21   ` Dr. David Alan Gilbert
2017-03-15 13:50 ` [Qemu-devel] [PATCH 23/31] ram: Move migration_bitmap_rcu " Juan Quintela
2017-03-17  9:51   ` Dr. David Alan Gilbert
2017-03-20 20:10     ` Juan Quintela
2017-03-15 13:50 ` [Qemu-devel] [PATCH 24/31] ram: Move bytes_transferred " Juan Quintela
2017-03-15 13:50 ` [Qemu-devel] [PATCH 25/31] ram: Use the RAMState bytes_transferred parameter Juan Quintela
2017-03-17  9:57   ` Dr. David Alan Gilbert
2017-03-15 13:50 ` [Qemu-devel] [PATCH 26/31] ram: Remove ram_save_remaining Juan Quintela
2017-03-15 13:50 ` [Qemu-devel] [PATCH 27/31] ram: Move last_req_rb to RAMState Juan Quintela
2017-03-17 10:14   ` Dr. David Alan Gilbert
2017-03-20 20:13     ` Juan Quintela
2017-03-15 13:50 ` [Qemu-devel] [PATCH 28/31] ram: Create ram_dirty_sync_count() Juan Quintela
2017-03-15 13:50 ` [Qemu-devel] [PATCH 29/31] ram: Remove dirty_bytes_rate Juan Quintela
2017-03-17 10:21   ` Dr. David Alan Gilbert
2017-03-15 13:50 ` [Qemu-devel] [PATCH 30/31] ram: move dirty_pages_rate to RAMState Juan Quintela
2017-03-17 10:45   ` Dr. David Alan Gilbert
2017-03-15 13:50 ` [Qemu-devel] [PATCH 31/31] ram: move postcopy_requests into RAMState Juan Quintela
2017-03-15 14:25 ` [Qemu-devel] [PATCH 00/31] Creating RAMState for migration no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170316122026.GB2567@work-vm \
    --to=dgilbert@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.