From: Peter Xu <peterx@redhat.com>
To: huangy81@chinatelecom.cn
Cc: qemu-devel <qemu-devel@nongnu.org>,
Markus Armbruster <armbru@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Laurent Vivier <laurent@vivier.eu>,
Eric Blake <eblake@redhat.com>,
Juan Quintela <quintela@redhat.com>,
Thomas Huth <thuth@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
Richard Henderson <richard.henderson@linaro.org>
Subject: Re: [PATCH v2 07/11] migration: Implement dirty-limit convergence algo
Date: Tue, 29 Nov 2022 18:17:09 -0500 [thread overview]
Message-ID: <Y4aS9UjwNabKMAHN@x1n> (raw)
In-Reply-To: <5727cd0876e1a8d3db451feb46afb3281875cca3.1669047366.git.huangy81@chinatelecom.cn>
On Mon, Nov 21, 2022 at 11:26:39AM -0500, huangy81@chinatelecom.cn wrote:
> diff --git a/migration/migration.c b/migration/migration.c
> index 86950a1..096b61a 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -240,6 +240,7 @@ void migration_cancel(const Error *error)
> if (error) {
> migrate_set_error(current_migration, error);
> }
> + qmp_cancel_vcpu_dirty_limit(false, -1, NULL);
Disable it only if migrate_dirty_limit() is true? It seems okay if the
admin wants to use dirtylimit separately from migration.
> migrate_fd_cancel(current_migration);
> }
[...]
> @@ -1148,22 +1175,31 @@ static void migration_trigger_throttle(RAMState *rs)
> uint64_t bytes_dirty_period = rs->num_dirty_pages_period * TARGET_PAGE_SIZE;
> uint64_t bytes_dirty_threshold = bytes_xfer_period * threshold / 100;
>
> - /* During block migration the auto-converge logic incorrectly detects
> - * that ram migration makes no progress. Avoid this by disabling the
> - * throttling logic during the bulk phase of block migration. */
> - if (migrate_auto_converge() && !blk_mig_bulk_active()) {
> - /* The following detection logic can be refined later. For now:
> - Check to see if the ratio between dirtied bytes and the approx.
> - amount of bytes that just got transferred since the last time
> - we were in this routine reaches the threshold. If that happens
> - twice, start or increase throttling. */
> -
> - if ((bytes_dirty_period > bytes_dirty_threshold) &&
> - (++rs->dirty_rate_high_cnt >= 2)) {
> + /*
> + * The following detection logic can be refined later. For now:
> + * Check to see if the ratio between dirtied bytes and the approx.
> + * amount of bytes that just got transferred since the last time
> + * we were in this routine reaches the threshold. If that happens
> + * twice, start or increase throttling.
> + */
> +
> + if ((bytes_dirty_period > bytes_dirty_threshold) &&
> + (++rs->dirty_rate_high_cnt >= 2)) {
> + rs->dirty_rate_high_cnt = 0;
> + /*
> + * During block migration the auto-converge logic incorrectly detects
> + * that ram migration makes no progress. Avoid this by disabling the
> + * throttling logic during the bulk phase of block migration
> + */
> +
> + if (migrate_auto_converge() && !blk_mig_bulk_active()) {
Does dirtylimit cap needs to check blk_mig_bulk_active() too? I assume
that check was used to ignore the bulk block migration phase where major
bandwidth will be consumed by block migrations so the measured bandwidth is
not accurate. IIUC it applies to dirtylimit too.
> trace_migration_throttle();
> - rs->dirty_rate_high_cnt = 0;
> mig_throttle_guest_down(bytes_dirty_period,
> bytes_dirty_threshold);
> + } else if (migrate_dirty_limit() &&
> + kvm_dirty_ring_enabled() &&
> + migration_is_active(s)) {
Is "kvm_dirty_ring_enabled()" and "migration_is_active(s)" check helpful?
Can we only rely on migrate_dirty_limit() alone?
--
Peter Xu
next prev parent reply other threads:[~2022-11-29 23:18 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-21 16:26 [PATCH v2 00/11] migration: introduce dirtylimit capability huangy81
2022-11-21 16:26 ` [PATCH v2 01/11] dirtylimit: Fix overflow when computing MB huangy81
2022-11-29 23:17 ` Peter Xu
2022-12-03 8:56 ` Markus Armbruster
2022-11-21 16:26 ` [PATCH v2 02/11] softmmu/dirtylimit: Add parameter check for hmp "set_vcpu_dirty_limit" huangy81
2022-11-29 23:17 ` Peter Xu
2022-12-03 9:01 ` Markus Armbruster
2022-11-21 16:26 ` [PATCH v2 03/11] kvm-all: Do not allow reap vcpu dirty ring buffer if not ready huangy81
2022-11-29 22:42 ` Peter Xu
2022-11-30 3:11 ` Hyman Huang
2022-11-21 16:26 ` [PATCH v2 04/11] qapi/migration: Introduce x-vcpu-dirty-limit-period parameter huangy81
2022-11-29 22:49 ` Peter Xu
2022-12-03 9:06 ` Markus Armbruster
2022-12-03 9:11 ` Markus Armbruster
2022-11-21 16:26 ` [PATCH v2 05/11] qapi/migration: Introduce vcpu-dirty-limit parameters huangy81
2022-11-29 23:58 ` Peter Xu
2022-12-03 9:13 ` Markus Armbruster
2022-12-03 9:21 ` Markus Armbruster
2022-11-21 16:26 ` [PATCH v2 06/11] migration: Introduce dirty-limit capability huangy81
2022-11-29 23:58 ` Peter Xu
2022-12-03 9:24 ` Markus Armbruster
2022-11-21 16:26 ` [PATCH v2 07/11] migration: Implement dirty-limit convergence algo huangy81
2022-11-29 23:17 ` Peter Xu [this message]
2022-12-01 1:13 ` Hyman
2022-11-21 16:26 ` [PATCH v2 08/11] migration: Export dirty-limit time info huangy81
2022-11-30 0:09 ` Peter Xu
2022-12-01 2:09 ` Hyman
2022-12-03 9:14 ` Hyman
2022-12-03 9:42 ` Markus Armbruster
2022-12-03 9:28 ` Markus Armbruster
2022-11-21 16:26 ` [PATCH v2 09/11] tests: Add migration dirty-limit capability test huangy81
2022-11-21 16:26 ` [PATCH v2 10/11] tests/migration: Introduce dirty-ring-size option into guestperf huangy81
2022-11-21 16:26 ` [PATCH v2 11/11] tests/migration: Introduce dirty-limit " huangy81
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=Y4aS9UjwNabKMAHN@x1n \
--to=peterx@redhat.com \
--cc=armbru@redhat.com \
--cc=dgilbert@redhat.com \
--cc=eblake@redhat.com \
--cc=huangy81@chinatelecom.cn \
--cc=laurent@vivier.eu \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=richard.henderson@linaro.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).