From nobody Sun Nov 2 11:43:15 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1527673911745682.2281865809612; Wed, 30 May 2018 02:51:51 -0700 (PDT) Received: from localhost ([::1]:37274 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNxlc-0005pJ-9m for importer@patchew.org; Wed, 30 May 2018 05:51:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNxeK-0000SW-Ae for qemu-devel@nongnu.org; Wed, 30 May 2018 05:44:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fNxeJ-0006rI-F7 for qemu-devel@nongnu.org; Wed, 30 May 2018 05:44:08 -0400 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]:33344) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fNxeJ-0006rA-9j for qemu-devel@nongnu.org; Wed, 30 May 2018 05:44:07 -0400 Received: by mail-pg0-x244.google.com with SMTP id e21-v6so7906761pgv.0 for ; Wed, 30 May 2018 02:44:07 -0700 (PDT) Received: from VM_93_245_centos.localdomain ([150.109.57.149]) by smtp.gmail.com with ESMTPSA id 29-v6sm60565257pfj.14.2018.05.30.02.44.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 May 2018 02:44:05 -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=hOvy2JS8aIvKTdzR40q4ec4jdt9nO3bN04jPZoHKiX0=; b=unmsigvRvuO1H7hscdPE4auPpRe9RYV+L6zIjgM6Et4qAGQz0Gx/456yZsZL3FAIn7 QWzXqPrS/7T/JxPBjgNmF01jxWl71I9vdC9GzEf8G3dY7OMyR/pDgKKrb6p9mdpccHe2 jnHDuCZznakQpC5KEHhsZuN+GbXQE8znCk2o0RIwoVrBMIAu4N1FsiR46lEa+/m2mCH0 DCknt+O7HHpFuMj7aqS3Q6NGZ5ydQbCn+ICbi+ZeHZhwwa83F8Utka+qeNKlpqwNNKCj ITuf0N4C54D/c7PLwGIa8Ww9xs7TA5QCTmvi07nSqsCL/djePoX/TDmXs71hHlc/9OqE WNQw== 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=hOvy2JS8aIvKTdzR40q4ec4jdt9nO3bN04jPZoHKiX0=; b=bwuPInsQpcjzIrGHc4TR3eiAjGiFYZBMV3iYN5ij6rhFPNTT8uw8dPuOSQg1nHgV2i GUh2ZV+Lzt8Ixkxu6e9kHhMRxZFk2gT0JamdENBcArx8h/CyxNl5iVwFwKdF0bAAOLLl ZUpLdd80Y0uVCybfrmnt6Yy9jy8xmtvzoLNcoWFTJeGzF/mPhYeM0oYveGKaQmvEg+Mh 4E3KEISbvzX2kPNEtElGXmhZAt1k2rSjwh/LlqjigRmGWqZ/qceC5ArpHK6hto8/OTMi ks5gZoYaArgTMP92ISCoKsJKmiRIhOrS9inEnyRVyEziwgN8Ox9+e5+O2S1tIXcDOvH5 ioLA== X-Gm-Message-State: ALKqPwemL3YC07ewT+qDjsxLbnngUthmYreRbqf+4z/NjCDB+umsarMM jmyNQf0Mg6lb7XUg72eDmPc= X-Google-Smtp-Source: ADUXVKIVKUUw4y6GpGkcBTEVDk+/3Mj+1cKH7NR/OmlOr5VNFRlPpB6t4bOOL2aXea+QW3ePgg5b+Q== X-Received: by 2002:a63:6501:: with SMTP id z1-v6mr1654370pgb.452.1527673446445; Wed, 30 May 2018 02:44:06 -0700 (PDT) From: Lidong Chen X-Google-Original-From: Lidong Chen To: zhang.zhanghailiang@huawei.com, quintela@redhat.com, dgilbert@redhat.com, berrange@redhat.com, aviadye@mellanox.com, pbonzini@redhat.com Date: Wed, 30 May 2018 17:43:30 +0800 Message-Id: <1527673416-31268-7-git-send-email-lidongchen@tencent.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1527673416-31268-1-git-send-email-lidongchen@tencent.com> References: <1527673416-31268-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 v4 06/12] 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: Lidong Chen , adido@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" From: Lidong Chen 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 45f01e6..0dd4033 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -1493,11 +1493,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