From nobody Thu May 16 04:14:27 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=1591261643; cv=none; d=zohomail.com; s=zohoarc; b=TRC6BuC4uh9u4znm3Ex3Vfa+y+nUnVzmT7RleWed9MFhOxmKiIT31/XGUgJvpByVS2bmgitYp0P7DB0nnyAFQZRdZObX6TMW7V0o7HYi6tK+sn7/CUwraX8gnMxJr3qwOnxZeFHiMRU/BobMxmRXubV3OBu/PCrh/DQrzpVrSlM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591261643; 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=lHIP5Gtw0N/5ZrVIQIlMP0qJgruEmiBbMPIr6fygVao=; b=dzxTUvPUivhcD74hFqYLR9UuCi4cpmnwwBy35XWzQ+gWWKzSp6sHGTW3pVm+THiGbys/dI2XoX0owhQVzZpUyTMSwbWU7w9HAMLamkQTOzVrai4sHOG3GHr139n+09EkOx2ESKbM1nE3ozVnk1eoJV8nA285kX9qHWWOWBw0kCQ= 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 1591261643864954.2463508980331; Thu, 4 Jun 2020 02:07:23 -0700 (PDT) Received: from localhost ([::1]:46836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jglqM-00010O-HH for importer@patchew.org; Thu, 04 Jun 2020 05:07:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jglpX-00080n-4m for qemu-devel@nongnu.org; Thu, 04 Jun 2020 05:06:31 -0400 Received: from mga06.intel.com ([134.134.136.31]:40868) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jglpW-0005Cp-3J for qemu-devel@nongnu.org; Thu, 04 Jun 2020 05:06:30 -0400 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2020 02:06:27 -0700 Received: from unknown (HELO localhost.localdomain) ([10.239.13.19]) by orsmga004.jf.intel.com with ESMTP; 04 Jun 2020 02:06:25 -0700 IronPort-SDR: 0TQCSS6pdRnAHi+DLVYjjC/HeYotgNmtDwYXvJN9wi1OkrkMBTSwkLRSWWCEjCadVKSULoHtpc 0Z2D475KUIvQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False IronPort-SDR: GPijHCpiLEAvC0VJQ4Totl4jIfZ61qD6Yi2YsuKcIaGxk0qAnb/crfQKXV3VkZ0OqUwXbbxIg4 FYndGz2OUjAQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,471,1583222400"; d="scan'208";a="416847115" From: Zhang Chen To: "Dr . David Alan Gilbert" , qemu-dev Subject: [PATCH V2 1/2] migration/colo: Optimize COLO boot code path Date: Thu, 4 Jun 2020 16:55:32 +0800 Message-Id: <20200604085533.7769-2-chen.zhang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200604085533.7769-1-chen.zhang@intel.com> References: <20200604085533.7769-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=134.134.136.31; envelope-from=chen.zhang@intel.com; helo=mga06.intel.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/04 05:06:26 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 --- 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..7f3f82a715 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__); @@ -3319,6 +3317,11 @@ static void migration_iteration_finish(MigrationStat= e *s) * Fixme: we will run VM in COLO no matter its old running state. * After exited COLO, we will keep running. */ + case MIGRATION_STATUS_ACTIVE: + /* + * We should really assert here, but since it's during + * migration, let's try to reduce the usage of assertions. + */ s->vm_was_running =3D true; /* Fallthrough */ case MIGRATION_STATUS_FAILED: --=20 2.17.1 From nobody Thu May 16 04:14:27 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=1591261717; cv=none; d=zohomail.com; s=zohoarc; b=V9+rJZ+kPnP68wD4C9gb1NLy0Lq+pOl+TDOYsKPCkti6P/bbPZdrkaW3/B9yWAdrodINHHsyi1okjEogfjGVJ2hB+YkZgfe5AOEKw1hOX/yP22XSuV6SLJTBYdgbnIuBq+ftRzReI4WsBpCjz2rPj4sPPXOQ/HYmToeY0naAu9k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591261717; 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=7eSqIXsN9cufWsPfcjbGVVxkLuUaw7AZPr6rLw9Z3TQ=; b=OHxpk/kVCFtdodVRo1Z3vh4tfaMXe6wZbxdzsxzTIgJyo+uC7BpiUL2lfP8KFMmmi5x+V4jN1fCZJY30bA0KhImfr6fYUBhALdVhEp1SBEdEeaa+CGGxpN+d3mu2stIfyNyYs3uHMYP5m2HTklFf4oEGz1Cuv6Sf0YWa8DFCis4= 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 1591261717530861.733254921797; Thu, 4 Jun 2020 02:08:37 -0700 (PDT) Received: from localhost ([::1]:52644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jglrY-0003M0-9K for importer@patchew.org; Thu, 04 Jun 2020 05:08:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jglpW-00080G-Qp for qemu-devel@nongnu.org; Thu, 04 Jun 2020 05:06:30 -0400 Received: from mga06.intel.com ([134.134.136.31]:40867) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jglpV-0005Cl-UN for qemu-devel@nongnu.org; Thu, 04 Jun 2020 05:06:30 -0400 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2020 02:06:29 -0700 Received: from unknown (HELO localhost.localdomain) ([10.239.13.19]) by orsmga004.jf.intel.com with ESMTP; 04 Jun 2020 02:06:27 -0700 IronPort-SDR: J1nMRiRB9BMEaKWspbOx5lWjUyroKOwKggWACEiVpEPVYxcJP00KSJxSmHjPfb396qyCi43PuK jyzW+w5noc2w== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False IronPort-SDR: sTkRehHITrl0g2a3elyuho8qVI8b7JFu4xzFe382rT/RsKA20uLHGQ2njyS89DEjBDLHQLOM8U UC15iSNvQgWw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,471,1583222400"; d="scan'208";a="416847120" From: Zhang Chen To: "Dr . David Alan Gilbert" , qemu-dev Subject: [PATCH V2 2/2] migration/colo: Update checkpoint time lately Date: Thu, 4 Jun 2020 16:55:33 +0800 Message-Id: <20200604085533.7769-3-chen.zhang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200604085533.7769-1-chen.zhang@intel.com> References: <20200604085533.7769-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=134.134.136.31; envelope-from=chen.zhang@intel.com; helo=mga06.intel.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/04 05:06:26 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