From patchwork Sat Mar 31 18:55:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balamuruhan S X-Patchwork-Id: 10319087 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B231F60532 for ; Sun, 1 Apr 2018 07:20:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D65728E9D for ; Sun, 1 Apr 2018 07:20:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B44A28F53; Sun, 1 Apr 2018 07:20:37 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 5468628E9D for ; Sun, 1 Apr 2018 07:20:35 +0000 (UTC) Received: from localhost ([::1]:59007 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2XI1-0006JN-PU for patchwork-qemu-devel@patchwork.kernel.org; Sun, 01 Apr 2018 03:20:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2Lft-0001Mz-6C for qemu-devel@nongnu.org; Sat, 31 Mar 2018 14:56:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f2Lfq-0002zt-0N for qemu-devel@nongnu.org; Sat, 31 Mar 2018 14:56:25 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:35588) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f2Lfp-0002vf-Mb for qemu-devel@nongnu.org; Sat, 31 Mar 2018 14:56:21 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2VIsUfa044799 for ; Sat, 31 Mar 2018 14:56:18 -0400 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0a-001b2d01.pphosted.com with ESMTP id 2h2eu3ssp3-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Sat, 31 Mar 2018 14:56:18 -0400 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 31 Mar 2018 19:56:16 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 31 Mar 2018 19:56:13 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2VIuCaV57868290; Sat, 31 Mar 2018 18:56:12 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 79B6811C052; Sat, 31 Mar 2018 19:48:32 +0100 (BST) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2D59711C054; Sat, 31 Mar 2018 19:48:30 +0100 (BST) Received: from localhost.in.ibm.com (unknown [9.195.36.184]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Sat, 31 Mar 2018 19:48:29 +0100 (BST) From: Balamuruhan S To: qemu-devel@nongnu.org Date: Sun, 1 Apr 2018 00:25:36 +0530 X-Mailer: git-send-email 2.14.3 X-TM-AS-GCONF: 00 x-cbid: 18033118-0012-0000-0000-000005C59016 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18033118-0013-0000-0000-0000194194EF Message-Id: <20180331185536.4835-1-bala24@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-31_08:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803310197 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 X-Mailman-Approved-At: Sun, 01 Apr 2018 03:17:18 -0400 Subject: [Qemu-devel] [PATCH] migration: calculate expected_downtime with ram_bytes_remaining() 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: amit.shah@redhat.com, Balamuruhan S , quintela@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP expected_downtime value is not accurate with dirty_pages_rate * page_size, using ram_bytes_remaining would yeild it correct. Signed-off-by: Balamuruhan S Reviewed-by: Juan Quintela --- migration/migration.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 58bd382730..4e43dc4f92 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2245,8 +2245,7 @@ static void migration_update_counters(MigrationState *s, * recalculate. 10000 is a small enough number for our purposes */ if (ram_counters.dirty_pages_rate && transferred > 10000) { - s->expected_downtime = ram_counters.dirty_pages_rate * - qemu_target_page_size() / bandwidth; + s->expected_downtime = ram_bytes_remaining() / bandwidth; } qemu_file_reset_rate_limit(s->to_dst_file);