From patchwork Fri Sep 22 06:56:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elena Ufimtseva X-Patchwork-Id: 13395061 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 3847DE7D0D2 for ; Fri, 22 Sep 2023 06:58:01 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qja5w-0005EE-Ji; Fri, 22 Sep 2023 02:56:57 -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 1qja5j-0005DY-Kc for qemu-devel@nongnu.org; Fri, 22 Sep 2023 02:56:47 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qja5g-0005Bl-1V for qemu-devel@nongnu.org; Fri, 22 Sep 2023 02:56:42 -0400 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38LIsokl008313; Fri, 22 Sep 2023 06:56:36 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=ijUoI21UGwVDXnyq83lnQ2Eo0ySprE9R35vkNC/ce6U=; b=F9Hv60xy0Lctbc3jb0C6NUBW1Ekknva1Zw0mHR/433gk99vYshRB7Vb/rBxaPn9Io5+p y72j94gIYmBVcnTYJNelIY5U0S6n2NJUUXpOkEudsJLADMnZzxsb7Fa6Fv7onHUHYCyH bn04FrWTlyFpuUDiUtp/StS+ydh6hsvjcj/9ffyyB6Q63xrgrFyrFl7eamK4xH3+jUnh kDx9+9DBlNJO8ydABsvqQcXqC1/QzlFlkdZuT2qwa1qsyufTFPETiOaDWALTj9DEN0ua 4WjTRqsebqVkGmGANivYsjMybIK5Cplux6VXb8MO09vsJ9UC1UyQDTd1IhF3RYCOrbiP oQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3t8tsvs210-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Sep 2023 06:56:36 +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 38M5tR1t029722; Fri, 22 Sep 2023 06:56:35 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2109.outbound.protection.outlook.com [104.47.55.109]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3t8uhcbqym-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Sep 2023 06:56:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gS1LXPHapBKlhdkfBO4ZAHirBXZdqMGWCkPBVycEfwwwQ8giVXFUbQzNw1Ca/i4P5U0qfnHz5eJkQDSLl/dLpSSChWkoJgiaKeE39DrhtIs/r4xgSfHX6288ptTUlKX8L4MXqOQ4dN+LfpAf5+ZkgffxgB0edU0UM5fElXwzRo5hMZIuOVfQhKOXDurir74YBiKs8XO4JavCpFNM+oM7tLEVwU3qcGYY4qxaehI6N+3wh7OLpelq+91u75+LeRlF378d/hZKBIeABuOcg8FsO/XQfjn2N/MfKUENugfiUJZaBKENGm3CAboh3tPjNEQ63b5yhzTt4FzMNAQ9FsI8Fg== 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=ijUoI21UGwVDXnyq83lnQ2Eo0ySprE9R35vkNC/ce6U=; b=Ve32Fhgd5K340dC1PtmH6RKg+PtOftoxVV3b0OhXqIp1uNf9jkFIz67MFMDxIbbPkaWYaZomylGb7uFP2nTSaidMLJCegPE6WE0D+AZzZg/EGwhtpSR7jqiACtVOubLMVW33Thml7g3rOkTNsEA79r0jHgiq7cZYRYGs4RbJPmADPw6b9vdxMp13aq4W1Gvq9oN1d6KDRwPUdK4Qd4KzhRuu+xPiKyY6wrEiQF8I8QeYxq7l8cj1KeC/ZauokJynDTBUf5CGDH1cy35sGbf38LdrPDywEwPxc5ypwPLiPEGmPBkGxz6GlFYB+H2Zi56X63E5lT4P9hW180fT6O+LZw== 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=ijUoI21UGwVDXnyq83lnQ2Eo0ySprE9R35vkNC/ce6U=; b=LVdYY3DGbttjZNjfRr39DGOMa6106jsxIzG50RVyk4YeFnjG40tUcGikal8AhSVf2Qg8WKqRAffroWMqGz+XvI5Ew0Koodvpht4Ap3acSsowUl86uakG3LxyR+RE1tjkHT45gfuX3nPLEG0SX4Qnxt0mI09Nggx4tBJACURhwD0= Received: from BYAPR10MB2869.namprd10.prod.outlook.com (2603:10b6:a03:85::17) by IA1PR10MB7419.namprd10.prod.outlook.com (2603:10b6:208:449::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.26; Fri, 22 Sep 2023 06:56:33 +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.6813.017; Fri, 22 Sep 2023 06:56:33 +0000 From: Elena Ufimtseva To: quintela@redhat.com, peterx@redhat.com, leobras@redhat.com Cc: elena.ufimtseva@oracle.com, qemu-devel@nongnu.org Subject: [PATCH 1/4] multifd: wait for channels_ready before sending sync Date: Thu, 21 Sep 2023 23:56:22 -0700 Message-Id: <20230922065625.21848-2-elena.ufimtseva@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230922065625.21848-1-elena.ufimtseva@oracle.com> References: <20230922065625.21848-1-elena.ufimtseva@oracle.com> X-ClientProxiedBy: SJ0PR03CA0140.namprd03.prod.outlook.com (2603:10b6:a03:33c::25) To BYAPR10MB2869.namprd10.prod.outlook.com (2603:10b6:a03:85::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR10MB2869:EE_|IA1PR10MB7419:EE_ X-MS-Office365-Filtering-Correlation-Id: d8d74098-275d-4750-f589-08dbbb390e42 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uyOYslNusgX6nSdPu+upDHpEiz6stmcREH0c8eWrH+hfbyzDGBsgo8kGaRvyp1P78B7dA+lCTPYqx8oSM/fyeZBYs2OQeY/BsHwvvg7C9TCBU0TQ3GsxbivPJKl/bXu2qjcB9gYLBxk+UJO6qY4+9nMVdSKXpkzWikC+lWzw0nnstCbA23s17apCwVCOOQttOgDebTLvHMHBjChJ/3vzhOe857iGQhgAPDS7sWvePytUaP07npyNAd9YCatWqkYSR2c6acS718iUFzUqINxLCZKAb/cC8Hw6kD5mD8o7iubwDfjMUPpFLgbGgXTctkM7KE/dWJFHTxqYoGr1t8igtDw7hXyxq+WKl3cHAcpV4xU8lrfWH2kNo+ob9aF62n+j2+L0Nf3fDDNvjJluzpLq0rLpemaXXVcnGHE9JRvCogPd7uF95A9BtSu/WfL0khsYHN3ULhugNzLYKlCjdNKsoInb6Ig/+AW32WDBqNJhVAVxWj3t731ePbfdGn8JQldiBgSsR62xHDcp0TRbQ9mMd0dDNDnA4CXpMfSiZXHwpL5nS8scmZnNrjm+05i9UXaq 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)(39860400002)(396003)(136003)(346002)(376002)(366004)(186009)(451199024)(1800799009)(478600001)(44832011)(5660300002)(8676002)(8936002)(4326008)(6512007)(6506007)(6486002)(2616005)(1076003)(83380400001)(6666004)(36756003)(316002)(66476007)(66556008)(66946007)(41300700001)(86362001)(2906002)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vBxSrl/Mk3HRQubQrcyaAOR3RcB0TGbs9OGU/dDb6qm3w5t9SoapFomtO1Dy4jnPaSpzYF/iu3VfWtofIrhFy7m/4We1YYOqs2AGj+g0v9zQGYSpAedrsWqqMgUXm4GgFxo+Kg0BPEKeV2Xx2wyydFJFs5gP35OralG7akaaeAMZ1TQ0B63Q1EOcoBZCJCHf3beiQafIJs4oP29THCrKuNn4G4VE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27aup4pN+v2Xunir1IyZcxGbPQD1wKm+3V4n3pnfk1bGJMw71qqSmvRliLqt4b5EFx/bjtvg9kyYpGdF8TVlZwgtGC+8dsk3Uct8QDRVC51eDiTkDgHI5/+l7DDUV/JjEzUCwMaM93V+idbo+JKO6054z+qpmlBdeKlfBOcsKfadaqp8/O8Q== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d8d74098-275d-4750-f589-08dbbb390e42 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB2869.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2023 06:56:33.1551 (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: +OevhbVl8z9Ik1g8Ud7PhXCz5i39CqbpMcPmz+67CvepX0TgYFzIELDxVQhgh5Vk2rMD91dhlzg8UYroLcnVVYJKkSjLAeGU6LgS2f1t+F0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB7419 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-09-22_04,2023-09-21_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 mlxscore=0 bulkscore=0 mlxlogscore=999 phishscore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309220056 X-Proofpoint-ORIG-GUID: 3DRzYZYn_OijL_sB0AaEcl4578Ood0zB X-Proofpoint-GUID: 3DRzYZYn_OijL_sB0AaEcl4578Ood0zB Received-SPF: pass client-ip=205.220.165.32; envelope-from=elena.ufimtseva@oracle.com; helo=mx0a-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 multifd_send_sync_main we need to wait for channels_ready before submitting sync packet as the threads may still be sending their previous pages. There is also no need to check for channels_ready in the loop before the wait for sem_sync, next iteration of sending pages or another sync will start with waiting for channels_ready semaphore. Changes to commit 90b3cec351996dd8ef4eb847ad38607812c5e7f5 ("multifd: Fix the number of channels ready") Signed-off-by: Elena Ufimtseva --- migration/multifd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/multifd.c b/migration/multifd.c index 0f6b203877..e61e458151 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -595,6 +595,7 @@ int multifd_send_sync_main(QEMUFile *f) } } + qemu_sem_wait(&multifd_send_state->channels_ready); /* * When using zero-copy, it's necessary to flush the pages before any of * the pages can be sent again, so we'll make sure the new version of the @@ -630,7 +631,6 @@ int multifd_send_sync_main(QEMUFile *f) for (i = 0; i < migrate_multifd_channels(); i++) { MultiFDSendParams *p = &multifd_send_state->params[i]; - qemu_sem_wait(&multifd_send_state->channels_ready); trace_multifd_send_sync_main_wait(p->id); qemu_sem_wait(&p->sem_sync); From patchwork Fri Sep 22 06:56:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elena Ufimtseva X-Patchwork-Id: 13395062 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 59A1EE7D0D2 for ; Fri, 22 Sep 2023 06:58:24 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qja6C-0005GD-KP; Fri, 22 Sep 2023 02:57:13 -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 1qja5v-0005EN-EW for qemu-devel@nongnu.org; Fri, 22 Sep 2023 02:56:56 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qja5t-0005Cu-Tq for qemu-devel@nongnu.org; Fri, 22 Sep 2023 02:56:55 -0400 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38LIsojr008307; Fri, 22 Sep 2023 06:56:37 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=WHMGOJQneRlx3RNmZ5mnBaIIVv1UhegMFSTP527o31c=; b=j2D8XIuZcfQJwdLGkKPfglJcW0mSJ3EnQTvYRkXlPhxbOoISGYRuifcquG+3SzMUFRbU 5UIR56JG8vZDbfpQPGBi6hc5riZy1E6EXd6SM59+qucFyh1lzX/MyvQZUOLDk/uNNHbU 58zMx6CA4LrF7YjnBsbasqzaPE4618SQnyY9EnkhN3QHnhWmLJMYXUxWh42rUgaJQP3W xZv3KsDs/Rrq2t9nnX/2oerxmQxCausRVU1ZO6zcAKDFHF1SgO9XFwZGWOuAyu0gtut2 S2yAwyp9zsPjbAJjMvabyohozpa7+plmKMuVmcZlolnUvYvdIWJMRQgESC0+FHRqJVrC 4Q== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3t8tsvs212-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Sep 2023 06:56:37 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 38M5GF0h015636; Fri, 22 Sep 2023 06:56:36 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2109.outbound.protection.outlook.com [104.47.55.109]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3t8u0um9kf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Sep 2023 06:56:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W19HiNTAzcuuakP9I13sG1SYyzHu6o9IN4DMa/u1dHsz1xUBNodbQ8JZBFXppstDXLQ/O6/Ej+gIZvyzOFCte7ImfMU4WbKlcybf5tvhKBAkdoUEfdHDVUXiP3NHWOffXD5mYVhuPxE80SMacvn5d21R6hBotfs/O8/2kp7rSNYhqJcRUwRMbDqGRbYF+wWrpctCgGjPEHUASrEr9H2USc0sStW1CSxTpp/d7IxeC16besbKuyK04PrrHiv1fAOAURVZQU8lqcVYL+F3Ujhynz/MVhqkqDYMm3FEMzlliH55BIdAjmm92J/IY7PVpOK5EC1ru3XLLdarF2uephOL/g== 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=WHMGOJQneRlx3RNmZ5mnBaIIVv1UhegMFSTP527o31c=; b=ctMfCH9cOrag1TaHQ9iaojq72NljIChFhBurvyay+rx+azpNwuvLPUiqlUm483nujF0B4Bd4n5IFgapqIXG9U6CplkQyFA1KlGESkzS5NUiOfuD9rNpfqAmmcIPjMbPxSeaPWmTIhccyzGBxpwUYxeHNA9jLszmhKF92IJJMWe1qwLUVNDmX20uSTwy36ol+BIvKhFdqyYQCwWC9wLl6haNWgjxz02aai1VwGWBpJeb9P+CFr7fzUv/7N/dujukaWVy/IovrOw+vcFrrMvgkzBSH/Hy29gHbbBrmoqNTg1g4cKc/AsDl97YPlbc1qUXFsuAKvcA0QNvF42k1Qvi1lg== 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=WHMGOJQneRlx3RNmZ5mnBaIIVv1UhegMFSTP527o31c=; b=Xroi+7Vub13ZhxKlWeUGfkWFVAIthfK0NXIonHf0xfi9/QVklBrMYuUWH1ESiQitM3Ej8iKTGjFdRTvPm/8xNAFXWLSW+6B/jFhz5RvM6lpW/L2VSycefDdPF4hcX9jP5vbJhE4lO/KRWna84h1gWuKvtxJTMwcucc2NJadH6wI= Received: from BYAPR10MB2869.namprd10.prod.outlook.com (2603:10b6:a03:85::17) by IA1PR10MB7419.namprd10.prod.outlook.com (2603:10b6:208:449::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.26; Fri, 22 Sep 2023 06:56:34 +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.6813.017; Fri, 22 Sep 2023 06:56:34 +0000 From: Elena Ufimtseva To: quintela@redhat.com, peterx@redhat.com, leobras@redhat.com Cc: elena.ufimtseva@oracle.com, qemu-devel@nongnu.org Subject: [PATCH 2/4] migration: check for rate_limit_max for RATE_LIMIT_DISABLED Date: Thu, 21 Sep 2023 23:56:23 -0700 Message-Id: <20230922065625.21848-3-elena.ufimtseva@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230922065625.21848-1-elena.ufimtseva@oracle.com> References: <20230922065625.21848-1-elena.ufimtseva@oracle.com> X-ClientProxiedBy: BYAPR11CA0066.namprd11.prod.outlook.com (2603:10b6:a03:80::43) To BYAPR10MB2869.namprd10.prod.outlook.com (2603:10b6:a03:85::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR10MB2869:EE_|IA1PR10MB7419:EE_ X-MS-Office365-Filtering-Correlation-Id: 15007204-9999-401c-482e-08dbbb390f3d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: joC4XW8oLqzfpbtMl29DptNNmIv9szVBOClfQSmKsPytMmbBSWVfQBezM/w8KaF5hZ4X4sa/CWdMY0d7pyen0YfqphJFQbI+XS+ZatvtLLfFKt60X3BzUEZeLH08oaa9VC2NHBmxDN2f7OehxDV2tm4eNw/ICk4IbCnjRkrYuZvZJwtDiDxTNy20R/FDURnzPYM1Y/zkTPGxvBrTGXk5GquA7m7i7gPEmfnTC19YjvzzJ7d9DvK+5tZICg2rVcyBFo7yjxUleNxDCPGTwts4UNtmUqyo503mCLIfHEOphazHuzbLxPlAd3wkf87Vr8QhLYHLd2gLj67IgOBcw6ImQMR1ipRumnmfrzkx+i+Lfvek+7/QM7zNm7BoplIz5rdFQcv5yQs20wThmQb68SuCimWeZHsTBMibt8v/qTrRRlV506xglahdAEuYzHitXicSkqsXWkUs069DPZMB+FI6JboejjRNQy90PISH2GesXKpq+8tCU9m/qoyOPlg8myzWg63DJ6/eqRxTPdyD8qCN6P/elmphyNltcpTf8FQMaeHQejWnQfz78G+1Pm3BoVaW 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)(39860400002)(396003)(136003)(346002)(376002)(366004)(186009)(451199024)(1800799009)(478600001)(44832011)(5660300002)(8676002)(8936002)(4326008)(6512007)(6506007)(6486002)(2616005)(1076003)(83380400001)(6666004)(36756003)(316002)(66476007)(66556008)(66946007)(41300700001)(86362001)(2906002)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: x1J3PcV2Q24VJBbxXxERN4csugXHJMs186uWWtgOxUi2J1qS3UIIznrY9dA/uRsH94fJ1BSrz/4fnnaAyJmPnv6tm6sfLuNvvLFnqjyBC6RPcHbLB8scqCt0kjsCclXtswGUStV5jMS4MvJjspqfAVMzprUeh++oBGZ/8V69jy4DDH42c88D5FbS/qS4A0etmJsaA9ikTzE3UHPS3kzGkkAJ6w/skUsW7dVKxh6Y+nI/0fFU14YhSzI+2Bfa7xWJ2JRcZrVs7fXea4pgaNqup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UfIWfHlkkgTkBkBDDOK8oB4jMBX3GHA9J1lfMuUvm5QYqHc87wi9ZwjVJZnfuP+dIImSI6wR+riZfvX486fZ217xGjKtPrhwND2nKoM34TipFLK6AV6Vfj18/Nsas5CjMovpQohZ/L5QUw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 15007204-9999-401c-482e-08dbbb390f3d X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB2869.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2023 06:56:34.7126 (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: 8WF7Ypm8Awz8n4UXUex86bhybPe724r6vrOb1QxrUO5Y8fKrEOmeTF2tfx8RwG/+E9u8k6DyqupNo2lczWmHs4TdKvfixnlRwLK9aLAKlqw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB7419 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-09-22_04,2023-09-21_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 bulkscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309220056 X-Proofpoint-ORIG-GUID: WOLQtiqkvmZw9oQMi7zK7YGFSsn1FrmA X-Proofpoint-GUID: WOLQtiqkvmZw9oQMi7zK7YGFSsn1FrmA Received-SPF: pass client-ip=205.220.165.32; envelope-from=elena.ufimtseva@oracle.com; helo=mx0a-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. Signed-off-by: Elena Ufimtseva Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu --- migration/migration-stats.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/migration/migration-stats.c b/migration/migration-stats.c index 095d6d75bb..abc31483d5 100644 --- a/migration/migration-stats.c +++ b/migration/migration-stats.c @@ -24,14 +24,14 @@ bool migration_rate_exceeded(QEMUFile *f) return true; } - 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; } + 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; + if (rate_limit_max > 0 && rate_limit_used > rate_limit_max) { return true; } From patchwork Fri Sep 22 06:56:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elena Ufimtseva X-Patchwork-Id: 13395058 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 C8C1EE7D0D6 for ; Fri, 22 Sep 2023 06:57:21 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qja5w-0005EF-R1; Fri, 22 Sep 2023 02:56:58 -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 1qja5l-0005Dg-0y for qemu-devel@nongnu.org; Fri, 22 Sep 2023 02:56:47 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qja5i-0005D4-KO for qemu-devel@nongnu.org; Fri, 22 Sep 2023 02:56:44 -0400 Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38LIsnZg009305; Fri, 22 Sep 2023 06:56:40 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=dStZa1QMiy2ATwKrgdrlnu3LNy3DRG6/zZJmYv3JghQ=; b=1QBqVvV8pJPOVrmWY7PiZynPkT85pprim8ZN8OHms9ibrru9XaPOhVRJKIoXSAq2oU7V gt0R0KFSxmOdVYnWcwqUb5NHPHe5WFHLNgHwtxcZYjATwruFj1ax/wGVyVhog8vf1Z8w M1iJ2O2VNeXHFEHde0s2ogOgp16WTu+poaXaMtRuHWpHbrjcVd0oJl8+5SVLf4xXaHRF Z5xMmkLjOw4j1Ki0OPtDpYg8B8y7oSSx1z0C6JLE0iHgLZf1418iz4zDi/+DC0ADWBke dAGPiDnYkj8Zt+KkZTmoIXpdVVHwNNz0tG3baLxVBwfuFYhop7a98K/zQL+A2S3Z+nZq 0A== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3t8tsxs234-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Sep 2023 06:56:40 +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 38M5OhiC039466; Fri, 22 Sep 2023 06:56:39 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2106.outbound.protection.outlook.com [104.47.55.106]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3t8ty24nwu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Sep 2023 06:56:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gbbB2uQz6XaiQ6SL8iGlf2hzD7Kf6RKvvD/hSNGMq0Afp9bhS19tIUViEO+NJ9BwSNRmcz11eeVTjjQ74il+RBgDCnlZ9hnWKNNd1A2jPyCCIHHJppJR1iw9Q1Mub8EQlWVkg4/1bDi+Lzk+fxzgqfG1YkTM0/a6g9tyISbEw2gJGVkIqtguDnw7eCD0nJV6+2TBIrFWGg+mEceRN/Dgp6uMSXCOkCahQ1jOUNOYcjlkZDrSYa0tWjhvJY8pg2QKBq2Gx3/KUB54zeOfXML2U1oTpOFgEhB2L6lPa3JS9r4Ox2+sRBtGFlSpW6TlwxtvtHkcr7lAf4pZ5RKdaf8dqQ== 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=dStZa1QMiy2ATwKrgdrlnu3LNy3DRG6/zZJmYv3JghQ=; b=MSZYctlMT8zQbbFcJzFixUspDjUwetNytpr1kNjPT1qf3p+Rb6beoQZ3BVkBLRni8oWLCzg+wPX7i8BmyaSTDcOKSsFBGeDj9sOZIoBanrkrACMsakzk6eBetFcChkaSilv31r0umjfBkMZYSTD/qsr8aGTH7IgFo8tG4bJC/WaERPPX4036wqYjEu/Up7QTojjJ1obnHWlEKEyJfIQLNPWFmSGJBufaakPodkVBKXoa9Qr8mZqW+AIQPCrNz5NeybOR5Qc8U33eqBPUJ6bzJr/zXTPRQmBUdZ7lU+0Ug7r/MLjtPZd4PCNMXtCHD/QLWxS6aRjUPWtOsVAu6odFTA== 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=dStZa1QMiy2ATwKrgdrlnu3LNy3DRG6/zZJmYv3JghQ=; b=fzOwh/8XjL/ILceGi3B+UdyOyDaCdjGiVHEBMsSDkrS5JhQ/dpMWs9p1jMpTYY0a+mI8G9iqoWaq+GT2aNeUaiW9Q5sn31QBAUfTjsvxKg1pmlLNrxCJptpl07SVmNK6tru1zVnQfBpXf3CDhDtphLlvL/FfNleCm+nUpZ7RPmM= Received: from BYAPR10MB2869.namprd10.prod.outlook.com (2603:10b6:a03:85::17) by IA1PR10MB7419.namprd10.prod.outlook.com (2603:10b6:208:449::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.26; Fri, 22 Sep 2023 06:56:36 +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.6813.017; Fri, 22 Sep 2023 06:56:36 +0000 From: Elena Ufimtseva To: quintela@redhat.com, peterx@redhat.com, leobras@redhat.com Cc: elena.ufimtseva@oracle.com, qemu-devel@nongnu.org Subject: [PATCH 3/4] multifd: fix counters in multifd_send_thread Date: Thu, 21 Sep 2023 23:56:24 -0700 Message-Id: <20230922065625.21848-4-elena.ufimtseva@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230922065625.21848-1-elena.ufimtseva@oracle.com> References: <20230922065625.21848-1-elena.ufimtseva@oracle.com> X-ClientProxiedBy: SJ0PR03CA0100.namprd03.prod.outlook.com (2603:10b6:a03:333::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_|IA1PR10MB7419:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d472b6b-5102-478c-9ae5-08dbbb391037 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: os/RJIsLXsuHo4J0KO5NBPEwzeCUVYwXYpb9WeeoISeM0K2VnLPpBPSG7C1SxnegqtoZZpXJDm21NGUXiwHiANfLFme9lwLi3F/tq39ZqRJEJManuAr+exJMByVPEX+fr3/ccNZn2wqtDo0CzcvAReULdN77Akywr2B1lWi2lgFjnenxA3CuSVPNWZZ9jbIkwwOR5b/2gN0FTbdVdGEg21zS3ScUmOz9mGHPMxzmqZD8fYM1h7m61iW17kHTJlhfB8DUawMgZ602D37t8FR7L1ZNb1ARvOzM7Qy2gI+dAFSYBHTVPjKwgOxPL5oSa9o1yLQ5ZW8I/hCqZpV+cQrh0mb77n0qXCPvTnEXT0w/0AMse6PquTgvEnOqadI6omP+BNutkPHYYIcKyG6sg2ECfWzDHUoIw329Vj7xKKyeKpSALlHzvozmAuP+mfUPTbDgDQZwqdkZM52WuzQpLhRX6z9y/ENDt769dylkMwPDuQhv4oFF62w2YGc8FK4s0mWXQB2XwJr/SpOy4YBm/TVzvVS61Za8dKkvVu81Y+QAYTc4e0xcuzq9DYoZWctZulYW 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)(39860400002)(396003)(136003)(346002)(376002)(366004)(186009)(451199024)(1800799009)(478600001)(44832011)(5660300002)(8676002)(8936002)(4326008)(6512007)(6506007)(6486002)(2616005)(1076003)(83380400001)(6666004)(36756003)(316002)(66476007)(66556008)(66946007)(41300700001)(86362001)(2906002)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HNLs5vvkb4UC2pUDeGOmsa0iY4Q58LuuBhY6AENQ2KPiAeU9awqkImdkFgF/A9fXa9pKmXXzT5SkLeTxxvgoa4oQfSZ4dnYU6M2Edv7Q/PMOZqN/0VbJnotbrFI8Duh63UO/1Hw2fv0xNUA1ye3b+8y2o8JXoFXCHCs4uYerJbXIdD6EugBefNhxAnBNwUbKuBXdluhI4VopUCu/H2hH4I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CfbFL8LUVD6dIViFgh+u9oPbJ7D+okhNsQrvKUBhncW/vvocNCVIbVfParWpP/bsDxTyhB1ImHm5nrmQ9A28RdSnbleZ/AzIRUwP4iLeYBWWVdFxlgxe1Vxa+YJVFzR28ml9SHMeqmNB6p4xtv2qzy24+Rh4Tg2DwZPny9DlTw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d472b6b-5102-478c-9ae5-08dbbb391037 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB2869.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2023 06:56:36.3905 (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: tPiihVyPPNBBHmfts2whATNxrPJOGPLgcGCjpRGtxZ4jSfpB2ZQbKCDtCZ67cydMZ2lfgNLux7Gk/WPq/5DudTx8pbBr9psbzfqrNwMjGo8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB7419 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-09-22_04,2023-09-21_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 bulkscore=0 malwarescore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309220056 X-Proofpoint-ORIG-GUID: OTPVJO6lWz3zCldIWTlwLNB4a7Mr4Unh X-Proofpoint-GUID: OTPVJO6lWz3zCldIWTlwLNB4a7Mr4Unh Received-SPF: pass client-ip=205.220.165.32; envelope-from=elena.ufimtseva@oracle.com; helo=mx0a-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 --- migration/multifd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/migration/multifd.c b/migration/multifd.c index e61e458151..3281397b18 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 Fri Sep 22 06:56:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elena Ufimtseva X-Patchwork-Id: 13395059 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 1534FE7D0D2 for ; Fri, 22 Sep 2023 06:57:33 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qja67-0005Fs-Ai; Fri, 22 Sep 2023 02:57:07 -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 1qja5l-0005Dh-1I for qemu-devel@nongnu.org; Fri, 22 Sep 2023 02:56:47 -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 1qja5j-0005DA-CP for qemu-devel@nongnu.org; Fri, 22 Sep 2023 02:56:44 -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 38LIsSjq018770; Fri, 22 Sep 2023 06:56:41 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=eUj26dcQwy/mBN06BgEdjhWrgG4dzQlnKi2T6Af6STw=; b=fpMUplLs8ypsKKCCS/UVdwfIJWSaHyuPh09VUmLu4ard42cl49a47klP+WS6lRqHOiyy KON4lZJUfFmUBm1WdoUhf2v1jIWt/VRzzU+IOBLHLu22FcAim7kNi0LjCcxICEZ6O6in aJDK7EUaFfCGc8+a6wZ0MAPBAXN/RD15KTPVW5g4pKNQFSfo8vU0zuBn3vqorinFmy+l esriLCYSz0l8dZNToD/9R8WJp3DhNXSQvoodgEgVLYj7zhnLCAAothzin4/dHHBrNxLE aqBQUsfD8SDRB9QXVTYFs7pmjYo+p4SIL8+VjRPxHqAV8OAK/jaoqIZBAQ7SAl43WiMh OA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3t8tt012ft-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Sep 2023 06:56:41 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 38M66iFF006857; Fri, 22 Sep 2023 06:56:40 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2101.outbound.protection.outlook.com [104.47.55.101]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3t92vwxff3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Sep 2023 06:56:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aGTp/o3Ktah1KdO1lq7JKC/arydB4xSIhcE/JuruuS51y7wiwbqkpUbQbiORfAqcxNU1DxzpKeo9eOH7k4bZe8HFH2cvLliLkkXmj7KkL9jjiDX4uPofw6C7GIOLtyCE3mg1PBGxkO2/lGn8w6Bk/ZQg7nu1YbH5RH2iRDHYedQf1v01bKR5RCzFQqm2jxWVq1QI1iinEo6/DwFvUZA96j16LNEaoI6LAabD+yYwz4tDV3SnQ4oNLtLBa/0hIt519/QIGEnFTIaeFSqKfoaXRTTYcwDyVbPK600MMXoUDLdw5eAMhIhg+GhSXdKhq4kxxZqNP4UOeoJ5rs7Irz4asg== 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=eUj26dcQwy/mBN06BgEdjhWrgG4dzQlnKi2T6Af6STw=; b=JVTxvhIuaC3KjfHzjwV2U6PSQtbUVsID+HYSfmqqMhQ9QXzroN2Tqu5BX9MvMToDLQm/8vfYSU6nstuJJpDSQM85+OggIAtXeMLdwRJ7c29jBWf/ktMaLvzs0gJHjpsJe915cUN+YqJMkXaPJAMlKcXEcGTEmTq7QFZIaD2aM/iEM2AHQMKP8iUsT4ary3aCFVRAT5JkMNzXRZ1piBqEzqD3liD3+85hXfR1eoifCFgLbyim+tgGcx/ADbSVvItk8gS1Kkt7DPREKDBt5iSw8gem2KJCfnV1lwBjmWLd+v3YhqVYdY0CdsEkIhdkcTyDd+TOveBIn5ZbraDcJ6Ka7g== 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=eUj26dcQwy/mBN06BgEdjhWrgG4dzQlnKi2T6Af6STw=; b=NB6BSRK68/iIJMXuPXprg5MDz8SkOw8+1soGFSS+N9gpPEm/EJ6uCqHDzuhoxQLLu/6lQyxSOCNti6/b6o8KAb54imKlFzoXYBer3sykhAI3XSx+bGaf+yw4V62xIDozSq4tuK4RAvHWHm0lgWd/oDxyd5z9W94H11Wehzf1Fkk= Received: from BYAPR10MB2869.namprd10.prod.outlook.com (2603:10b6:a03:85::17) by IA1PR10MB7419.namprd10.prod.outlook.com (2603:10b6:208:449::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.26; Fri, 22 Sep 2023 06:56:38 +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.6813.017; Fri, 22 Sep 2023 06:56:38 +0000 From: Elena Ufimtseva To: quintela@redhat.com, peterx@redhat.com, leobras@redhat.com Cc: elena.ufimtseva@oracle.com, qemu-devel@nongnu.org Subject: [PATCH 4/4] multifd: reset next_packet_len after sending pages Date: Thu, 21 Sep 2023 23:56:25 -0700 Message-Id: <20230922065625.21848-5-elena.ufimtseva@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230922065625.21848-1-elena.ufimtseva@oracle.com> References: <20230922065625.21848-1-elena.ufimtseva@oracle.com> X-ClientProxiedBy: BYAPR04CA0003.namprd04.prod.outlook.com (2603:10b6:a03:40::16) To BYAPR10MB2869.namprd10.prod.outlook.com (2603:10b6:a03:85::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR10MB2869:EE_|IA1PR10MB7419:EE_ X-MS-Office365-Filtering-Correlation-Id: 149027f4-1158-4aa4-4dda-08dbbb391153 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B/n48hsOWk4w5zQPlxJJZjsYhK6StDR/STbWPLCpzFiRsWZZlc7UHEIBW5kvNWVOMpctwygrhRCw+uNKTIAtlswJCkhFIrchUI5jEu/NfeMgjA5wvsrEkT+8yYg6CTfDGajEDgX8/oB0KHcoBa32bLieW7QQ2o9itxaVQAjDATutR5Gcx8WL3ExJ5EE1I5CejgdEaSbDpd7mfLt9WW/XMOXKUUfafJ/i5Giz4HdKTj+s1SEFAHs+c/A5NgG2pApAQjOhY55KT4/XDnZNx70DDVJSOpT7bwyqItG9DdVx6Ismf+0q0rUsoUJIgCwhmomq6756dEZY7De10jrcHJDOBI8rfvGHYdw11Hj15BUn9TrE8E7uG3d0d/GCx7E+12g/lSZtJKhY20JTExPLfoFhqOmub1eqFYHzC1+VsILgt6CyXjuTaqTQ5/X1WHTJ/eczui+H8bmikcZePs5vOigszkVi5EY5vsEEH/Sg5aXzlF1324BsQR6CZ2rU/jGXN+/rmXrJkKeZxxtwV1G34K08W3sSYuLaLYgcWEjjOVkQ4ZJXYoPsGDAc2HdYzRuReZo9 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)(39860400002)(396003)(136003)(346002)(376002)(366004)(186009)(451199024)(1800799009)(478600001)(44832011)(5660300002)(8676002)(8936002)(4326008)(6512007)(6506007)(6486002)(2616005)(1076003)(83380400001)(6666004)(36756003)(316002)(66476007)(66556008)(66946007)(41300700001)(86362001)(2906002)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1nCM3dDo8HIWqK9EfPFTwskTyezfPodbRcAqL7er+m9T3dpiujgiRtD8hUc4NnsB34tDgALI4sJqoAueJ3/PW3nYNMkwCivxcxzYSGZqV2rn5otM8Jc1ZwIdajvv3b7MG+hZCebJVI1XM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3dkaxI4vcugydQQkWKZv3O38POUta7sbhg4WylYsQO4EYL723eycybxfThj7CFXB3vlZXtvDV1O3dEZ5mFvt2UGOs5F9sgj9ZtsJVwMPdpvEtRn2egYsuMPyCls+QWh2FO61dde81XhOTUK3COkEE7FL/xhth9kCshqb8B78H/8xJO5jM4px5CcAfLiYFvE6LgidxBRcJguNlbafQpu5s7jMZ5npH8sLtHY+zLYgLPNeMyLZrK/yfjHg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 149027f4-1158-4aa4-4dda-08dbbb391153 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB2869.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2023 06:56:38.2240 (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: ahK1LxCiRmYWynTPK6zEHuGv8mmkHIUtUQxYPs9vPSQe3NkIxCQ2x3E0xmwl0r/GFHfUjGjqWvw5ykzdLpko3SRnrTAy7kCEqnudVxADFQY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB7419 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-09-22_04,2023-09-21_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 adultscore=0 phishscore=0 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309220056 X-Proofpoint-GUID: jupPJrZP5QiyvAwiw9BBbd67veh85nNc X-Proofpoint-ORIG-GUID: jupPJrZP5QiyvAwiw9BBbd67veh85nNc 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. TODO: Fix the same packet ids in the stream. with this patch, there is still an issue with the duplicated packets ids being sent (with different number of pages/flags). See in below multifd_send trace (before this change): multifd_send 394.774 pid=55477 id=0x1 packet_num=0x6f0 normal=0x57 flags=0x1 next_packet_size=0x57000 multifd_send 181.244 pid=55477 id=0x1 packet_num=0x6f0 normal=0x0 flags=0x0 next_packet_size=0x57000 With this commit there are still duplicated packets, but since no pages are being sent with sync flag set, next_packet_size is 0: multifd_send 27.814 pid=18602 id=0x1 packet_num=0x574 normal=0x7b flags=0x1 next_packet_size=0x7b000 multifd_send 136054.792 pid=18602 id=0x1 packet_num=0x574 normal=0x0 flags=0x0 next_packet_size=0x0 If there is a suggestion how to fix this properly, I will be glad to use it. Signed-off-by: Elena Ufimtseva Reviewed-by: Fabiano Rosas --- migration/multifd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/migration/multifd.c b/migration/multifd.c index 3281397b18..8b4e26051b 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);