From patchwork Wed Oct 11 18:43:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elena Ufimtseva X-Patchwork-Id: 13417726 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 645BCCDB477 for ; Wed, 11 Oct 2023 18:45:05 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqeBw-0006aY-0z; Wed, 11 Oct 2023 14:44:21 -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 1qqeBo-0006Yl-10 for qemu-devel@nongnu.org; Wed, 11 Oct 2023 14:44:12 -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 1qqeBk-0003A5-8l for qemu-devel@nongnu.org; Wed, 11 Oct 2023 14:44:11 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39BI2Mu0006332; Wed, 11 Oct 2023 18:44:05 GMT 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 : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=4t3GGSb4WE4bZgkNUSXmenibCD5Zm11zJqQvifaFiDs=; b=F5ZA3Gtx+9yPiChbqylNVjbh0OPLEAfrgnRBfhVa63p/GU7K+DNKy5QuiY+3DFzuv/km Gh90zKN5zgbqQM7D3WxuvOaqoXVC6gM46hzlPRNX3gGU0LwPRDZa6qiLJszZ1xbOa9ni BSOQ+iZHnu7IKwbxZTKxVnoq+MGVJEL87lz2S2KVOaUcGD5K12N4N75zoYi+09P4rYrd gf13OeAW4aoDPGgmj/ZQKOCyCCUJvjY1cduDuMOBIIBXvzzWRhr0x01aN/aTRyy0k++b pEGZswu9IkuIgqPhTYpgsu9Me42PVtQP+O/Yky+zJAmcPMOvl39tv3Tacn3MrFqV4pFf Yg== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3tjxxu91ay-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Oct 2023 18:44:05 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 39BIETAT018081; Wed, 11 Oct 2023 18:44:04 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2040.outbound.protection.outlook.com [104.47.66.40]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3tjwsesxfn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Oct 2023 18:44:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gL/rS3bTzV+pP8jVklr+nN/CVUHRPQMheABQO5RhiZ1Szevh7WJk9DUHVzzut0AG+R5Enmt3vqx6ZuqJmVjaqCWGYwM7zpfDeW6LNiaycf076pFEmyWkFQ8xELrgyZNddnBnDC2LQnlz0k5J8V1LyqxVvfEm3Gq7InQ9+UzhLSW0yPM/ATxwsaitWfGYkMvP0OUh1h+Lt7IkxvgsxA0VwLmgLUSDATlKGDmvuVV+SmXkHaeVtW1PBX3tBK8dWG7ht1o7UOR3qpDCw7iHmYfdkYwH4eTywIiKx7TPN4fMDmKXC70oiKEy9Ot7HiQTatDDXAQscvhPl/3XYnEjJF3FUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4t3GGSb4WE4bZgkNUSXmenibCD5Zm11zJqQvifaFiDs=; b=bOLk8TrgX8x86ZAgqdpocNoUeew23KPW9eXHeZtW5iRtrwm0DmMQhYFNuF//K1M8ugy/d3MamOlQhRH2fztHxd2tUGGKVvJdaKa6oax+YFV4j84znt+OPKk6DnzvvyRcJtTFo9OoGFY3lbI2oteCj5pcTXUp3rPD6huvlceORX+sa7XfUeFjbmM/h0vllkNQSerbHP7QWL8XVd2ixRe8opfW58ULpk9ji57dSaAdCtkf7R4efFktEWjuRJzkIIHzIsdX1IQKkSFradmaI0UJXr3MIDA18fbnKNL3y4PXbNFp2dfQL9VQIjZEoo+NuAfCJh5umd1iGK7tCMgGKVTjGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4t3GGSb4WE4bZgkNUSXmenibCD5Zm11zJqQvifaFiDs=; b=pJEumhDuQLvRKfig1gg3r5XrXb6CJ6J14m+K+hyoV4JIFLnS4mscZFmzH4cvLsii2umXWzcZMtHkhLxeooUXUOUoKSBOcNASedPx7Iv49BmIXR0LPUDNG8b/oN/EAd7hp8jfSydXyt3TTxkCpQKa/8TCWdX9AhvRrLHmH877Q/U= Received: from BYAPR10MB2869.namprd10.prod.outlook.com (2603:10b6:a03:85::17) by PH7PR10MB7056.namprd10.prod.outlook.com (2603:10b6:510:275::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.43; Wed, 11 Oct 2023 18:44:02 +0000 Received: from BYAPR10MB2869.namprd10.prod.outlook.com ([fe80::427f:78d:bdc0:3798]) by BYAPR10MB2869.namprd10.prod.outlook.com ([fe80::427f:78d:bdc0:3798%4]) with mapi id 15.20.6863.043; Wed, 11 Oct 2023 18:44:02 +0000 From: Elena Ufimtseva To: Cc: quintela@redhat.com, peterx@redhat.com, farosas@suse.de, leobras@redhat.com, qemu-devel@nongnu.org Subject: [PATCH v2 1/4] migration: check for rate_limit_max for RATE_LIMIT_DISABLED Date: Wed, 11 Oct 2023 11:43:55 -0700 Message-Id: <20231011184358.97349-2-elena.ufimtseva@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231011184358.97349-1-elena.ufimtseva@oracle.com> References: <20231011184358.97349-1-elena.ufimtseva@oracle.com> X-ClientProxiedBy: BY5PR20CA0025.namprd20.prod.outlook.com (2603:10b6:a03:1f4::38) To BYAPR10MB2869.namprd10.prod.outlook.com (2603:10b6:a03:85::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR10MB2869:EE_|PH7PR10MB7056:EE_ X-MS-Office365-Filtering-Correlation-Id: 59e07e62-5f5c-496e-ea49-08dbca8a09eb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YfYFzLujDbLOLmLQ9GDGejSf/EToUm6Mrhj8b8f1jGtEdUDKZB+Z/VPTjiaiwMUE1fBzJzSsebwm5/ECacIGGp5hedEqek21W6MHZ7GMvWc7BF/pgPbKfPh8B3JAH/Veaz1g8UALGq+axSkwz57rWlGf9s3t9rHCD59zoEN3EomY8+qUtFYUANcG+6KFAzzPTrF042QBx6cw23rrJTLJJr960e5qt4pjWmIwT9GlJpx+BnkKi6UqJdaoSjTC1/BOUNYvArfmXL0KaxV7HJfsM5OVBokKOxda1xPzk4xONYwMs2NV4cnHeq+Pf17KtL1r9snFmsOSt1xIZww2KmEsLN7esrej70PaP5ZWSl5SyfiBjI7hkg/bnokOoNiRa3Inn1UPgIeUvwcsMGcMd23yjt0ocThXRE6P9FkhUjBC1X0M8DcoEXBwbOtYonjCv4g57t7bguZy7h3EqPPeiEVsKHqBJVW2ik5HkseX33Ep2lU+Kt8P+dAIv16LnKoiBHOSt2vRBhEWQmns06pAdgwS8YJqzvoRIE2Q/fw+bR16OibQdfEKhZdIuehCsX7AEtpmUjbG0nn6JINM3ERO8e1inkEjQhAz2PzO4rYFA+QDQo4= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR10MB2869.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(396003)(346002)(376002)(39860400002)(136003)(230922051799003)(109986022)(451199024)(1800799009)(64100799003)(186009)(4326008)(6666004)(1076003)(8676002)(6512007)(38100700002)(36756003)(86362001)(8936002)(2616005)(6486002)(6506007)(83380400001)(66946007)(478600001)(2906002)(41300700001)(5660300002)(316002)(66476007)(66556008)(44832011)(266003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: G8tCeL6bPhYY98k9yf/iG5Mu4Uqs3woS7ThHrH8XVHe4TOLvAzF/kdNDl0JT1UGe0V8Qd+lg6DQBMPXip1tQZpH3whEaYb3llx9tH7SFs6Orc98+jBlbwKYQ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Gzoujn4tr/8kWtK0AnXsHqUIL2A5kDlxuLwFMJuGhV4kzxvLLdo7XwfofmW6EQPcP9Y+8yCpjSplSLR6Mmch9HhvVGjNsDf/YvKsMFSTQXx6aC66KQj/q9Oxnp7fX0Bl/C3dbVuhBAbQxpwtzAgPzmWBU+x8q2PdMqnz0MS+jMK1NfhBonXA1A1lIlDnfJykpZypwpK2Y4F1v7+FGh1iDhaAsSK7NusT+Ub6zHSCeLSejids9q37nRdB/DWGtsTt/ma47h2g9wbCQ9YTpsryk0SsCVlplOFQmzV55WjeAXrYy8G8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 59e07e62-5f5c-496e-ea49-08dbca8a09eb X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB2869.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2023 18:44:02.5069 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pZe5cwx56WAMedIpD8ejYlul8tIhrpcVMmqaKihleOPR70vUtmnNS8+oougGDMXqJtnNIhCAw8kEE15hXDR+qcJIFGvtMdtgkPHB2m3lKrM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB7056 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-11_13,2023-10-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 suspectscore=0 malwarescore=0 adultscore=0 spamscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310110166 X-Proofpoint-GUID: D4M5pQOQLBdevOzIeSVLjeKJc8GsSnp- X-Proofpoint-ORIG-GUID: D4M5pQOQLBdevOzIeSVLjeKJc8GsSnp- Received-SPF: pass client-ip=205.220.177.32; envelope-from=elena.ufimtseva@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, 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org In migration rate limiting atomic operations are used to read the rate limit variables and transferred bytes and they are expensive. Check first if rate_limit_max is equal to RATE_LIMIT_DISABLED and return false immediately if so. Note that with this patch we will also will stop flushing by not calling qemu_fflush() from migration_transferred_bytes() if the migration rate is not exceeded. This should be fine since migration thread calls in the loop migration_update_counters from migration_rate_limit() that calls the migration_transferred_bytes() and flushes there. Signed-off-by: Elena Ufimtseva Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu Reviewed-by: Juan Quintela --- migration/migration-stats.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/migration/migration-stats.c b/migration/migration-stats.c index 84e11e6dd8..4cc989d975 100644 --- a/migration/migration-stats.c +++ b/migration/migration-stats.c @@ -24,14 +24,15 @@ bool migration_rate_exceeded(QEMUFile *f) return true; } + uint64_t rate_limit_max = migration_rate_get(); + if (rate_limit_max == RATE_LIMIT_DISABLED) { + return false; + } + uint64_t rate_limit_start = stat64_get(&mig_stats.rate_limit_start); uint64_t rate_limit_current = migration_transferred_bytes(f); uint64_t rate_limit_used = rate_limit_current - rate_limit_start; - uint64_t rate_limit_max = stat64_get(&mig_stats.rate_limit_max); - if (rate_limit_max == RATE_LIMIT_DISABLED) { - return false; - } if (rate_limit_max > 0 && rate_limit_used > rate_limit_max) { return true; } From patchwork Wed Oct 11 18:43:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elena Ufimtseva X-Patchwork-Id: 13417730 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 932CECDB475 for ; Wed, 11 Oct 2023 18:45:30 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqeC6-0006fA-D6; Wed, 11 Oct 2023 14:44:30 -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 1qqeBo-0006Yn-8I for qemu-devel@nongnu.org; Wed, 11 Oct 2023 14:44:12 -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 1qqeBl-0003AH-MB for qemu-devel@nongnu.org; Wed, 11 Oct 2023 14:44:11 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39BI2nVq006808; Wed, 11 Oct 2023 18:44:07 GMT 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 : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=UrRT+q2bKjV59WtmU4YTZfafJ+/E5lmosCE5kpJ8INg=; b=uCEE41Df+zWbe2nXUCsj5yGa8Xc0P9ankhd740jQEbzS4eU+h3aEEYZUElz7nwmpdLhz Xb6gtL7QOXBCSglZYnLSBgbxnvah8blUOEU/u+D3wYWc8Za/3i2bec2hvEo5LIO2RBQ2 bBDzvxiOGm1PeRIehshQket6/X3CFvPBr1NnQfPmS/AOeQ+0iwP67NcZR43YjBYHAndf 7vyToLUdTjQG60AFEjBoQHdc+c2H9kbYcEU/87wsqv5bdaSPAFgmJ23AzeDDNj9c6AuY EpQtKtxsaKQgsfMvUktGGdZU8dX+S1li3TxN4etfpTqrSjFnE4lpDWMttC7uC3558sH1 eg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3tjxxu91b2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Oct 2023 18:44:07 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 39BIGtWq002648; Wed, 11 Oct 2023 18:44:06 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2040.outbound.protection.outlook.com [104.47.66.40]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3tjwseffvv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Oct 2023 18:44:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HV2mCEtlGEahkhmvKKtOKIzFxaGqpquG9JVkXntNO7bLQdA5Wwlb7Cam/w6Njue1lN1NcCj26PDR2lrE9+FX2N1VnL610Anyyc6WEN1NpVlApkOA2r8OzmX0lAo42W8Yku9ATx/CmJbJSRacnANRb/V5xx8F9JRV6BWLJs5Avy8lYZk0JwwlPjsV9GeetXHKtKlZBwxuxb6Mg71KHqKS3JbXFB4U06NkpJHu58Pl0xUgMIKQMzFvK9YQoRE/irDrPIvK7qho3vPPZmb88onxl4p+x/AncbsBWrhQG4Jl8lX6KJOYkn/q+Z8WNvTioUFDYUW3VRUFsRMWZJgjDnKbLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=UrRT+q2bKjV59WtmU4YTZfafJ+/E5lmosCE5kpJ8INg=; b=ke6teXctwd/YZ6FPcRjo1e7ivRcNdXhLCHdcDXulWCkJiwW/WjWdnSc/38PfMA4fahc+Z+saGJCYLosdEV8zvOZ8JQeNVam6MeqrrBL/KZOHi9S0+t1r65IdzKhY+BH5Q4uPm/ZSHZdWzq6QDxeV3Vv/6vjUE2H22+CzPspEldgDtTJlaV70ycYGVxX/hV0lRtupa7mZcW4m1xYJTHZuFnSge4vMJVjVOUM9NnT9knJMiLXeALTXqYm3u+rYdYxzLxd3oyokA+J1EpIsZn1DTn2mUhpOnrVyFmptaqa3a0K5tMdl+TLVqETJTXk1oVN6fOawv4A7TK/mPE4F+yzucw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UrRT+q2bKjV59WtmU4YTZfafJ+/E5lmosCE5kpJ8INg=; b=Wd1+hno3bWGV0xqAu3pPNQUQe8InnrW4C+fgpCKGk5yqaX+CxpM4TJoHJLZShgNTXnMgX/bJq7ZfEHHIvGdaG4dE4nDECrbwMTfPAu9nPuVhJ1xEHg4blr2UmiK3Xrk7hNG+D3YA5XIueOZ28OeEaf59oPaNOdcpXmLsHZFjgwo= Received: from BYAPR10MB2869.namprd10.prod.outlook.com (2603:10b6:a03:85::17) by PH7PR10MB7056.namprd10.prod.outlook.com (2603:10b6:510:275::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.43; Wed, 11 Oct 2023 18:44:04 +0000 Received: from BYAPR10MB2869.namprd10.prod.outlook.com ([fe80::427f:78d:bdc0:3798]) by BYAPR10MB2869.namprd10.prod.outlook.com ([fe80::427f:78d:bdc0:3798%4]) with mapi id 15.20.6863.043; Wed, 11 Oct 2023 18:44:04 +0000 From: Elena Ufimtseva To: Cc: quintela@redhat.com, peterx@redhat.com, farosas@suse.de, leobras@redhat.com, qemu-devel@nongnu.org Subject: [PATCH v2 2/4] multifd: document packet_len, next_packet_size Date: Wed, 11 Oct 2023 11:43:56 -0700 Message-Id: <20231011184358.97349-3-elena.ufimtseva@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231011184358.97349-1-elena.ufimtseva@oracle.com> References: <20231011184358.97349-1-elena.ufimtseva@oracle.com> X-ClientProxiedBy: BYAPR07CA0069.namprd07.prod.outlook.com (2603:10b6:a03:60::46) To BYAPR10MB2869.namprd10.prod.outlook.com (2603:10b6:a03:85::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR10MB2869:EE_|PH7PR10MB7056:EE_ X-MS-Office365-Filtering-Correlation-Id: f96bb171-8d47-4c9e-7876-08dbca8a0ae1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F20AReCcUed6vGdqZMuYP6fGKOxZieDrifTRsfY80YsM4rEe8eJIDGdzFE0BAAwuIWQMaTymtJ5REWIZEtDXJl8yPJXCVa3h5hcRk9yznih9oD2gLDo2qpujp77Tic/5WoMj6WAXfS9Nscq70srGVOpKFGY0g+s1iDgzHAnhmkpLwitW59FpSQgGxlBikIXbPaSjNhK/1D7IZG+4BvJgr6BhpifmyxjGWMoLzzTVrc03xWg4TEVmLOWYKRsxTU3ZoqVUCKyARUF+umxk2FFHIVIFKYgVFS6aF+VxzJ+bSU1M3q3AYAeh3G9VJODnOLKWTbaljSwu/uPB2QXNAZxY82UsaC7MKFecDH/+upt5uWbtn+dB/p7GSVnWQwZzllGPR6yeRg/clmgwMUsSPX5tb8I3JkRGvWVsAY0fcgK6PZ0nTZDcHWl/5glFWKA61M+N9hxvWk3C2+ivopAtIVJ0mZoBNY8AHT58YP6uaEj75HA/CQaJZa8uCDHsGB2rM+p9gVQuRUHbSMlBs58Gb42hkLQezXvgLj3YhNWT//jW3/rNytSX1W6iQXXGeQNGRfxtL41I6XVeLj0N12HbosOgpEKx8Fk9cp5lOaShi6Qg8Xw= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR10MB2869.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(396003)(346002)(376002)(39860400002)(136003)(230922051799003)(109986022)(451199024)(1800799009)(64100799003)(186009)(4326008)(6666004)(1076003)(8676002)(6512007)(38100700002)(36756003)(86362001)(8936002)(2616005)(6486002)(6506007)(83380400001)(66946007)(478600001)(2906002)(41300700001)(5660300002)(316002)(66476007)(66556008)(44832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85+N1Gj1uEtjp085NX24/5naIp+3Zl2254QsKelvt+44T3ASKCf2lX9RjGY7Bgtcv0KK9mxeMIMVQ8lp2xlRw70DfTseRXZCJyK4Wj5TJ4joDWHvaxVytxRDZG/IHYuOKhgf9bcOTRCoIwvHPcQMD0HNbqIfiwmzrkZ8nPJ/WHIdw1oYWL6td+H+ws2VNwrf3IEXtYIDyNt3eM1n0M66ym0NOzKYCOiP8wm8Rmui3s6/nOSJ8JttEazqdQ7Um2vL62WWUUtLnfiTCt7Y3gZn8Oz8wilr5JpfW4xzAkgYqIXqYzPoQwVYf07S4FkLW+BWKEmFGycLCC/So1o4N5x368KPBhhZUP4NKmc5qKWnELSkUe4h/27GymlxpZdXAXMdSad0vNCvblTKE+VOMUQhYBtanpfmMe1n+b+0iN6KrlTp1uv90TIaIvNGZuByDvZHz72z3s40xMwM/DzU+W6BIqxwB/qHbJqOobg89FUKjFCbk6Dat14MO1QFU= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f96bb171-8d47-4c9e-7876-08dbca8a0ae1 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB2869.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2023 18:44:04.1167 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 83Bp1QrP4MX3+O8CrK6TRU+jKB8zHL0aNBU+BAo2hN3WaSjPQOuWZycFnvow28hTMZjDVEIPyBkF1wKsuEdECwLa+VQuN3q1hLK6UQMDY/M= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB7056 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-11_13,2023-10-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 spamscore=0 adultscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310110166 X-Proofpoint-GUID: Fswc0CvFBTrlIvgs7sr-anheAzYRFsU6 X-Proofpoint-ORIG-GUID: Fswc0CvFBTrlIvgs7sr-anheAzYRFsU6 Received-SPF: pass client-ip=205.220.177.32; envelope-from=elena.ufimtseva@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, 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org next_packet_size name is a bit misleading, so add more comments where its defined. We send data in two chunks in multifd thread: - send the packet with normal (non-zero) guest pages offsets that are dirty. This uses the packet_len and we increment number of packets for this thread that are sent; - send the normal (non-zero) guest dirty pages themselves in iovs. The total size of the data pointed by all iovs for this chunk is next_packet_size. We do not increment the packet_num for this thread when sending actual pages; When compression is enabled, next_packet_size is used to indicate the size of the compressed buffer on source and destination. Will be it helpful to rename it as data_size or dirty_data_size? Signed-off-by: Elena Ufimtseva --- migration/multifd.h | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/migration/multifd.h b/migration/multifd.h index a835643b48..37da9b68c2 100644 --- a/migration/multifd.h +++ b/migration/multifd.h @@ -45,7 +45,13 @@ typedef struct { uint32_t pages_alloc; /* non zero pages */ uint32_t normal_pages; - /* size of the next packet that contains pages */ + /* + * amount of data to be sent to the destination + * that is calculated as + * - number of the normal guest dirty pages * page_size in non + * compression case; + * - equals of the compressed data size to be received; + */ uint32_t next_packet_size; uint64_t packet_num; uint64_t unused[4]; /* Reserved for future use */ @@ -79,11 +85,18 @@ typedef struct { QIOChannel *c; /* is the yank function registered */ bool registered_yank; - /* packet allocated len */ + /* + * allocated length of a packet to be transferred. + * It has a size of MultiFDPacket struct plus + * the size of the array of guest page offsets (page_count * page_size). + */ uint32_t packet_len; /* guest page size */ uint32_t page_size; - /* number of pages in a full packet */ + /* + * maximum number of dirty pages in a full packet calculated as + * MULTIFD_PACKET_SIZE / qemu_target_page_size() + */ uint32_t page_count; /* multifd flags for sending ram */ int write_flags; @@ -116,7 +129,13 @@ typedef struct { /* pointer to the packet */ MultiFDPacket_t *packet; - /* size of the next packet that contains pages */ + /* + * amount of data to be sent to the destination + * that is calculated as + * - number of the normal guest dirty pages * page_size in non + * compression case; + * - equals of the compressed data size to be received; + */ uint32_t next_packet_size; /* packets sent through this channel */ uint64_t num_packets; @@ -171,7 +190,13 @@ typedef struct { /* pointer to the packet */ MultiFDPacket_t *packet; - /* size of the next packet that contains pages */ + /* + * amount of data to be received by the destination + * that is calculated as + * - number of the normal guest dirty pages * page_size in non + * compression case; + * - equals of the compressed data size to be received; + */ uint32_t next_packet_size; /* packets sent through this channel */ uint64_t num_packets; From patchwork Wed Oct 11 18:43:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elena Ufimtseva X-Patchwork-Id: 13417729 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 48A8BCDB475 for ; Wed, 11 Oct 2023 18:45:15 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqeC5-0006d5-No; Wed, 11 Oct 2023 14:44:29 -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 1qqeBo-0006Yo-8a for qemu-devel@nongnu.org; Wed, 11 Oct 2023 14:44:12 -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 1qqeBm-0003AU-BM for qemu-devel@nongnu.org; Wed, 11 Oct 2023 14:44:11 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39BI2nVs006808; Wed, 11 Oct 2023 18:44:09 GMT 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 : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=VXtfji9+wKfPCsZabGm9pEcVXGh995dIv5q6YZ9ERws=; b=hhaFW4qDOonbvLDzn6rz9TKPfeOpTqmbn/tK3l7yEq0gTGkoCU1Hs3bfgeT1QJ8u7kTM hxKxhLLLp7ezWdUKocakSxzA2YzSaTlzxYSv2R4G/lUawwqiZokWO2fPnzvAR7rN4CCt +JxaKzhSWKkJpvKV1qQ4FhDwmLpeRIxhehsdUk/KWaXRWnL56nedQYLf2lHjM8IYN80K xyoGRQF2SaFqUWR9D3L8O3jvrc+fgd19rhoTLxOTKKpEBYxJ3tF8wpV2lLdlp8lgMzC+ jk5yqlFef5X3LYcpJNevm+6UJItiSajc8YlIVUszZIJ7wWjBdC1CQP/xdmg9QQWL0oRa Vg== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3tjxxu91b6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Oct 2023 18:44:08 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 39BIIcbm018135; Wed, 11 Oct 2023 18:44:08 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2040.outbound.protection.outlook.com [104.47.66.40]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3tjwsesxjk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Oct 2023 18:44:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EbM7+Nfu3kqRq7HPDN+C+On7wvRTxa2g6+t5oRc3eggsiOZNF5PjuSQOrw/nmKfwJeLmMuwNW+3lc3lyulRvdZDcdZ9tFbEJkJ3YqAS2e/x6vUMnDogO4Abt9T+uzUfx8FiCBomtMvv2q4TGgATstLuJ8cvaFDeZ1i3KQRNriDWivSASdQ3BrEYwIN1jmToP5ZRkADZiYxZpC6XMquoOEly2hmRN/iH5ZuxM0NQB+KszmGIn79eSzYrhP3SwuERDdEbKcMWqO/Qp8u1a2OJE9AdyCwpGhUyyuWOemai9OtQmILVbghnZK4rXdqeEQXo1NSjBAndUWC/iA2+IPa7HVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VXtfji9+wKfPCsZabGm9pEcVXGh995dIv5q6YZ9ERws=; b=mUO02L27gPNOuhEgrEA3t7ZbjbR723yZik01oYc1kFHacAejjMQqZtlM49q6CcpncCzTyW+t4VQai8SV++s8ozRjQcKLGhDFfxt9iWdJ0EPuHMS+qVanNyl0x+CPXg0UbMJYiOEKgVk7rZgHOHjmKbdrSG/LwKNKEqhVJhK8hS6xoeK0LtkAU/S2aM/3QZ4Q2dQ/j/PXbtwOkm602QMjLHSSYr2Ux1HfCeQ4n2KGB7z4yWtiKlc8THguNUbk++TdAzpIc3IRNiHvP/SvPmf9qgylgP1s951uYx9LjdBW4NaZPdYsaCNBNw8UxVgQIFXCezsoLB85B3LRGB4AbgFOCg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VXtfji9+wKfPCsZabGm9pEcVXGh995dIv5q6YZ9ERws=; b=gZ0TUO4Y0q7N/kjQ/w/55Pz8H0pBvRD9sYFkyKkprlDZmgV7zNPALvKR8ca7owaYsBBzZmkEyMW0OKI97FajSUxNHRX1pUwS2HAfyaZa690W+x4prHD/TTEkOvZyoGr9OPFBt5D84et3bZTMcYS/c//CUvz13T5AlsfI/y3EMIc= Received: from BYAPR10MB2869.namprd10.prod.outlook.com (2603:10b6:a03:85::17) by PH7PR10MB7056.namprd10.prod.outlook.com (2603:10b6:510:275::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.43; Wed, 11 Oct 2023 18:44:05 +0000 Received: from BYAPR10MB2869.namprd10.prod.outlook.com ([fe80::427f:78d:bdc0:3798]) by BYAPR10MB2869.namprd10.prod.outlook.com ([fe80::427f:78d:bdc0:3798%4]) with mapi id 15.20.6863.043; Wed, 11 Oct 2023 18:44:05 +0000 From: Elena Ufimtseva To: Cc: quintela@redhat.com, peterx@redhat.com, farosas@suse.de, leobras@redhat.com, qemu-devel@nongnu.org Subject: [PATCH v2 3/4] multifd: fix counters in multifd_send_thread Date: Wed, 11 Oct 2023 11:43:57 -0700 Message-Id: <20231011184358.97349-4-elena.ufimtseva@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231011184358.97349-1-elena.ufimtseva@oracle.com> References: <20231011184358.97349-1-elena.ufimtseva@oracle.com> X-ClientProxiedBy: BYAPR05CA0002.namprd05.prod.outlook.com (2603:10b6:a03:c0::15) To BYAPR10MB2869.namprd10.prod.outlook.com (2603:10b6:a03:85::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR10MB2869:EE_|PH7PR10MB7056:EE_ X-MS-Office365-Filtering-Correlation-Id: 53b2f3b3-bc47-496a-dfaf-08dbca8a0bcf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BQPm5f4Eg5qESYlApe8YKriymiEqyX0DDqJBeAhx7wFHLhNUdlBgWaMK+JaasXQ9543WiGl4RS8/KGEYdYBtvlMHEUf+U8zF0z3hFO0xY+MnT6989moDrx+a6hGomoSIfO5trJwJSoPOIi23wAiWGbD8DV+G39eKX1mwPh6oIB9/Y46wp8ErPAc49yRzCst3/xdhpw3MMBu1d6CHBSPeJK/xU3hrGXtdjDzTF8GvQplrByyZOO5vC2TWA0ZUDcfUsh+UfhKDeWwYv914iCD1BGBUHl6usFoxSWnn/1R4ZKCsoVOjt4RG7jvAkb8bBrUKQvRrAGeDyCuw6Yfif57EcS6S83LSn52wcB6ejdYmMJ8U8T8OPERB7LmRuqmUfxgIr3NLXIXfuY1/2/BxibikfD2KT6cysZJCCocPj+DfuCMbENdu/3GKl7luuUcXAfbW9PfR+Q7o0AF+QJihts/i9pVr/uBOcDgfmRASsUedVHUoXTkj1oCLsfqJIG5FPHyQ5JLJBfr1KQLOvUBku2JgcH9fVCfFbS7U7UOZeoqDc2zzQmvw34OtMuVkZfdTJ3taUwcfIG4FBmULpqsc+2AaTjBriRf2rNWWS/cHFAs2a9Y= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR10MB2869.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(396003)(346002)(376002)(39860400002)(136003)(230922051799003)(109986022)(451199024)(1800799009)(64100799003)(186009)(4326008)(6666004)(1076003)(8676002)(6512007)(38100700002)(36756003)(86362001)(8936002)(2616005)(6486002)(6506007)(83380400001)(66946007)(478600001)(2906002)(41300700001)(5660300002)(316002)(66476007)(66556008)(44832011)(266003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GFmdxe1GgngF7t+zm0vlWo1yEsoMYbBdxeWxAkETEIuNmYYI6O4swYD2NCiDdTMInvQX9CXzCcQD9ZoSfPQCE830RMIDf3JdL3uLqI0yvbwbrnB0YMZe/3Tl1UlyTtlAYpigCOX4K9mWXmYgQyb3RtcS68HF5mGS6+XoiNeNZQE5iTBhtghZYZHrso38ywWY3vLQtfMxtdswmyps/mEuRbTs+OMj8gWldpjIC6B5J7UIKEdsgq5NnUyurB0g89BgslQ5GKlaNVLr8wrdakzzmGk1dPFe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ooB/NjZ8yLl4J2R7SBztRHvg8gqNEb+BCDnKKmIxouczmAbHZtcN3EerWhGtMzO4oaCcQr7fymrR8OsaMmH00avhSamfYunajyM2mBBqKw+rSfHFMzESazsnsZ2L4wEB9aZIlb9jKQ= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 53b2f3b3-bc47-496a-dfaf-08dbca8a0bcf X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB2869.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2023 18:44:05.7439 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ymCu4bDIvlwui3P3yQTc8kudwPAyi813n+fl0GNM/rbYymVqTvxRHlEAu75C/LIPzEQ9N9XaTdYDPV06Rhc3nM4mv2Ryrhb+k55E+pXQbp8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB7056 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-11_13,2023-10-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 suspectscore=0 malwarescore=0 adultscore=0 spamscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310110166 X-Proofpoint-GUID: Xirff4Ci1W22XPNt7tyzGTKaNNJHRW38 X-Proofpoint-ORIG-GUID: Xirff4Ci1W22XPNt7tyzGTKaNNJHRW38 Received-SPF: pass client-ip=205.220.177.32; envelope-from=elena.ufimtseva@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, 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Previous commit cbec7eb76879d419e7dbf531ee2506ec0722e825 "migration/multifd: Compute transferred bytes correctly" removed accounting for packet_len in non-rdma case, but the next_packet_size only accounts for pages, not for the header packet (normal_pages * PAGE_SIZE) that is being sent as iov[0]. The packet_len part should be added to account for the size of MultiFDPacket and the array of the offsets. Signed-off-by: Elena Ufimtseva Reviewed-by: Fabiano Rosas Reviewed-by: Juan Quintela --- migration/multifd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/migration/multifd.c b/migration/multifd.c index 0f6b203877..e6e0013c16 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -714,8 +714,6 @@ static void *multifd_send_thread(void *opaque) if (ret != 0) { break; } - stat64_add(&mig_stats.multifd_bytes, p->packet_len); - stat64_add(&mig_stats.transferred, p->packet_len); } else { /* Send header using the same writev call */ p->iov[0].iov_len = p->packet_len; @@ -728,8 +726,10 @@ static void *multifd_send_thread(void *opaque) break; } - stat64_add(&mig_stats.multifd_bytes, p->next_packet_size); - stat64_add(&mig_stats.transferred, p->next_packet_size); + stat64_add(&mig_stats.multifd_bytes, + p->next_packet_size + p->packet_len); + stat64_add(&mig_stats.transferred, + p->next_packet_size + p->packet_len); qemu_mutex_lock(&p->mutex); p->pending_job--; qemu_mutex_unlock(&p->mutex); From patchwork Wed Oct 11 18:43:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elena Ufimtseva X-Patchwork-Id: 13417728 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ABCACCDB477 for ; Wed, 11 Oct 2023 18:45:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqeBs-0006aI-TS; Wed, 11 Oct 2023 14:44:16 -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 1qqeBp-0006ZN-Q4 for qemu-devel@nongnu.org; Wed, 11 Oct 2023 14:44:14 -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 1qqeBo-0003CM-26 for qemu-devel@nongnu.org; Wed, 11 Oct 2023 14:44:13 -0400 Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39BI2pr9017083; Wed, 11 Oct 2023 18:44:11 GMT 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 : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=CtLRbt+75F3pO7Kcc31r9JG+1eL9ah/zDdz26nkC+NI=; b=UFqUrxoytvW4veelBkDMKe6qTNdYJcXK8GOgZijU9HtfUOXZgNcMljQDH1vBBf3d9Did f+LPOlDvNJrmyWbybo0DrXNMcGid6lDORaEI//Q07wQu81wVnVx760RWpDikVrFVLUDJ RlE78NE0R2zwbsuQTD15WgzKei19p16goNQm29y5mrNq9nY1CL6Y51eP9f+k8myLVRnS c2p9a5BOvBMKBCa3U+sL6vbcCUv3rn6mkGlcx7xmHJppQvV+wiJ5/Z4bLG2TE2OppqtX EiXKzzMiGoKBhbFPY8ax8NmCICdbEG76j7z6vB8CJlc80BJCQzcJJkoZNlVeDjSoEvPR 4A== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3tjycds3vt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Oct 2023 18:44:11 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 39BIGue3018050; Wed, 11 Oct 2023 18:44:10 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2040.outbound.protection.outlook.com [104.47.66.40]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3tjwsesxn4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Oct 2023 18:44:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZVKFV2TfAXH59kCg7AZkxSwrGnKfFNl90X9XUA8TvTm3dP8t9Gg/uKPiKG8Ed4QT9JOPXJdv2Cg9Dk/F9SykIN+wAMzv8Gs9KGkxHxUPgPAJAnUtS03/ip+9Y2g5u3GokdfdgUsXDIYMVkWUdlpw1Z4ZnjLxEmuuiLL5nPjp/Y1ZqLwMQDlKPMHqB5TW1iL3MuyRtYdSgc3gRfBFrDQwGAY9arnKobZDD4NY2cFKS0NsyY6n+unoVhq5Nla6tFKSrBLEE6CJr2VukOw+dlDbAMpYgpXK4HAwPylMcJW31SQhG7RarAmY74L72zqZ2EQo3haMiYHz08doDB1S0FTqDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CtLRbt+75F3pO7Kcc31r9JG+1eL9ah/zDdz26nkC+NI=; b=Dd5ZTl4acwLbZGwUo4PMkvOaStGnbTMlCCqgf1ekYtl/FZomXmijf+pAsenrpBIe8Fc9Ee8z+jXkO5yPB2YH7rTOFJGTZivwHKCpdsfk5bOCwuVFsO+a+tSWQHEAVIveWdVrF/i7aBFgbJhM9cjmbuiS85NMN1Teip00SVkroJu0fxkvPEZDzdL3l95OCVA5VVYSoXF6KCRv5dv3HWfpS5EznoK355pK97/86KZoy8N0mTttJZwBVEQDqxMYhlnTpRvYnnV02c3wqo70JO3Chbf8PfOB1Yv5eAFMYQoi/OvgbLx0EO7JZLemK/Xwdjxzz7SXP2xaASVJ6E4BlOsAaQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CtLRbt+75F3pO7Kcc31r9JG+1eL9ah/zDdz26nkC+NI=; b=qSer6bzvZFkRDFS2li5blChu7M5x14JCBpEK7vPLYuT3bUbOqwQrVsuJ/H0j4bBJ+GrmPQxSvMEFcdXaVBYZQpKrxXBn4Ut6wpPvkMwO+XuoRWor8W3lbu6TLvzCbPAPCj5PnffPoBZeczmD+nAFoGHvO0t45559W/xNMSfzgLE= Received: from BYAPR10MB2869.namprd10.prod.outlook.com (2603:10b6:a03:85::17) by PH7PR10MB7056.namprd10.prod.outlook.com (2603:10b6:510:275::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.43; Wed, 11 Oct 2023 18:44:08 +0000 Received: from BYAPR10MB2869.namprd10.prod.outlook.com ([fe80::427f:78d:bdc0:3798]) by BYAPR10MB2869.namprd10.prod.outlook.com ([fe80::427f:78d:bdc0:3798%4]) with mapi id 15.20.6863.043; Wed, 11 Oct 2023 18:44:08 +0000 From: Elena Ufimtseva To: Cc: quintela@redhat.com, peterx@redhat.com, farosas@suse.de, leobras@redhat.com, qemu-devel@nongnu.org Subject: [PATCH v2 4/4] multifd: reset next_packet_len after sending pages Date: Wed, 11 Oct 2023 11:43:58 -0700 Message-Id: <20231011184358.97349-5-elena.ufimtseva@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231011184358.97349-1-elena.ufimtseva@oracle.com> References: <20231011184358.97349-1-elena.ufimtseva@oracle.com> X-ClientProxiedBy: SJ0PR03CA0141.namprd03.prod.outlook.com (2603:10b6:a03:33c::26) To BYAPR10MB2869.namprd10.prod.outlook.com (2603:10b6:a03:85::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR10MB2869:EE_|PH7PR10MB7056:EE_ X-MS-Office365-Filtering-Correlation-Id: cea1e51c-94f6-4706-dad9-08dbca8a0d56 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nB2cwI+BM62ww0wMShC+SHhnMysby1CT4VIf8hJKdJA8IeMlZy/Sk1UWXTlkKhyYMKmdidFMJOeTskpr6VSRTebqiutUJDQf5w75ppSrERojTB+uyNLga/epkqAzTgtGkaKCDqWqXRXoZ+3Q7J5UhZTsMuNXitggzBWuTS66+J3tEik1wekOL2qpN00OCm6EG/fa6RTpGz1P5Lbm5HvK+GHVx8IXogIIKaGtouLklHAL7fLGlQR0x3s4ehFV2LSa/KdsHIJdxzLyo5sqIhiEkFMkvGfY3neQ32vGynoLhgT0ZtaX+ErqI0Mip5n5ikqrwWV+5TJK5sOaO+26FohLdwi/be788K6Nc2FBjfsHHsbXE+MU5gno065cZsfxPTdJJOKxUgF4hOQQqYbXeQHjGxYmM1Rs4pIyPWQm+p6zaa8NegV+Ag6kDYlGE1VxNiK8b4maiI3D5PtEescgBLN3lxkSq8g4k7kOJdVeO/3Zk7qffNOgeaN3zY59GEiS8GdlUCvy+lL7XAGo1bg7o/zM1uRKaF+Lk+wtF7WFaBQSqaJdJaJF/39NusNGFakPpdX4++EuLs/udphd0fpe11kaDw8ETdsy56xqAX3PrZ3octE= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR10MB2869.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(396003)(346002)(376002)(39860400002)(136003)(230922051799003)(109986022)(451199024)(1800799009)(64100799003)(186009)(4326008)(6666004)(1076003)(8676002)(6512007)(38100700002)(36756003)(86362001)(4744005)(8936002)(2616005)(6486002)(6506007)(83380400001)(66946007)(478600001)(2906002)(41300700001)(5660300002)(316002)(66476007)(66556008)(44832011)(266003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1w/VJqBkHDADKAV5pN11Ps45C1FpNE0Q0xHPF6LNG3Q5SGVgtFF3xYfxQ/Txrj+FZj0ic9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ZKKaOGCWHHp3QzBPjAcCBtbT20f6kWd6SREGMSG/BIVjq9zkZa2+/sr0ig+XrFcZe/5t8h024V1bRZojOiGCK1q1F71MdAImXvWPCTUl05kIQtuIdT6JTPaNfTzMJSfCvZ/BhgnBLb+VQYAEDG6BRpGaJMDKAZlGEeCWRt+XLeFohOebOstoQcou2bFTbqsiabgBAK6simrUj76styyB6Zg3vbPEbe+8u3nidUsajjf3+xBpWsOt2lMmrQeQXFT0bRyRlm7Iqdof9F0PJw/cJYPVrfJoyMu8VOvn7KbqWvTIvBeS+ZYqBIYJwvd+XNQvsB9h5kxGgv6tY4g+MRk4olgKYXqD3mnujC7yM= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: cea1e51c-94f6-4706-dad9-08dbca8a0d56 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB2869.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2023 18:44:08.2723 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FI3jm931jbdbtilFKqDrQIsbmCh/yOfEcKP7dyv/2jiNksORlGsLz1lQm0fvJZ0wUznggnJjeQvxzsEZaeN3+rI83/8yjyQRqvY/6M/ORE4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB7056 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-11_13,2023-10-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 suspectscore=0 malwarescore=0 adultscore=0 spamscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310110166 X-Proofpoint-ORIG-GUID: xzY12e389f-_Tb5xzW3oaUX2zCuecOyX X-Proofpoint-GUID: xzY12e389f-_Tb5xzW3oaUX2zCuecOyX Received-SPF: pass client-ip=205.220.177.32; envelope-from=elena.ufimtseva@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, 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sometimes multifd sends just sync packet with no pages (normal_num is 0). In this case the old value is being preserved and being accounted for while only packet_len is being transferred. Reset it to 0 after sending and accounting for. Signed-off-by: Elena Ufimtseva Reviewed-by: Fabiano Rosas Reviewed-by: Juan Quintela --- migration/multifd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/migration/multifd.c b/migration/multifd.c index e6e0013c16..c45f5015f8 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -730,6 +730,7 @@ static void *multifd_send_thread(void *opaque) p->next_packet_size + p->packet_len); stat64_add(&mig_stats.transferred, p->next_packet_size + p->packet_len); + p->next_packet_size = 0; qemu_mutex_lock(&p->mutex); p->pending_job--; qemu_mutex_unlock(&p->mutex);