From nobody Fri Nov 14 20:59:34 2025 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=1589517711; cv=none; d=zohomail.com; s=zohoarc; b=dUOL8vjyruzIm0grtNs3qzOOtxR726vS2Hm/9KiAcZQL80WpoaKnnjFsZ9PpQDairz9+1h7if3JEarHDzX7vHV1+LYkbtapQtvPWFtiFtt0tbd44GUADEVBfl3cSxvkt03H8e9Lx0/qiXms/VI68Oexk/wxm/WoJ1TNnEOZzsyY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589517711; 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=vSgIQv1eQZI6L2xLSotKWZ7h/8vYV4cHng+N6e7KbZ0=; b=VzG1zq1OGS545zTp3e1XngKh0S0M3QqLDO/THaKJhhenM2UbWU+EczDFxQBaoEo9k7bwsa/eKWXNy4+anD+Thr1uldHYSJrl35bWc0mDIsU0uGAdKfmGuKCLj5wMZLLlAydHaPp4CUwKOw/QqP9z3UaiIojEV2UkKux4MYVAvkE= 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 1589517711001710.6779272230846; Thu, 14 May 2020 21:41:51 -0700 (PDT) Received: from localhost ([::1]:49292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZSAP-0003fo-S5 for importer@patchew.org; Fri, 15 May 2020 00:41:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZS7Z-0007hG-Lk for qemu-devel@nongnu.org; Fri, 15 May 2020 00:38:53 -0400 Received: from mga12.intel.com ([192.55.52.136]:45615) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZS7Y-0007ba-SZ for qemu-devel@nongnu.org; Fri, 15 May 2020 00:38:53 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 May 2020 21:38:52 -0700 Received: from unknown (HELO localhost.localdomain) ([10.239.13.19]) by orsmga003.jf.intel.com with ESMTP; 14 May 2020 21:38:50 -0700 IronPort-SDR: 6uJ4RuuYXP6EPxfjVprHDOrraQl8bTfLtTcGM5oxp3syS+AifWobZeY3Rv3iZy8uXT1zHzdy81 cIlEneFBf+iQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False IronPort-SDR: n09WbtQhRsoBAEGUiaJLXbb9LWzPvf/OHs/d38ePO15mz9yhF3tTgM0/OokPHh0Qijtteg8Gq1 aOgFKGbRWlmQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,394,1583222400"; d="scan'208";a="263069548" From: Zhang Chen To: "Dr . David Alan Gilbert" , Juan Quintela , Zhanghailiang , qemu-dev Subject: [PATCH 3/3] migration/colo: Merge multi checkpoint request into one. Date: Fri, 15 May 2020 12:28:18 +0800 Message-Id: <20200515042818.17908-4-chen.zhang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200515042818.17908-1-chen.zhang@intel.com> References: <20200515042818.17908-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.136; envelope-from=chen.zhang@intel.com; helo=mga12.intel.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/15 00:38:46 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_HELO_PASS=-0.001, 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 , Jason Wang , 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 When COLO guest occur issues, COLO-compare will catch lots of different network packet and trigger notification multi times, force periodic may happen at the same time. So this can be efficient merge checkpoint request within COLO_CHECKPOINT_INTERVAL. Signed-off-by: Zhang Chen --- migration/colo.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/migration/colo.c b/migration/colo.c index d5bced22cb..e6a7d8c6e2 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -47,6 +47,9 @@ static COLOMode last_colo_mode; =20 #define COLO_BUFFER_BASE_SIZE (4 * 1024 * 1024) =20 +/* Default COLO_CHECKPOINT_INTERVAL is 1000 ms */ +#define COLO_CHECKPOINT_INTERVAL 1000 + bool migration_in_colo_state(void) { MigrationState *s =3D migrate_get_current(); @@ -651,13 +654,20 @@ out: void colo_checkpoint_notify(void *opaque) { MigrationState *s =3D opaque; - int64_t next_notify_time; + int64_t now =3D qemu_clock_get_ms(QEMU_CLOCK_HOST); =20 - qemu_sem_post(&s->colo_checkpoint_sem); - s->colo_checkpoint_time =3D qemu_clock_get_ms(QEMU_CLOCK_HOST); - next_notify_time =3D s->colo_checkpoint_time + - s->parameters.x_checkpoint_delay; - timer_mod(s->colo_delay_timer, next_notify_time); + /* + * When COLO guest occur issues, COLO-compare will catch lots of + * different network packet and trigger notification multi times, + * force periodic may happen at the same time. So this can be + * efficient merge checkpoint request within COLO_CHECKPOINT_INTERVAL. + */ + if (now > s->colo_checkpoint_time + COLO_CHECKPOINT_INTERVAL) { + qemu_sem_post(&s->colo_checkpoint_sem); + timer_mod(s->colo_delay_timer, now + + s->parameters.x_checkpoint_delay); + s->colo_checkpoint_time =3D now; + } } =20 void migrate_start_colo_process(MigrationState *s) --=20 2.17.1