From nobody Tue Nov 26 04:25:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1710179662; cv=none; d=zohomail.com; s=zohoarc; b=AnxNfx3f6FDWbmw5jH4JmXdtygmYzguUu3APzwnhCKrDHr/FQywA5xtaVGWN+5K6U1u4+8nW9iFjbn05SFy2cvvDwLNK4xIDdhtiGbi7lvAh5lb2ljA22XdQZdXFTI9paHCj896cNJIp8aMEMz/Mzd/dLvIjVti+88n8nm6iw+A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1710179662; h=Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kPPyuXR3TbfdMvzDMiVFYZPVWKrI1P7MQXcb2jd/PGA=; b=j5FsuZzquXYaHXweGvfaQyvS54BE63NDTjYXdQz81HX/eXZRGMCiK1vBnd6iFvKhTd6vkWvjqDXThlqMwU/F2uiVZn1tx+EYXIem+jnqDFdj7rMbOA+zkO0fR0ZXGenkRpQD4ideL02c8jYRQYR162aB9RrzBI460OfHBZemUK8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1710179662605943.9518820237729; Mon, 11 Mar 2024 10:54:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjjm4-0001zy-Gx; Mon, 11 Mar 2024 13:49:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjjm3-0001z6-1A for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:49:19 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjjm0-0008VJ-Nc for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:49:18 -0400 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 42BG46gw011922; Mon, 11 Mar 2024 17:49:11 GMT Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wre6ec108-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2024 17:49:10 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 42BHhxF0028547; Mon, 11 Mar 2024 17:49:10 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wre76336g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2024 17:49:10 +0000 Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 42BHlHco020033; Mon, 11 Mar 2024 17:49:09 GMT Received: from ca-dev63.us.oracle.com (ca-dev63.us.oracle.com [10.211.8.221]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3wre763302-6; Mon, 11 Mar 2024 17:49:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2023-11-20; bh=kPPyuXR3TbfdMvzDMiVFYZPVWKrI1P7MQXcb2jd/PGA=; b=h83aJwBKCWg+z2/t5GR79gJhVB6BmnUzpfFsAy6J6fxwRKb3rxaqaqU4AS7cHk0AOqSu 3Nw52L8Y01MONK5DxkStj0FqdsyuwpBPtEsh3gRPbycSvtbsNEgO9hPCaoSFlAEFQCy4 B7rmGG49CT3YVS4bXr4W04qrqjlHtU2Yt9X/gu52PkfDptJRlIrFwp+XiNB4QFTQVf5y 8P1chAp42eUDfxZhwoXZkYsJFCRK8d3y1ehmkpYMVvDQed5W9PEhoVKFCoOLQXocNmoV 2EC/DgcIGcNCtqE9NipNznJ8LXkHI4kEWQG3PDkv3ob7Zryd+5LIvIMwqkqy42L1M9wB yg== From: Steve Sistare To: qemu-devel@nongnu.org Cc: Alex Williamson , Cedric Le Goater , "Michael S. Tsirkin" , David Hildenbrand , Peter Xu , Fabiano Rosas , Hailiang Zhang , Zhang Chen , Li Zhijian , Jason Wang , Hyman Huang , Song Gao , Alistair Francis , Steve Sistare Subject: [PATCH V2 05/11] migration: export vcpu_dirty_limit_period Date: Mon, 11 Mar 2024 10:48:52 -0700 Message-Id: <1710179338-294359-6-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1710179338-294359-1-git-send-email-steven.sistare@oracle.com> References: <1710179338-294359-1-git-send-email-steven.sistare@oracle.com> X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-11_10,2024-03-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 adultscore=0 mlxscore=0 phishscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2403110136 X-Proofpoint-GUID: ovxtNXj30D8fbF3Pgmcz7GCtug6p1XtE X-Proofpoint-ORIG-GUID: ovxtNXj30D8fbF3Pgmcz7GCtug6p1XtE Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=205.220.177.32; envelope-from=steven.sistare@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @oracle.com) X-ZM-MESSAGEID: 1710179664620100007 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Define and export vcpu_dirty_limit_period to eliminate a dependency on MigrationState. Signed-off-by: Steve Sistare --- include/migration/client-options.h | 1 + migration/options.c | 7 +++++++ system/dirtylimit.c | 3 +-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/migration/client-options.h b/include/migration/client-= options.h index 887fea1..59f4b55 100644 --- a/include/migration/client-options.h +++ b/include/migration/client-options.h @@ -20,5 +20,6 @@ bool migrate_switchover_ack(void); /* parameters */ =20 MigMode migrate_mode(void); +uint64_t migrate_vcpu_dirty_limit_period(void); =20 #endif diff --git a/migration/options.c b/migration/options.c index 642cfb0..09178c6 100644 --- a/migration/options.c +++ b/migration/options.c @@ -924,6 +924,13 @@ const char *migrate_tls_hostname(void) return s->parameters.tls_hostname; } =20 +uint64_t migrate_vcpu_dirty_limit_period(void) +{ + MigrationState *s =3D migrate_get_current(); + + return s->parameters.x_vcpu_dirty_limit_period; +} + uint64_t migrate_xbzrle_cache_size(void) { MigrationState *s =3D migrate_get_current(); diff --git a/system/dirtylimit.c b/system/dirtylimit.c index 1622bb7..b0afaa0 100644 --- a/system/dirtylimit.c +++ b/system/dirtylimit.c @@ -77,14 +77,13 @@ static bool dirtylimit_quit; =20 static void vcpu_dirty_rate_stat_collect(void) { - MigrationState *s =3D migrate_get_current(); VcpuStat stat; int i =3D 0; int64_t period =3D DIRTYLIMIT_CALC_TIME_MS; =20 if (migrate_dirty_limit() && migration_is_active()) { - period =3D s->parameters.x_vcpu_dirty_limit_period; + period =3D migrate_vcpu_dirty_limit_period(); } =20 /* calculate vcpu dirtyrate */ --=20 1.8.3.1