From nobody Wed Oct 29 17:26:02 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 1524668016541660.7324822751727; Wed, 25 Apr 2018 07:53:36 -0700 (PDT) Received: from localhost ([::1]:37415 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBLnb-0005BU-Nt for importer@patchew.org; Wed, 25 Apr 2018 10:53:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32861) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBLWd-0008E4-2j for qemu-devel@nongnu.org; Wed, 25 Apr 2018 10:36:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBLWb-0007cB-Gs for qemu-devel@nongnu.org; Wed, 25 Apr 2018 10:36:03 -0400 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:36202) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fBLWb-0007bf-Aw for qemu-devel@nongnu.org; Wed, 25 Apr 2018 10:36:01 -0400 Received: by mail-pf0-x242.google.com with SMTP id g14so15397522pfh.3 for ; Wed, 25 Apr 2018 07:36:01 -0700 (PDT) Received: from VM_127_91_centos.localdomain ([119.28.195.137]) by smtp.gmail.com with ESMTPSA id y29sm18244004pff.42.2018.04.25.07.35.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Apr 2018 07:36:00 -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=h0muVa4tgPrnd19U+fsYjX6XPExQlZ7KfFCyM3pqQ50=; b=pOuXHU9R7/eYJRpPUqsA+z6q4H4pKs9apaMH48nGsoWQEkDhrohf92OtJ7WqYP71QO qMIbeYqCf31wjGP/2EGnKhjXbK03RStRo2//aqm+Ffnzrv8nPoKeg4z2MVwJQEeAbUuu I7QD0omUOKrJipTBR1nsOI1XHDg+Cz8oeQGLz3vGu7ZQF/xM4jUBMSOmuTnptw7GJEKo lDM8JewPhjnn+1eW05SVzDDWxgGp/AL0K7+BOBz3Sc8jBHbhfRQeNVo8hvyMCCy8yqqy XcjbUpeTlT2nXloY+B/lSQ/urLvwBTab88Z2/nBoe8baoyOw7HtEzKi/0UL+rNEK3l3T 8fMA== 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=h0muVa4tgPrnd19U+fsYjX6XPExQlZ7KfFCyM3pqQ50=; b=shuB5zl6z5bsfwJ3Oa2DXDoS5oz+txhsn8aYjxQVMrBGx8SAhklol4t2DjB4Ffurqf AAf4Rjqh1a8jJgyczIvRbUJF2ajWAwF1Vqsb1+LhbyToAoG74oQ+N4ofTx81L4G1fVHF erAH5Vd7ok2WVFsrxRB3wHKAb5xH6UQn6FvdfVSHIIBl7OkRiLUDI8fPFouV/aw/a2nb I1kiQVF+i0xQ2RivbZFqGJ1EiVvld183tYD1S4kkkMXo6p6YHyKInAfob5UNAaRSVD6M MXcvnQhnMZCnkh6kUrdS+5FgWu6sV7BfK2S3IvP/5nqxiQURRSkfFOip+qNsqPodC1FM vvrw== X-Gm-Message-State: ALQs6tDB6+GzshQJFnvaqWF9oe2XGFWioUaf/211oYPZDHl8uadYA9eL zAVm7vLWliBD4nYvwh9WI1n8iQ== X-Google-Smtp-Source: AIpwx4+asZP4pTnbZZJzCwVAbGpTgws6AOTyLElh79mYpY/zdZ30GM8wfcLk3/t3pbKPcWVreUaAqw== X-Received: by 2002:a17:902:684c:: with SMTP id f12-v6mr29711859pln.139.1524666960497; Wed, 25 Apr 2018 07:36:00 -0700 (PDT) From: Lidong Chen X-Google-Original-From: Lidong Chen To: quintela@redhat.com, dgilbert@redhat.com Date: Wed, 25 Apr 2018 22:35:30 +0800 Message-Id: <1524666934-8064-2-git-send-email-lidongchen@tencent.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1524666934-8064-1-git-send-email-lidongchen@tencent.com> References: <1524666934-8064-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:c00::242 Subject: [Qemu-devel] [PATCH v2 1/5] migration: disable RDMA WRITE after postcopy started 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: galsha@mellanox.com, adido@mellanox.com, aviadye@mellanox.com, qemu-devel@nongnu.org, licq@mellanox.com, 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" RDMA WRITE operations are performed with no notification to the destination qemu, then the destination qemu can not wakeup. This patch disable RDMA WRI= TE after postcopy started. Signed-off-by: Lidong Chen Reviewed-by: Dr. David Alan Gilbert --- migration/qemu-file.c | 8 ++++++-- migration/rdma.c | 12 ++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/migration/qemu-file.c b/migration/qemu-file.c index bb63c77..add8c3a 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -253,8 +253,12 @@ size_t ram_control_save_page(QEMUFile *f, ram_addr_t b= lock_offset, if (f->hooks && f->hooks->save_page) { int ret =3D f->hooks->save_page(f, f->opaque, block_offset, offset, size, bytes_sent); - f->bytes_xfer +=3D size; - if (ret !=3D RAM_SAVE_CONTROL_DELAYED) { + if (ret !=3D RAM_SAVE_CONTROL_NOT_SUPP) { + f->bytes_xfer +=3D size; + } + + if (ret !=3D RAM_SAVE_CONTROL_DELAYED && + ret !=3D RAM_SAVE_CONTROL_NOT_SUPP) { if (bytes_sent && *bytes_sent > 0) { qemu_update_position(f, *bytes_sent); } else if (ret < 0) { diff --git a/migration/rdma.c b/migration/rdma.c index da474fc..a22be43 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -2927,6 +2927,10 @@ static size_t qemu_rdma_save_page(QEMUFile *f, void = *opaque, =20 CHECK_ERROR_STATE(); =20 + if (migrate_get_current()->state =3D=3D MIGRATION_STATUS_POSTCOPY_ACTI= VE) { + return RAM_SAVE_CONTROL_NOT_SUPP; + } + qemu_fflush(f); =20 if (size > 0) { @@ -3482,6 +3486,10 @@ static int qemu_rdma_registration_start(QEMUFile *f,= void *opaque, =20 CHECK_ERROR_STATE(); =20 + if (migrate_get_current()->state =3D=3D MIGRATION_STATUS_POSTCOPY_ACTI= VE) { + return 0; + } + trace_qemu_rdma_registration_start(flags); qemu_put_be64(f, RAM_SAVE_FLAG_HOOK); qemu_fflush(f); @@ -3504,6 +3512,10 @@ static int qemu_rdma_registration_stop(QEMUFile *f, = void *opaque, =20 CHECK_ERROR_STATE(); =20 + if (migrate_get_current()->state =3D=3D MIGRATION_STATUS_POSTCOPY_ACTI= VE) { + return 0; + } + qemu_fflush(f); ret =3D qemu_rdma_drain_cq(f, rdma); =20 --=20 1.8.3.1