From patchwork Fri Aug 3 09:13:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: 858585 jemmy X-Patchwork-Id: 10554803 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 89EF414E2 for ; Fri, 3 Aug 2018 09:15:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 809C82C0EF for ; Fri, 3 Aug 2018 09:15:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 72BE82C110; Fri, 3 Aug 2018 09:15:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 13D9B2C0EF for ; Fri, 3 Aug 2018 09:15:45 +0000 (UTC) Received: from localhost ([::1]:49748 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1flWBU-0002wN-8R for patchwork-qemu-devel@patchwork.kernel.org; Fri, 03 Aug 2018 05:15:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52833) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1flW9z-0001Sj-7S for qemu-devel@nongnu.org; Fri, 03 Aug 2018 05:14:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1flW9v-0001QH-Vi for qemu-devel@nongnu.org; Fri, 03 Aug 2018 05:14:11 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:34659) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1flW9v-0001Ou-PG for qemu-devel@nongnu.org; Fri, 03 Aug 2018 05:14:07 -0400 Received: by mail-pf1-x444.google.com with SMTP id k19-v6so2936236pfi.1 for ; Fri, 03 Aug 2018 02:14:07 -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=BhTjWSxI5vI0JqfpTA2MCjzO8Oc/jwHf7sGsu2PlpTU=; b=ntwGPjUEC0uruCP+MpFkGLxMYXjD/2VMBoi6uleZpZpM/191ZIqhfoOSprbcq8bB8J 2vUgA2Ey7SziLnZBJWF1W4ca8nY91aoFDWG8vkPscdTUDmpivOIWSTwvU0rAnPh+xtCT s4ZsQkMFcb3g84Npuz081QMIrEUz3WNeesuLF64oo/w6cG8o2ToQX1VPHNk8T0kFLIBP 0cAbjt2JGBJ2Fu8z3MKSWj7V4Jyxx8mfolXnAXvAOCk99RiP0Oqu43hC0SOye7NiNjRD iPienYfo6NuiGssLmeCxg/GVTRCd+7+nQrgIe/UTlimoB47CoWXd7Bqv789AF3BSE0/X jl/A== 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=BhTjWSxI5vI0JqfpTA2MCjzO8Oc/jwHf7sGsu2PlpTU=; b=bkZdb+OeZ3wM0fdUWvwxJx8DhWE+wDzB6a8tpvITnj4RmXOUYYWybVyF22g1I7eNyg h2i8cDYrDYVhs7Yf+5lwgBY9CHwJlFoppT8Y6BP2sJeyDfAoLUykOh5WiA8RlMcfANCK RKDTQz1Bw5ytWaW+V67RW7grmyvamHlDdgxaUqdmCHOeQhuRZU3yWqpmBHS5+AVYlGIx o/VbBWfDaImWRBZPFuc5g9kAq6f5Hp3zcUGRHTHoeW6++XcOdS2GRIAjmg68aw5rGtNj LnSCqB52L+8qI/xTNdOZvueDyAnM0eTv2Si/ZcUTzyKxoPlJ80DR3xIANV9kjb0jkCXd Tz2g== X-Gm-Message-State: AOUpUlHTqMxr3Acf8D1X/RQp+1SZxWiyugTIDlcHKRh0r9X3fbTa27HK 1daes0v6cEG359EnXxaJM+k= X-Google-Smtp-Source: AAOMgpeMVuRVK8jMCceObLCaob1Suc1BA8RIprU/D3RXxmlNSVTFU8tCvop6XT3lRmDBgAGmeCfUmA== X-Received: by 2002:a63:be4a:: with SMTP id g10-v6mr2863595pgo.378.1533287647020; Fri, 03 Aug 2018 02:14:07 -0700 (PDT) Received: from VM_120_46_centos.localdomain ([119.28.87.64]) by smtp.gmail.com with ESMTPSA id e21-v6sm7991352pfl.187.2018.08.03.02.14.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Aug 2018 02:14:06 -0700 (PDT) From: Lidong Chen X-Google-Original-From: Lidong Chen To: zhang.zhanghailiang@huawei.com, quintela@redhat.com, dgilbert@redhat.com Date: Fri, 3 Aug 2018 17:13:43 +0800 Message-Id: <1533287630-4221-6-git-send-email-lidongchen@tencent.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1533287630-4221-1-git-send-email-lidongchen@tencent.com> References: <1533287630-4221-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:4864:20::444 Subject: [Qemu-devel] [PATCH v6 05/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 , qemu-devel@nongnu.org, Lidong Chen Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 a5535fb..cfb0671 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 == MIGRATION_STATUS_ACTIVE) { 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.