From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 11826C433F5 for ; Tue, 17 May 2022 06:42:32 +0000 (UTC) Received: from localhost ([::1]:53004 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nqquc-0007Yt-Mr for qemu-devel@archiver.kernel.org; Tue, 17 May 2022 02:42:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58676) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqqoK-0004ks-D4 for qemu-devel@nongnu.org; Tue, 17 May 2022 02:36:03 -0400 Received: from prt-mail.chinatelecom.cn ([42.123.76.219]:46516 helo=chinatelecom.cn) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nqqoG-0007fk-EW for qemu-devel@nongnu.org; Tue, 17 May 2022 02:35:59 -0400 HMM_SOURCE_IP: 172.18.0.48:35216.1855245433 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP Received: from clientip-36.111.64.84 (unknown [172.18.0.48]) by chinatelecom.cn (HERMES) with SMTP id B9D232800D4; Tue, 17 May 2022 14:35:39 +0800 (CST) X-189-SAVE-TO-SEND: +huangy81@chinatelecom.cn Received: from ([172.18.0.48]) by app0024 with ESMTP id 3d1468d696774e69bc9b1d05cec76146 for qemu-devel@nongnu.org; Tue, 17 May 2022 14:35:41 CST X-Transaction-ID: 3d1468d696774e69bc9b1d05cec76146 X-Real-From: huangy81@chinatelecom.cn X-Receive-IP: 172.18.0.48 X-MEDUSA-Status: 0 From: huangy81@chinatelecom.cn To: qemu-devel Cc: "Dr. David Alan Gilbert" , Juan Quintela , Eric Blake , Markus Armbruster , Thomas Huth , Laurent Vivier , Paolo Bonzini , Hyman Huang Subject: [RFC 4/6] migration: Introduce dirtylimit capability Date: Tue, 17 May 2022 14:35:04 +0800 Message-Id: <2ef63cf661750cd848492c4f917e46e3700c1409.1652762652.git.huangy81@chinatelecom.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=42.123.76.219; envelope-from=huangy81@chinatelecom.cn; helo=chinatelecom.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Hyman Huang(黄勇) Introduce migration dirtylimit capability, which can be turned on before live migration and limit dirty page rate durty live migration. Dirtylimit dirtylimit capability is kind of like auto-converge but using dirtylimit instead of traditional cpu-throttle to throttle guest down. To enable this feature, turn on the dirtylimit capability before live migration using migratioin-set-capabilities, and set dirtylimit-related parameters "vcpu-dirtylimit", "vcpu-dirtylimit-period" suitably to speed up convergence. Signed-off-by: Hyman Huang(黄勇) --- migration/migration.c | 7 ++++++- qapi/migration.json | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 9e4ce01..4a659b6 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2427,7 +2427,11 @@ bool migrate_auto_converge(void) bool migrate_dirtylimit(void) { - return false; + MigrationState *s; + + s = migrate_get_current(); + + return s->enabled_capabilities[MIGRATION_CAPABILITY_DIRTYLIMIT]; } bool migrate_zero_blocks(void) @@ -4270,6 +4274,7 @@ static Property migration_properties[] = { DEFINE_PROP_MIG_CAP("x-multifd", MIGRATION_CAPABILITY_MULTIFD), DEFINE_PROP_MIG_CAP("x-background-snapshot", MIGRATION_CAPABILITY_BACKGROUND_SNAPSHOT), + DEFINE_PROP_MIG_CAP("x-dirtylimit", MIGRATION_CAPABILITY_DIRTYLIMIT), DEFINE_PROP_END_OF_LIST(), }; diff --git a/qapi/migration.json b/qapi/migration.json index 68c1fe0..30ad413 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -463,6 +463,9 @@ # procedure starts. The VM RAM is saved with running VM. # (since 6.0) # +# @dirtylimit: Use dirtylimit to throttle down guest if enabled. +# (since 7.0) +# # Features: # @unstable: Members @x-colo and @x-ignore-shared are experimental. # @@ -476,7 +479,7 @@ 'block', 'return-path', 'pause-before-switchover', 'multifd', 'dirty-bitmaps', 'postcopy-blocktime', 'late-block-activate', { 'name': 'x-ignore-shared', 'features': [ 'unstable' ] }, - 'validate-uuid', 'background-snapshot'] } + 'validate-uuid', 'background-snapshot', 'dirtylimit'] } ## # @MigrationCapabilityStatus: -- 1.8.3.1