From nobody Thu May 16 17:45:25 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1591559975; cv=none; d=zohomail.com; s=zohoarc; b=b6XAGcDuLu/UO4Ig2aZSgqlKVB/Sa9V71EEvI+AQQKiUgqneiL1MuTJIjaWyS9NhZjrE1/dOfCttAVq/FwSdY4NUE0DH36ujGkboFppI2Z+0oN3++4POKDEyp2HNe0RCQsCJW9Ci3se4nqqBMqm9yzFLsSAITPsHsh8UqNDe0oM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591559975; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=e6V+LfKGdIA/bIoJQxLxVlpXLKvcubNGGKwCCduljTg=; b=KXKazTSWCYGGLPhA3G2TZcZzdRKox10hRVF1iTlMjxZq2133bWzEmNCrDzZbgjqyXUOmgsn9ERo4rRnaORW0oPcqw0zx3dZo0dTl3OKpxwXP5cFOdWfZn4kmSdfCLGJkC30epQdwp4PABKoxA6xLjiqcSvZyqwuEYY7zzIY5+ew= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1591559975031432.9491309610503; Sun, 7 Jun 2020 12:59:35 -0700 (PDT) Received: from localhost ([::1]:39508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ji1S9-0003x7-FW for importer@patchew.org; Sun, 07 Jun 2020 15:59:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ji1Pr-0000ef-Vx for qemu-devel@nongnu.org; Sun, 07 Jun 2020 15:57:12 -0400 Received: from mga05.intel.com ([192.55.52.43]:14939) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ji1Pr-0006UL-1X for qemu-devel@nongnu.org; Sun, 07 Jun 2020 15:57:11 -0400 Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2020 12:57:09 -0700 Received: from unknown (HELO localhost.localdomain) ([10.239.13.19]) by orsmga005.jf.intel.com with ESMTP; 07 Jun 2020 12:57:07 -0700 IronPort-SDR: pkc16m3Dd+nuykpD5aNEXlCqxzb55ekezIPtx6voAeZQnzzYOxhMZieniJUIO0OAqQvE93zDvT 50UOefPLtfIw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False IronPort-SDR: 6mBRx3buDGTnzCaMO/1QPQk8eykyaa5SCGKyLgNIZwh8uQO8xyj8Mf85FN/O+ooN1U1mTtgwFL 8OCJi+6BcFTg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,485,1583222400"; d="scan'208";a="446509258" From: Zhang Chen To: "Dr . David Alan Gilbert" , qemu-dev Subject: [PATCH V3 1/3] migration/colo: Optimize COLO boot code path Date: Mon, 8 Jun 2020 03:46:09 +0800 Message-Id: <20200607194611.24763-2-chen.zhang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200607194611.24763-1-chen.zhang@intel.com> References: <20200607194611.24763-1-chen.zhang@intel.com> Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=192.55.52.43; envelope-from=chen.zhang@intel.com; helo=mga05.intel.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/07 15:57:07 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] X-Spam_score_int: -9 X-Spam_score: -1.0 X-Spam_bar: - X-Spam_report: (-1.0 / 5.0 requ) BAYES_00=-1.9, FROM_ADDR_WS=2.999, FROM_WSP_TRAIL=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhang Chen , Zhanghailiang , Zhang Chen Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Zhang Chen No need to reuse MIGRATION_STATUS_ACTIVE boot COLO. Signed-off-by: Zhang Chen Reviewed-by: zhanghailiang Reviewed-by: Lukas Straub Tested-by: Lukas Straub --- migration/colo.c | 2 -- migration/migration.c | 17 ++++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/migration/colo.c b/migration/colo.c index ea7d1e9d4e..91c76789fa 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -670,8 +670,6 @@ void migrate_start_colo_process(MigrationState *s) colo_checkpoint_notify, s); =20 qemu_sem_init(&s->colo_exit_sem, 0); - migrate_set_state(&s->state, MIGRATION_STATUS_ACTIVE, - MIGRATION_STATUS_COLO); colo_process_checkpoint(s); qemu_mutex_lock_iothread(); } diff --git a/migration/migration.c b/migration/migration.c index b63ad91d34..9059238e3d 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2972,7 +2972,10 @@ static void migration_completion(MigrationState *s) goto fail_invalidate; } =20 - if (!migrate_colo_enabled()) { + if (migrate_colo_enabled()) { + migrate_set_state(&s->state, current_active_state, + MIGRATION_STATUS_COLO); + } else { migrate_set_state(&s->state, current_active_state, MIGRATION_STATUS_COMPLETED); } @@ -3304,12 +3307,7 @@ static void migration_iteration_finish(MigrationStat= e *s) migration_calculate_complete(s); runstate_set(RUN_STATE_POSTMIGRATE); break; - - case MIGRATION_STATUS_ACTIVE: - /* - * We should really assert here, but since it's during - * migration, let's try to reduce the usage of assertions. - */ + case MIGRATION_STATUS_COLO: if (!migrate_colo_enabled()) { error_report("%s: critical error: calling COLO code without " "COLO enabled", __func__); @@ -3321,6 +3319,11 @@ static void migration_iteration_finish(MigrationStat= e *s) */ s->vm_was_running =3D true; /* Fallthrough */ + case MIGRATION_STATUS_ACTIVE: + /* + * We should really assert here, but since it's during + * migration, let's try to reduce the usage of assertions. + */ case MIGRATION_STATUS_FAILED: case MIGRATION_STATUS_CANCELLED: case MIGRATION_STATUS_CANCELLING: --=20 2.17.1 From nobody Thu May 16 17:45:25 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1591560531; cv=none; d=zohomail.com; s=zohoarc; b=ax1cc1B5AplC/bK5Gug5eGDcDrkSeTIRziPYuCMjmX2iyFCus0iw3Xyb5PBgLiORjF5AO0PM/jJTcZXlxB8gk8fNEZFJP3Amsrt4twDCUpUVP7QZGXqZaSGX/oHJxpwdsXPA7iJZy8t7AoYwi/GK3eDCYBi68R20Cf8VI819iDk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591560531; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=azyqQphPNCRV9ruO/T7amYOBEAZhBZD9/1sl5FhlEjA=; b=Puwg2kzrtntmybtDAs/9qlZtREVySICjTbeD4u2vi7AZ0n0RGoUIhw0CMv1eapYqSpBv/5Fb1K1YsYVDMrTGlvy7fkscQwxIOKXSqSnsj9LQBioC4rX53nv3zVBAt3Gwz6LbA9pubzXIA9JgvxXC9R9W/h8+pYHex8P/xfi8KD0= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1591560531728178.82414191319936; Sun, 7 Jun 2020 13:08:51 -0700 (PDT) Received: from localhost ([::1]:57098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ji1b8-0003FL-Ia for importer@patchew.org; Sun, 07 Jun 2020 16:08:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ji1Pt-0000go-4Y for qemu-devel@nongnu.org; Sun, 07 Jun 2020 15:57:13 -0400 Received: from mga05.intel.com ([192.55.52.43]:14935) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ji1Pr-0006UC-Pe for qemu-devel@nongnu.org; Sun, 07 Jun 2020 15:57:12 -0400 Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2020 12:57:11 -0700 Received: from unknown (HELO localhost.localdomain) ([10.239.13.19]) by orsmga005.jf.intel.com with ESMTP; 07 Jun 2020 12:57:09 -0700 IronPort-SDR: Gwzr64tGx5/83I3ZuV+WoKPkZvwi3aJNVzmdngLWMb/wiusuj4gus/rLo/hbhME8J4QsRKjfeW 0fBAYH0FAevg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False IronPort-SDR: TFtCqwJBNRIV+XFr2OfvjWmOJveDBwQuZJJOnGc2zgdULEoHGDLAT+hi//yW9Fa7g+eLjyyefH qILLjEmWHajQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,485,1583222400"; d="scan'208";a="446509265" From: Zhang Chen To: "Dr . David Alan Gilbert" , qemu-dev Subject: [PATCH V3 2/3] migration/colo: Update checkpoint time lately Date: Mon, 8 Jun 2020 03:46:10 +0800 Message-Id: <20200607194611.24763-3-chen.zhang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200607194611.24763-1-chen.zhang@intel.com> References: <20200607194611.24763-1-chen.zhang@intel.com> Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=192.55.52.43; envelope-from=chen.zhang@intel.com; helo=mga05.intel.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/07 15:57:07 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] X-Spam_score_int: -9 X-Spam_score: -1.0 X-Spam_bar: - X-Spam_report: (-1.0 / 5.0 requ) BAYES_00=-1.9, FROM_ADDR_WS=2.999, FROM_WSP_TRAIL=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhang Chen , Zhanghailiang , Zhang Chen Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Zhang Chen Previous operation(like vm_start and replication_start_all) will consume extra time for first forced synchronization, so reduce it in this patch. Signed-off-by: Zhang Chen Reviewed-by: zhanghailiang Reviewed-by: Lukas Straub Tested-by: Lukas Straub --- migration/colo.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/migration/colo.c b/migration/colo.c index 91c76789fa..2b837e1255 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -532,7 +532,6 @@ static void colo_process_checkpoint(MigrationState *s) { QIOChannelBuffer *bioc; QEMUFile *fb =3D NULL; - int64_t current_time =3D qemu_clock_get_ms(QEMU_CLOCK_HOST); Error *local_err =3D NULL; int ret; =20 @@ -581,8 +580,8 @@ static void colo_process_checkpoint(MigrationState *s) qemu_mutex_unlock_iothread(); trace_colo_vm_state_change("stop", "run"); =20 - timer_mod(s->colo_delay_timer, - current_time + s->parameters.x_checkpoint_delay); + timer_mod(s->colo_delay_timer, qemu_clock_get_ms(QEMU_CLOCK_HOST) + + s->parameters.x_checkpoint_delay); =20 while (s->state =3D=3D MIGRATION_STATUS_COLO) { if (failover_get_state() !=3D FAILOVER_STATUS_NONE) { --=20 2.17.1 From nobody Thu May 16 17:45:25 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1591560123; cv=none; d=zohomail.com; s=zohoarc; b=IIGAV3saLnahPhdsDDmAHwNbcm4qSFcBm8MTUWKGMplm4bjUto74huUzSLFiiBwr0HEFe9i1832+W5KsVRML1FEN0EzLxnXqDogExwkLv4u9L4Gk497vn9Li/o29W/MsOeWJS5jjSgSOAWulbPCzi3kdykHzA7lkG3Maz1gYToM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591560123; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=d1WfoZD/Rup8S2pcfoQF3Ck+Pn5KABHqI+UrIe7xL1Y=; b=NPXz4oRvPd8VhmzCulUcXUe0wO4Qt7TjjWXXj+SctMjFTM4cduBh02r27tbunbBlBYUUG8cg2rfNea2jjvoE8BaSlpWo7v/X40+J34QL+bVVfq4jmZtLibHYBzIAWGOxwFeor5c8cTms33H2jcan7iEdAtx1EFCYSE+k7XKhVO4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15915601232651017.0196067357958; Sun, 7 Jun 2020 13:02:03 -0700 (PDT) Received: from localhost ([::1]:43658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ji1UY-0005rY-0E for importer@patchew.org; Sun, 07 Jun 2020 16:02:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60872) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ji1Pv-0000lp-Hf for qemu-devel@nongnu.org; Sun, 07 Jun 2020 15:57:15 -0400 Received: from mga05.intel.com ([192.55.52.43]:14944) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ji1Pu-0006Uc-NN for qemu-devel@nongnu.org; Sun, 07 Jun 2020 15:57:15 -0400 Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2020 12:57:12 -0700 Received: from unknown (HELO localhost.localdomain) ([10.239.13.19]) by orsmga005.jf.intel.com with ESMTP; 07 Jun 2020 12:57:11 -0700 IronPort-SDR: hSy4R+TIpphgrH5qLwb7HZPsHXP8fRjSSSMTRzbNLY9/3YzcIk7lwnH/El2gQroEtkdH4G2+lz HJ5BqqV9eW6w== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False IronPort-SDR: yc+xQq563Rd0ooyLNDsYv/GcJ3bxMS1YloeXFuvGk+RuUmp2SYArOO3hES0Lh2sj40R02UBZW4 bj9Rvqbb8uRA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,485,1583222400"; d="scan'208";a="446509269" From: Zhang Chen To: "Dr . David Alan Gilbert" , qemu-dev Subject: [PATCH V3 3/3] migration/migration.c: Remove MIGRATION_STATUS_ACTIVE in migration_iteration_finish Date: Mon, 8 Jun 2020 03:46:11 +0800 Message-Id: <20200607194611.24763-4-chen.zhang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200607194611.24763-1-chen.zhang@intel.com> References: <20200607194611.24763-1-chen.zhang@intel.com> Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=192.55.52.43; envelope-from=chen.zhang@intel.com; helo=mga05.intel.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/07 15:57:07 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] X-Spam_score_int: -9 X-Spam_score: -1.0 X-Spam_bar: - X-Spam_report: (-1.0 / 5.0 requ) BAYES_00=-1.9, FROM_ADDR_WS=2.999, FROM_WSP_TRAIL=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhang Chen , Zhanghailiang , Zhang Chen Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Zhang Chen MIGRATION_STATUS_ACTIVE is invalid here, handle it by default case. Suggested-by: Lukas Straub Signed-off-by: Zhang Chen Reviewed-by: Lukas Straub Tested-by: Lukas Straub --- migration/migration.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 9059238e3d..9958b15202 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -3319,11 +3319,6 @@ static void migration_iteration_finish(MigrationStat= e *s) */ s->vm_was_running =3D true; /* Fallthrough */ - case MIGRATION_STATUS_ACTIVE: - /* - * We should really assert here, but since it's during - * migration, let's try to reduce the usage of assertions. - */ case MIGRATION_STATUS_FAILED: case MIGRATION_STATUS_CANCELLED: case MIGRATION_STATUS_CANCELLING: --=20 2.17.1