All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
To: Juan Quintela <quintela@redhat.com>, qemu-devel@nongnu.org
Cc: Eric Blake <eblake@redhat.com>, John Snow <jsnow@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Fam Zheng <fam@euphon.net>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Thomas Huth <thuth@redhat.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	qemu-s390x@nongnu.org, Halil Pasic <pasic@linux.ibm.com>,
	Eric Farman <farman@linux.ibm.com>,
	qemu-block@nongnu.org, David Hildenbrand <david@redhat.com>,
	Ilya Leoshkevich <iii@linux.ibm.com>
Subject: Re: [PULL 5/5] migration: simplify migration_iteration_run()
Date: Tue, 31 Jan 2023 14:44:14 +0300	[thread overview]
Message-ID: <38da6faf-1d7f-66fc-b305-738a6e8dfaf1@yandex-team.ru> (raw)
In-Reply-To: <20230130080307.1792-6-quintela@redhat.com>

On 30.01.23 11:03, Juan Quintela wrote:
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
>   migration/migration.c | 24 ++++++++++++------------
>   1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/migration/migration.c b/migration/migration.c
> index 594a42f085..644c61e91d 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -3764,23 +3764,23 @@ static MigIterateState migration_iteration_run(MigrationState *s)
>                                       pend_pre, pend_compat, pend_post);
>       }
>   
> -    if (pending_size && pending_size >= s->threshold_size) {
> -        /* Still a significant amount to transfer */
> -        if (!in_postcopy && pend_pre <= s->threshold_size &&
> -            qatomic_read(&s->start_postcopy)) {
> -            if (postcopy_start(s)) {
> -                error_report("%s: postcopy failed to start", __func__);
> -            }
> -            return MIG_ITERATE_SKIP;
> -        }
> -        /* Just another iteration step */
> -        qemu_savevm_state_iterate(s->to_dst_file, in_postcopy);
> -    } else {
> +    if (pending_size < s->threshold_size) {

to keep the logic, formally it should be "if (!pending_size || pending_size < s->threshold_size)"...

Actually, could s->threshold_size be 0 here? Or, worth an assertion assert(s->threshold_size) ?

>           trace_migration_thread_low_pending(pending_size);
>           migration_completion(s);
>           return MIG_ITERATE_BREAK;
>       }
>   
> +    /* Still a significant amount to transfer */
> +    if (!in_postcopy && pend_pre <= s->threshold_size &&
> +        qatomic_read(&s->start_postcopy)) {
> +        if (postcopy_start(s)) {
> +            error_report("%s: postcopy failed to start", __func__);
> +        }
> +        return MIG_ITERATE_SKIP;
> +    }
> +
> +    /* Just another iteration step */
> +    qemu_savevm_state_iterate(s->to_dst_file, in_postcopy);
>       return MIG_ITERATE_RESUME;
>   }
>   

-- 
Best regards,
Vladimir



  reply	other threads:[~2023-01-31 11:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-30  8:03 [PULL 0/5] Next patches Juan Quintela
2023-01-30  8:03 ` [PULL 1/5] migration: Fix migration crash when target psize larger than host Juan Quintela
2023-01-30  8:03 ` [PULL 2/5] migration: No save_live_pending() method uses the QEMUFile parameter Juan Quintela
2023-01-30  8:03 ` [PULL 3/5] migration: Split save_live_pending() into state_pending_* Juan Quintela
2023-01-30  8:03 ` [PULL 4/5] migration: Remove unused threshold_size parameter Juan Quintela
2023-01-30  8:03 ` [PULL 5/5] migration: simplify migration_iteration_run() Juan Quintela
2023-01-31 11:44   ` Vladimir Sementsov-Ogievskiy [this message]
2023-02-02 10:24     ` Juan Quintela
2023-02-02 15:09     ` Juan Quintela
2023-02-02 15:11 ` [PULL 0/5] Next patches Juan Quintela

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=38da6faf-1d7f-66fc-b305-738a6e8dfaf1@yandex-team.ru \
    --to=vsementsov@yandex-team.ru \
    --cc=alex.williamson@redhat.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=fam@euphon.net \
    --cc=farman@linux.ibm.com \
    --cc=iii@linux.ibm.com \
    --cc=jsnow@redhat.com \
    --cc=pasic@linux.ibm.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 \
    /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.