From nobody Thu Oct 30 05:09:50 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 1525531366749134.01775501835402; Sat, 5 May 2018 07:42:46 -0700 (PDT) Received: from localhost ([::1]:39061 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEyOb-0004Rq-R2 for importer@patchew.org; Sat, 05 May 2018 10:42:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEyIJ-0008T9-JG for qemu-devel@nongnu.org; Sat, 05 May 2018 10:36:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fEyII-0008GM-Q0 for qemu-devel@nongnu.org; Sat, 05 May 2018 10:36:15 -0400 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]:44958) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fEyII-0008G5-Jd for qemu-devel@nongnu.org; Sat, 05 May 2018 10:36:14 -0400 Received: by mail-pg0-x244.google.com with SMTP id 82-v6so17312447pge.11 for ; Sat, 05 May 2018 07:36:14 -0700 (PDT) Received: from VM_127_91_centos.localdomain ([119.28.195.137]) by smtp.gmail.com with ESMTPSA id n67sm38529640pfh.188.2018.05.05.07.36.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 May 2018 07:36:13 -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=PyWc5EFvCalprNQtF0ueBfM34TbNe8VfPGXTG01pGZ0=; b=OMiON8aB9ufQ3IQipquhy3Qg4qQ7n0tWu7Eq1zAyXiP4nwKDiqDCupz/tYrWwTSjbB n/aEADWKiEHUFTyg2sQH7tBfUCobuRGkeTiQ7BBzRDqNHMkkjMTVv4OLIihKPVPiFgrk g/IeFdkkl1UuXJSASxwkqFUr1fDmA46DTtgMFW8AUuahpdEVvl7/9QQm0jnRbuv00KDL LdoxPVaQqGcJ8SRqmiB+iWRAmP0+F/KqSnfzEohX+782O2rjBlzj+7S8xdSAyvlVPhAJ hPKfzHIT3CMsGD4sdDTBG1kBYuAVTHujTv35y25FI2fLKdKVib+iRqiht+17yUagATal 6zkQ== 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=PyWc5EFvCalprNQtF0ueBfM34TbNe8VfPGXTG01pGZ0=; b=Qq7LaaTociqTlqcM6ki8CjVYLWFoQhG6lKsaAMYt0a+dyfDbDjIU0q0xSNXV8u0tW8 oRWAC+KwjWK2vK023sHVBaK4v3DZz9XLndfwqX9gTPgd25VNFjDtTdTWwTfmmiygz+mL lV3U45+iAIlWUPqXoFK07XIlADKvUptHH4ZyMyeGVYa0syFf01dAN6qEvtUP/O6xHiBy TQMcNRlgo1/jJBLuGTTopqvM4I17mH55xpLDhURSyeNtJkJIQZeHB/mgq5BzXijTuMVj UtfwqHxG5CJ6q+9pOi64lgXizIt6zzIlvH6tSk6XI3KsGdOYIqNz7p49LCeaSTwskbQF v3ww== X-Gm-Message-State: ALQs6tBupJA8s+bi1Q8Nuq4sp1XGMS5ulIogFn/GnLA4ZECApsQ8JJWj 8i97BwGgG+srF8/N6GI+3jQZIQ== X-Google-Smtp-Source: AB8JxZrouq7Mgrhts3K2gbYK+QoBoU2SJgZvKiapo6NQTZ32c64m1Fgk+VNnMfzEmNoQmRo0NN79kw== X-Received: by 2002:a17:902:bb06:: with SMTP id l6-v6mr32016806pls.255.1525530973786; Sat, 05 May 2018 07:36:13 -0700 (PDT) From: Lidong Chen X-Google-Original-From: Lidong Chen To: quintela@redhat.com, dgilbert@redhat.com, berrange@redhat.com Date: Sat, 5 May 2018 22:35:36 +0800 Message-Id: <1525530936-21835-7-git-send-email-lidongchen@tencent.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1525530936-21835-1-git-send-email-lidongchen@tencent.com> References: <1525530936-21835-1-git-send-email-lidongchen@tencent.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::244 Subject: [Qemu-devel] [PATCH v3 6/6] migration: Stop rdma yielding during incoming postcopy 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: adido@mellanox.com, galsha@mellanox.com, aviadye@mellanox.com, qemu-devel@nongnu.org, Lidong 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" During incoming postcopy, the destination qemu will invoke qemu_rdma_wait_comp_channel in a seprate thread. So does not use rdma yield, and poll the completion channel fd instead. Signed-off-by: Lidong Chen Reviewed-by: Dr. David Alan Gilbert --- migration/rdma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/migration/rdma.c b/migration/rdma.c index 854f355..ed9cfb1 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -1490,11 +1490,13 @@ static int qemu_rdma_wait_comp_channel(RDMAContext = *rdma) * Coroutine doesn't start until migration_fd_process_incoming() * so don't yield unless we know we're running inside of a coroutine. */ - if (rdma->migration_started_on_destination) { + if (rdma->migration_started_on_destination && + migration_incoming_get_current()->state =3D=3D MIGRATION_STATUS_AC= TIVE) { yield_until_fd_readable(rdma->comp_channel->fd); } else { /* This is the source side, we're in a separate thread * or destination prior to migration_fd_process_incoming() + * after postcopy, the destination also in a seprate thread. * we can't yield; so we have to poll the fd. * But we need to be able to handle 'cancel' or an error * without hanging forever. --=20 1.8.3.1