From nobody Wed Nov 5 02:29:53 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 153228872902327.19659723210907; Sun, 22 Jul 2018 12:45:29 -0700 (PDT) Received: from localhost ([::1]:57264 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhKIJ-0002cc-DL for importer@patchew.org; Sun, 22 Jul 2018 15:45:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37984) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhK99-0003We-B3 for qemu-devel@nongnu.org; Sun, 22 Jul 2018 15:36:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fhK96-00016k-7j for qemu-devel@nongnu.org; Sun, 22 Jul 2018 15:35:59 -0400 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:33572) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fhK96-00016b-1t for qemu-devel@nongnu.org; Sun, 22 Jul 2018 15:35:56 -0400 Received: by mail-pf1-x442.google.com with SMTP id b17-v6so495856pfi.0 for ; Sun, 22 Jul 2018 12:35:55 -0700 (PDT) Received: from localhost.localdomain (155.150.229.35.bc.googleusercontent.com. [35.229.150.155]) by smtp.gmail.com with ESMTPSA id 87-v6sm14215353pfn.103.2018.07.22.12.35.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Jul 2018 12:35:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mU7awURrWAnfdKXiuwCryS0yrZb2zbth6Y2Fz4lEEgw=; b=i1+WA6vF5sIWUzFFcFQOtOEJpOc6yZMp162cxRitduNB86JCncLDoFWwLnut1ptvMO eLiw7MPwyQjtC9RkkCBYZufXc+VQLHr0CVborJzrOxpiNkNtQJZb+JaFI3/GqL3WyTbS EYJYqGDJLR2bccRM/I+dULh6bnHTkagmS0UqpLyjKW8umkoE8moqoYhvjabinmj3qHen K/W70ObjgQGu4JGatpXUS1ZFmVrYHc8fABu+dbkhxddi3eipCXpdpeuXk7qd/ClnUxvg 8B3ipD/u5qii8YbjJ2W5kH5WFy1Ai7Mq+K7H/8TMJJUi3dYodn4G3Km+Cs/Y/Nje4HRG sWfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mU7awURrWAnfdKXiuwCryS0yrZb2zbth6Y2Fz4lEEgw=; b=d4cwuKYgjfmAKLTy9ZqDeIhLC5Z79noVjze3ezJFwsTBUIps3qFa7AK6ToFdWBkEIq Vn155/KlJnG0Z1oOlsVHHJrcxKxJsnIWSqTK3iXKoWszeikpXzhtNq44kTkL/cR1OHaD 3ZuofcmL6t4Hf7dd7O6vNV7GaO5MV8p3nVHZxssKhHv6s51Hk4PrOH27YEgrO71bDnhN zNzrZ67g3Df0t9bnsIlViqVnZOiEh6TeO3dpG+rMYCY5/7eKvet2z9zcpHTRKy3Q7QCK nreH5Axha96Fb5jYBvV2T7IKGQtUKjbvDDDHzACjgDKAvOwb7sdDsvYTko/dJN/lmoo6 vong== X-Gm-Message-State: AOUpUlE64kfG1YBlctpJfr8n0r+oCv4cPVvh+2zRkF+MWrPa6RNk8btk 53jEL2g0hwGHduJkimID3hgROv/W X-Google-Smtp-Source: AAOMgpcAcMnZzEuNLUF0eh8qKLjF6MRELFofRArWdvcBBtW+ZWWQ7ySfoNL9qx5h8Vu3dGp+xJL30Q== X-Received: by 2002:a62:90d4:: with SMTP id q81-v6mr10484591pfk.37.1532288154885; Sun, 22 Jul 2018 12:35:54 -0700 (PDT) From: Zhang Chen To: qemu-devel@nongnu.org, Paolo Bonzini , Juan Quintela , "Dr . David Alan Gilbert" , Jason Wang , Eric Blake , Markus Armbruster Date: Mon, 23 Jul 2018 03:33:49 +0800 Message-Id: <20180722193350.6028-20-zhangckid@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180722193350.6028-1-zhangckid@gmail.com> References: <20180722193350.6028-1-zhangckid@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::442 Subject: [Qemu-devel] [PATCH V10 19/20] COLO: quick failover process by kick COLO thread X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: zhanghailiang , Li Zhijian , Zhang Chen Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: zhanghailiang COLO thread may sleep at qemu_sem_wait(&s->colo_checkpoint_sem), while failover works begin, It's better to wakeup it to quick the process. Signed-off-by: zhanghailiang Reviewed-by: Dr. David Alan Gilbert --- migration/colo.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/migration/colo.c b/migration/colo.c index 8221a18add..e951159071 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -131,6 +131,11 @@ static void primary_vm_do_failover(void) =20 migrate_set_state(&s->state, MIGRATION_STATUS_COLO, MIGRATION_STATUS_COMPLETED); + /* + * kick COLO thread which might wait at + * qemu_sem_wait(&s->colo_checkpoint_sem). + */ + colo_checkpoint_notify(migrate_get_current()); =20 /* * Wake up COLO thread which may blocked in recv() or send(), @@ -539,6 +544,9 @@ static void colo_process_checkpoint(MigrationState *s) =20 qemu_sem_wait(&s->colo_checkpoint_sem); =20 + if (s->state !=3D MIGRATION_STATUS_COLO) { + goto out; + } ret =3D colo_do_checkpoint_transaction(s, bioc, fb); if (ret < 0) { goto out; --=20 2.17.1