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,
	Alex Williamson <alex.williamson@redhat.com>,
	Eric Blake <eblake@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>, Fam Zheng <fam@euphon.net>,
	qemu-s390x@nongnu.org, Cornelia Huck <cohuck@redhat.com>,
	Thomas Huth <thuth@redhat.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
	Laurent Vivier <lvivier@redhat.com>, John Snow <jsnow@redhat.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Halil Pasic <pasic@linux.ibm.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	qemu-block@nongnu.org, Eric Farman <farman@linux.ibm.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	David Hildenbrand <david@redhat.com>
Subject: Re: [RFC 5/7] migration: Remove unused threshold_size parameter
Date: Wed, 23 Nov 2022 16:38:28 +0000	[thread overview]
Message-ID: <Y35MhBvqGxXyYoaE@work-vm> (raw)
In-Reply-To: <20221003031600.20084-6-quintela@redhat.com>

* Juan Quintela (quintela@redhat.com) wrote:
> Until previous commit, save_live_pending() was used for ram.  Now with
> the split into state_pending_estimate() and state_pending_exact() it
> is not needed anymore, so remove them.
> 
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
>  include/migration/register.h   |  7 +++----
>  migration/savevm.h             |  6 ++----
>  hw/vfio/migration.c            |  6 +++---
>  migration/block-dirty-bitmap.c |  3 +--
>  migration/block.c              |  3 +--
>  migration/migration.c          |  4 ++--
>  migration/ram.c                |  6 ++----
>  migration/savevm.c             | 12 ++++--------
>  8 files changed, 18 insertions(+), 29 deletions(-)
> 
> diff --git a/include/migration/register.h b/include/migration/register.h
> index 313b8e1c3b..5f08204fb2 100644
> --- a/include/migration/register.h
> +++ b/include/migration/register.h
> @@ -58,11 +58,10 @@ typedef struct SaveVMHandlers {
>       * pending data.
>       */
>      /* This calculate the exact remaining data to transfer */
> -    void (*state_pending_exact)(void *opaque,  uint64_t threshold_size,
> -                                uint64_t *rest_precopy, uint64_t *rest_postcopy);
> +    void (*state_pending_exact)(void *opaque, uint64_t *rest_precopy,
> +                                uint64_t *rest_postcopy);
>      /* This estimates the remaining data to transfer */
> -    void (*state_pending_estimate)(void *opaque,  uint64_t threshold_size,
> -                                   uint64_t *rest_precopy,
> +    void (*state_pending_estimate)(void *opaque, uint64_t *rest_precopy,
>                                     uint64_t *rest_postcopy);
>  
>      LoadStateHandler *load_state;
> diff --git a/migration/savevm.h b/migration/savevm.h
> index 613f85e717..24f2d2a28b 100644
> --- a/migration/savevm.h
> +++ b/migration/savevm.h
> @@ -40,11 +40,9 @@ void qemu_savevm_state_cleanup(void);
>  void qemu_savevm_state_complete_postcopy(QEMUFile *f);
>  int qemu_savevm_state_complete_precopy(QEMUFile *f, bool iterable_only,
>                                         bool inactivate_disks);
> -void qemu_savevm_state_pending_exact(uint64_t max_size,
> -                                     uint64_t *res_precopy,
> +void qemu_savevm_state_pending_exact(uint64_t *res_precopy,
>                                       uint64_t *res_postcopy);
> -void qemu_savevm_state_pending_estimate(uint64_t max_size,
> -                                        uint64_t *res_precopy,
> +void qemu_savevm_state_pending_estimate(uint64_t *res_precopy,
>                                          uint64_t *res_postcopy);
>  void qemu_savevm_send_ping(QEMUFile *f, uint32_t value);
>  void qemu_savevm_send_open_return_path(QEMUFile *f);
> diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
> index 680cf4df6e..d9598ce070 100644
> --- a/hw/vfio/migration.c
> +++ b/hw/vfio/migration.c
> @@ -456,8 +456,8 @@ static void vfio_save_cleanup(void *opaque)
>      trace_vfio_save_cleanup(vbasedev->name);
>  }
>  
> -static void vfio_state_pending(void *opaque,  uint64_t threshold_size,
> -                               uint64_t *res_precopy, uint64_t *res_postcopy)
> +static void vfio_state_pending(void *opaque, uint64_t *res_precopy,
> +                               uint64_t *res_postcopy)
>  {
>      VFIODevice *vbasedev = opaque;
>      VFIOMigration *migration = vbasedev->migration;
> @@ -511,7 +511,7 @@ static int vfio_save_iterate(QEMUFile *f, void *opaque)
>      }
>  
>      /*
> -     * Reset pending_bytes as .save_live_pending is not called during savevm or
> +     * Reset pending_bytes as .state_pending_* is not called during savevm or

That comment change feels like it lives in a different patch, other than
that:


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

>       * snapshot case, in such case vfio_update_pending() at the start of this
>       * function updates pending_bytes.
>       */
> diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
> index 5b24007650..8a11577252 100644
> --- a/migration/block-dirty-bitmap.c
> +++ b/migration/block-dirty-bitmap.c
> @@ -761,8 +761,7 @@ static int dirty_bitmap_save_complete(QEMUFile *f, void *opaque)
>      return 0;
>  }
>  
> -static void dirty_bitmap_state_pending(void *opaque, uint64_t max_size,
> -                                       uint64_t *res_precopy,
> +static void dirty_bitmap_state_pending(void *opaque, uint64_t *res_precopy,
>                                         uint64_t *res_postcopy)
>  {
>      DBMSaveState *s = &((DBMState *)opaque)->save;
> diff --git a/migration/block.c b/migration/block.c
> index 8e6ad1c468..4f1f7c0f8d 100644
> --- a/migration/block.c
> +++ b/migration/block.c
> @@ -862,8 +862,7 @@ static int block_save_complete(QEMUFile *f, void *opaque)
>      return 0;
>  }
>  
> -static void block_state_pending(void *opaque, uint64_t max_size,
> -                                uint64_t *res_precopy,
> +static void block_state_pending(void *opaque, uint64_t *res_precopy,
>                                  uint64_t *res_postcopy)
>  {
>      /* Estimate pending number of bytes to send */
> diff --git a/migration/migration.c b/migration/migration.c
> index 4676568699..97fefd579e 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -3737,12 +3737,12 @@ static MigIterateState migration_iteration_run(MigrationState *s)
>      uint64_t pend_pre, pend_post;
>      bool in_postcopy = s->state == MIGRATION_STATUS_POSTCOPY_ACTIVE;
>  
> -    qemu_savevm_state_pending_estimate(s->threshold_size, &pend_pre, &pend_post);
> +    qemu_savevm_state_pending_estimate(&pend_pre, &pend_post);
>      uint64_t pending_size = pend_pre + pend_post;
>      trace_migrate_pending_estimate(pending_size, s->threshold_size, pend_pre, pend_post);
>  
>      if (pend_pre <= s->threshold_size) {
> -        qemu_savevm_state_pending_exact(s->threshold_size, &pend_pre, &pend_post);
> +        qemu_savevm_state_pending_exact(&pend_pre, &pend_post);
>          pending_size = pend_pre + pend_post;
>          trace_migrate_pending_exact(pending_size, s->threshold_size, pend_pre, pend_post);
>      }
> diff --git a/migration/ram.c b/migration/ram.c
> index 8d989d51db..53a5dd64a8 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -3434,8 +3434,7 @@ static int ram_save_complete(QEMUFile *f, void *opaque)
>      return 0;
>  }
>  
> -static void ram_state_pending_estimate(void *opaque, uint64_t max_size,
> -                                       uint64_t *res_precopy,
> +static void ram_state_pending_estimate(void *opaque, uint64_t *res_precopy,
>                                         uint64_t *res_postcopy)
>  {
>      RAMState **temp = opaque;
> @@ -3451,8 +3450,7 @@ static void ram_state_pending_estimate(void *opaque, uint64_t max_size,
>      }
>  }
>  
> -static void ram_state_pending_exact(void *opaque, uint64_t max_size,
> -                                    uint64_t *res_precopy,
> +static void ram_state_pending_exact(void *opaque, uint64_t *res_precopy,
>                                      uint64_t *res_postcopy)
>  {
>      RAMState **temp = opaque;
> diff --git a/migration/savevm.c b/migration/savevm.c
> index 976ece3f3f..1e0328e088 100644
> --- a/migration/savevm.c
> +++ b/migration/savevm.c
> @@ -1471,8 +1471,7 @@ flush:
>   * the result is split into the amount for units that can and
>   * for units that can't do postcopy.
>   */
> -void qemu_savevm_state_pending_exact(uint64_t threshold_size,
> -                                     uint64_t *res_precopy,
> +void qemu_savevm_state_pending_exact(uint64_t *res_precopy,
>                                       uint64_t *res_postcopy)
>  {
>      SaveStateEntry *se;
> @@ -1489,13 +1488,11 @@ void qemu_savevm_state_pending_exact(uint64_t threshold_size,
>                  continue;
>              }
>          }
> -        se->ops->state_pending_exact(se->opaque, threshold_size,
> -                                     res_precopy, res_postcopy);
> +        se->ops->state_pending_exact(se->opaque, res_precopy, res_postcopy);
>      }
>  }
>  
> -void qemu_savevm_state_pending_estimate(uint64_t threshold_size,
> -                                        uint64_t *res_precopy,
> +void qemu_savevm_state_pending_estimate(uint64_t *res_precopy,
>                                          uint64_t *res_postcopy)
>  {
>      SaveStateEntry *se;
> @@ -1512,8 +1509,7 @@ void qemu_savevm_state_pending_estimate(uint64_t threshold_size,
>                  continue;
>              }
>          }
> -        se->ops->state_pending_estimate(se->opaque, threshold_size,
> -                                        res_precopy, res_postcopy);
> +        se->ops->state_pending_estimate(se->opaque, res_precopy, res_postcopy);
>      }
>  }
>  
> -- 
> 2.37.2
> 
> 
-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK



  reply	other threads:[~2022-11-23 16:39 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-03  3:15 [RFC 0/7] migration patches for VFIO Juan Quintela
2022-10-03  3:15 ` [RFC 1/7] migration: Remove res_compatible parameter Juan Quintela
2022-11-22 13:54   ` Dr. David Alan Gilbert
2022-10-03  3:15 ` [RFC 2/7] migration: No save_live_pending() method uses the QEMUFile parameter Juan Quintela
2022-11-22 17:48   ` Dr. David Alan Gilbert
2022-10-03  3:15 ` [RFC 3/7] migration: Block migration comment or code is wrong Juan Quintela
2022-10-03 19:12   ` Stefan Hajnoczi
2022-10-03  3:15 ` [RFC 4/7] migration: Split save_live_pending() into state_pending_* Juan Quintela
2022-11-22 20:08   ` Dr. David Alan Gilbert
2022-10-03  3:15 ` [RFC 5/7] migration: Remove unused threshold_size parameter Juan Quintela
2022-11-23 16:38   ` Dr. David Alan Gilbert [this message]
2022-10-03  3:15 ` [RFC 6/7] migration: simplify migration_iteration_run() Juan Quintela
2022-11-23 17:39   ` Dr. David Alan Gilbert
2022-10-03  3:16 ` [RFC 7/7] migration: call qemu_savevm_state_pending_exact() with the guest stopped Juan Quintela
2022-10-13 12:25   ` Joao Martins
2022-10-13 16:08     ` Juan Quintela
2022-10-14 10:36       ` Joao Martins
2022-10-14 11:28         ` Juan Quintela
2022-10-14 12:29           ` Joao Martins
2022-10-18 12:22             ` Jason Gunthorpe via
2022-10-19 15:51               ` Yishai Hadas
2022-10-14 19:49     ` Jason Gunthorpe
2022-10-20 14:56 ` [RFC 0/7] migration patches for VFIO Yishai Hadas

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=Y35MhBvqGxXyYoaE@work-vm \
    --to=dgilbert@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=eblake@redhat.com \
    --cc=fam@euphon.net \
    --cc=farman@linux.ibm.com \
    --cc=jsnow@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=pasic@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=richard.henderson@linaro.org \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    --cc=vsementsov@yandex-team.ru \
    /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.