From nobody Mon Feb 9 00:42:04 2026 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=1602660677; cv=none; d=zohomail.com; s=zohoarc; b=NzNibmo+pOqZRm8PvzQWX6HBclekByv4YP1m9iBUCM1dz8i7kh3Q5jEuIzgpfaPkUEIRyP7SExP06MO8cuKltHeHTJZVW3HjoEAtZ9lozRasBQwiniZyz2pj/IYFIwV9wRG56xyVyefctF0yMc7H5Eyp8/uSip5kDJZqzFXsz9o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602660677; 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=argUe+0p8TOfZeCoykbsJfXCHShQB8R/g//rvqgNZQI=; b=EbztoeT4BpVNVi7HWrpd4UeSAPqPWQPYwGPAaZrMs80ptmTQ3v7gjsh55UWUKYDayxUFC2VL8UbAIDQ0gHK07vPprQ49dY4HkqYqM7bbNvPNB4wnQslgwSzL12+yXNA/I4DDUJcGc9SAjhsU1ywaDzB0o/fR7eTv2xzTX9ZkImc= 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 1602660677990164.10171739658233; Wed, 14 Oct 2020 00:31:17 -0700 (PDT) Received: from localhost ([::1]:52676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kSbFj-00013x-3u for importer@patchew.org; Wed, 14 Oct 2020 03:31:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50892) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSbD4-0007hI-OD for qemu-devel@nongnu.org; Wed, 14 Oct 2020 03:28:30 -0400 Received: from mga05.intel.com ([192.55.52.43]:54364) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSbD2-00040p-KU for qemu-devel@nongnu.org; Wed, 14 Oct 2020 03:28:30 -0400 Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2020 00:28:27 -0700 Received: from unknown (HELO localhost.localdomain) ([10.239.13.19]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2020 00:28:25 -0700 IronPort-SDR: ybgreQDChSDv1ASkjJgY2gJC6X7e5XHoeWoqrj/x3Zlt5nUpOVX759ebmc47HwDVwZ/WSbRHbW hh8dMP+siIEA== X-IronPort-AV: E=McAfee;i="6000,8403,9773"; a="250751924" X-IronPort-AV: E=Sophos;i="5.77,374,1596524400"; d="scan'208";a="250751924" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False IronPort-SDR: 9BMicKigJHIx5iEfBMmltV8bs/HmgMNf3InkqwcOGbqvFUJKReo7V5POT4p151ciDBAFTezqw1 Y6jsiUXvGHaQ== X-IronPort-AV: E=Sophos;i="5.77,374,1596524400"; d="scan'208";a="521323038" From: Zhang Chen To: Jason Wang , qemu-dev Subject: [PATCH 03/10] Reduce the time of checkpoint for COLO Date: Wed, 14 Oct 2020 15:25:49 +0800 Message-Id: <20201014072555.12515-4-chen.zhang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201014072555.12515-1-chen.zhang@intel.com> References: <20201014072555.12515-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/10/14 03:28:22 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, FROM_ADDR_WS=2.999, FROM_WSP_TRAIL=2.199, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no 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 , "Rao, Lei" , 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: "Rao, Lei" we should set ram_bulk_stage to false after ram_state_init, otherwise the bitmap will be unused in migration_bitmap_find_dirty. all pages in ram cache will be flushed to the ram of secondary guest for each checkpoint. Signed-off-by: leirao Signed-off-by: Zhang Chen Reviewed-by: Li Zhijian Reviewed-by: Zhang Chen --- migration/ram.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/migration/ram.c b/migration/ram.c index 433489d633..9cfac3d9ba 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -3009,6 +3009,18 @@ static void decompress_data_with_multi_threads(QEMUF= ile *f, qemu_mutex_unlock(&decomp_done_lock); } =20 + /* + * we must set ram_bulk_stage to false, otherwise in + * migation_bitmap_find_dirty the bitmap will be unused and + * all the pages in ram cache wil be flushed to the ram of + * secondary VM. + */ +static void colo_init_ram_state(void) +{ + ram_state_init(&ram_state); + ram_state->ram_bulk_stage =3D false; +} + /* * colo cache: this is for secondary VM, we cache the whole * memory of the secondary VM, it is need to hold the global lock @@ -3052,7 +3064,7 @@ int colo_init_ram_cache(void) } } =20 - ram_state_init(&ram_state); + colo_init_ram_state(); return 0; } =20 --=20 2.17.1