From: Juan Quintela <quintela@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: qemu-devel@nongnu.org, 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: Thu, 02 Feb 2023 11:24:36 +0100 [thread overview]
Message-ID: <87mt5wtlej.fsf@secure.mitica> (raw)
In-Reply-To: <38da6faf-1d7f-66fc-b305-738a6e8dfaf1@yandex-team.ru> (Vladimir Sementsov-Ogievskiy's message of "Tue, 31 Jan 2023 14:44:14 +0300")
Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> wrote:
> 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) ?
It is weird, but it could:
bandwidth = (double)transferred / time_spent;
s->threshold_size = bandwidth * s->parameters.downtime_limit;
That is the (real) only place when we set it, and if the network was
completely down, bandwidth could be zero.
But I think that it is better to explain in the other way. What does
the current code do:
if (too much dirty memory to converge)
do another iteration
else
do final iteration
What the new code do is
if (low enough memory to converge)
do final iteration.
do another iteration.
So, how we decide if we converge?
if pending_size < s->threshold_size
we "could" change it to pending_size <= s->threshold_size for the zero case
But I think that we would be shooting ourselves in the foot, because we
are having network trouble (only reason that s->theshold_size could be
zero) and we still have all the devices state to migrate.
And once that we enter that state, there is no way back, guest is
stopped in source and we are not able to send anything else.
So I think it is better this way.
What do you think?
Later, Juan.
next prev parent reply other threads:[~2023-02-02 10:25 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
2023-02-02 10:24 ` Juan Quintela [this message]
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=87mt5wtlej.fsf@secure.mitica \
--to=quintela@redhat.com \
--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=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.