From nobody Wed Jun 26 06:31:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1548184793296933.9926905698898; Tue, 22 Jan 2019 11:19:53 -0800 (PST) Received: from localhost ([127.0.0.1]:47695 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gm1aS-0005h0-4D for importer@patchew.org; Tue, 22 Jan 2019 14:19:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gm14g-0004NB-Dw for qemu-devel@nongnu.org; Tue, 22 Jan 2019 13:47:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gm14e-0005BL-EY for qemu-devel@nongnu.org; Tue, 22 Jan 2019 13:47:02 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:58550 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gm14c-0004FL-BA for qemu-devel@nongnu.org; Tue, 22 Jan 2019 13:46:58 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x0MF5i2d091377 for ; Tue, 22 Jan 2019 10:06:31 -0500 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2q63kq5kf5-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 22 Jan 2019 10:06:29 -0500 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 22 Jan 2019 15:06:11 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 22 Jan 2019 15:06:07 -0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x0MF66LB64225398 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 22 Jan 2019 15:06:06 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 53E2EA405B; Tue, 22 Jan 2019 15:06:06 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2F9AAA4054; Tue, 22 Jan 2019 15:06:05 +0000 (GMT) Received: from dhcp-9-109-245-114.in.ibm.com (unknown [9.124.35.98]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 22 Jan 2019 15:06:05 +0000 (GMT) From: bala24@linux.vnet.ibm.com To: qemu-devel@nongnu.org Date: Tue, 22 Jan 2019 20:35:43 +0530 X-Mailer: git-send-email 2.14.5 In-Reply-To: <20190122150543.16889-1-bala24@linux.vnet.ibm.com> References: <20190122150543.16889-1-bala24@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19012215-0020-0000-0000-00000309DFC3 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19012215-0021-0000-0000-0000215B156A Message-Id: <20190122150543.16889-2-bala24@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-01-22_08:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=5 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901220118 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH 1/1] migration: calculate expected_downtime considering redirtied ram 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: Juan Quintela , Balamuruhan S , dgilbert@redhat.com, peterx@redhat.com, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Balamuruhan S currently we calculate expected_downtime by time taken to transfer remaining ram, but during the time we had transferred remaining ram few pages of ram might be redirtied and we need to retransfer it, so it is better to consider them for calculating expected_downtime for getting more accurate values. Total ram to be transferred =3D remaining ram + (redirtied ram at the time when the remaining ram gets transferred) redirtied ram =3D dirty_pages_rate * time taken to transfer remaining ram redirtied ram =3D dirty_pages_rate * (remaining ram / bandwidth) expected_downtime =3D (remaining ram + redirtied ram) / bandwidth Suggested-by: David Gibson Suggested-by: Dr. David Alan Gilbert Signed-off-by: Balamuruhan S --- migration/migration.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/migration/migration.c b/migration/migration.c index ffc4d9e556..dc38e9a380 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2903,7 +2903,13 @@ 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 =3D ram_counters.remaining / bandwidth; + /* Time required to transfer remaining ram */ + remaining_ram_transfer_time =3D ram_counters.remaining / bandwidth + + /* redirty of ram at the time remaining ram gets transferred*/ + newly_dirtied_ram =3D ram_counters.dirty_pages_rate * remaining_ra= m_transfer_time + + s->expected_downtime =3D (ram_counters.remaining + newly_dirtied_r= am) / bandwidth; } =20 qemu_file_reset_rate_limit(s->to_dst_file); --=20 2.14.5