From patchwork Tue Dec 21 09:34:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Edmondson X-Patchwork-Id: 12689327 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 976E4C433F5 for ; Tue, 21 Dec 2021 09:37:14 +0000 (UTC) Received: from localhost ([::1]:53938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzba5-0006T1-BY for qemu-devel@archiver.kernel.org; Tue, 21 Dec 2021 04:37:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzbXs-0004x9-Ce for qemu-devel@nongnu.org; Tue, 21 Dec 2021 04:34:56 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:10552) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzbXo-0002Ta-S6 for qemu-devel@nongnu.org; Tue, 21 Dec 2021 04:34:56 -0500 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BL8slwl022350; Tue, 21 Dec 2021 09:34:51 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-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=3eHPIzT/cXCSLa1M/eQK2C/iJ03RlOMSTVwm3foEiOM=; b=ZCUBNx/e4sBvQZI/VJSQ6NC2blDbdNHr+zW0EyhY/A1V5nHsee+HzueUSWdaMeq51g18 pSauK9Vg/osna3cCYQcSf1MQnk0DY8QU7MuyTClwRjrzoPOrS64o02Z09VoEb9Qi6+LG h5jIUU3ditS3RA649Bs3OWL77zLdx2uLEtrS+1lLNrB1FXLyuM1McgtC+CUCe+O60HRn rKIN20BX8PUiGqyZEeIf09t/zTZ2abD2KpF7Od/PG/0GyLA/cvc4OFyEGjRCwHJnz858 39QGFoe9ea6ur0DOndV+KEcyzvj2be4QwnBya8TiimwM3Kn/nya+2ErBcotYMG3kChXt TQ== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3d2rkujmff-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 Dec 2021 09:34:51 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1BL9GwJJ018916; Tue, 21 Dec 2021 09:34:50 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2176.outbound.protection.outlook.com [104.47.59.176]) by userp3030.oracle.com with ESMTP id 3d14rv7dgb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 Dec 2021 09:34:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fkGzd/yb3EzPaKdGn3h0v0vUoGAeSKGA2cCH2rbuMeqahW1JePoQRtakSekqSWfzlxvqI1RKFz0CIVEfA5mQMNkmRxAv5dP1lkxql/XR3Kewd21N1R0P96Q6E8P8JCsNT8UBUGdVQe1emkdcO0B5iBe2fyLVazaJrNuG1mBDguGzjHDun40HdzbYx0OrcP93TZt2AQJ+yREWzZUzCjH3GRSqFe/PL1oiuXGObRSf6wTjstbxu0eZP6ObzB1qxPmL6zku/vVx8riXyTFklnufjNbE8RkxTJTjS56ChMvlddIWMk/imavpaeSeSeJDM93uG8QVXYpCuZYRRe7zmF3iRQ== 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=3eHPIzT/cXCSLa1M/eQK2C/iJ03RlOMSTVwm3foEiOM=; b=gFZx4aX0xU+92hhw2qMIrNp2VYiuzORW/MJlFMVAAQNWvZKfqPgYNSUIyfGxyHvAt+xFXHWwdiQ63cdX/P0K+NWJeAAL0xF7cUhy5MP82AydawVMGrkmvwaFbJpFDvo1FOsnt6UcwG3Q6th/f9JCAm1zbiMo3gSHFPJh4Jm4mK2KtJqN3LjmHjfNKzSLm4P0OSN9TAlACYMWf0Lpu4lpIjIhyGt1w0x+0boQWXqnCzkVxCu5Y6YjG9If/JwQbuL5eLj8G76CKY+3K/HVKIootR6v3sMd0bl4w11igQkJ/ECxHWGEgO/GYpe342TwHKjHb2v+AVH/hYm3YXYTjIvFSw== 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=3eHPIzT/cXCSLa1M/eQK2C/iJ03RlOMSTVwm3foEiOM=; b=r6POFsIsgqFynBSljA9MvMnbW8pmkmtyORRIehhnjWnBucgjwPlolRTQc0OYsvxQYsxApwIIASuCASMZ10iFp4BYZyZudXG3E6EkpZjjhxAwGALlG0r6yXCOVOFpiCf1fPCwHJLPnoWu05iAfVqzIFnjdtW1pLHX9hpeukKPhQU= Received: from DM6PR10MB3148.namprd10.prod.outlook.com (2603:10b6:5:1a4::21) by DM5PR1001MB2267.namprd10.prod.outlook.com (2603:10b6:4:2e::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.19; Tue, 21 Dec 2021 09:34:48 +0000 Received: from DM6PR10MB3148.namprd10.prod.outlook.com ([fe80::c517:d737:a012:1a0e]) by DM6PR10MB3148.namprd10.prod.outlook.com ([fe80::c517:d737:a012:1a0e%6]) with mapi id 15.20.4801.020; Tue, 21 Dec 2021 09:34:48 +0000 From: David Edmondson To: qemu-devel@nongnu.org Subject: [PATCH v3 1/2] migration: Introduce ram_transferred_add() Date: Tue, 21 Dec 2021 09:34:40 +0000 Message-Id: <20211221093441.1445590-2-david.edmondson@oracle.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211221093441.1445590-1-david.edmondson@oracle.com> References: <20211221093441.1445590-1-david.edmondson@oracle.com> X-ClientProxiedBy: LO2P265CA0278.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a1::26) To DM6PR10MB3148.namprd10.prod.outlook.com (2603:10b6:5:1a4::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8a9b8b29-ef9b-451e-9164-08d9c465214e X-MS-TrafficTypeDiagnostic: DM5PR1001MB2267:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2958; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Y7nUNyQAqME0U69JQ2PqQ0Mv36o3EboRWnKuldT3cY1Oys/C5EhWE+gid5j5y633nW7a7TvJrEq/KMFwVvOz9aQMDlnF2Xw4/Z9GujAD5kJX+CxAz6dEAA10L4CN/s/TxazYMOSctlXFea5ZVQVO3RHujS0KRjiXQapAuK9xAbAp+ICbRlcp8J8J0eWwHLQtWm72wZ/058t/vgP7lug5qFM8XYBw4zTPMfg9AVrqpiN9jJDi7Y//G8L5OLLzT4UWyg6baMIJU4v9p9pDAJEaQzKR4WCkzIU6qucP54w1RON25RbbbkWSXvk4hgQOVqzr4/HN6nhBWMmHEpDRbH3GZXThK9ga2bEZU7JOzFO5chcXaeWRwO5xyI3Une9OLv4pE9SGhcVqwycyiYvNi9W//DzOPjdWY9teAj3o9bA8XGU17UMt8N8fDNuYYM9fhovtzHG+VCbYggI1kCMqU3wDpAN3DbsZkZvQJTl22+waM+MTy+jgn1a+0UHseCFv4hmSa4O8TYAUzIQHhk84Ao45q82emozeSpaQvcXPRhFPFMS5Imd4hqLQLLJA54rYCUhMaDLnxIC3V9VOxrVb35mwDCdyQVxJJfHkb2fIjFAgMf+P0UaeZ4ET2lySHv6Y5T4Ivg7vNW92WvzsRUWF8p9BLg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR10MB3148.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(8676002)(52116002)(1076003)(83380400001)(54906003)(6512007)(44832011)(186003)(5660300002)(6486002)(86362001)(38100700002)(36756003)(8936002)(508600001)(66556008)(2616005)(6666004)(6916009)(6506007)(2906002)(316002)(4326008)(66476007)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?od4H56MQb8VQO02rLAvossWuEZ4e?= =?utf-8?q?Wo+nZicFCLaS22kLX9qzkkoROP75em6DP/exO7CnzC25o9qT29HKFksAy6UOhz3zj?= =?utf-8?q?80Z+lOnbfbHYZoXWReQz34QbTd63eYdP9Ii5uOv2OVPH5lXmrv1ba0rYlqR0bVbTA?= =?utf-8?q?L/P11JgBf6wItN4Rik52aIYLtfGJgJvLdhPeCsmbU2izq595zbwi39HXq1RxSwFVP?= =?utf-8?q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3Ju72Ptv7ZYrawRkO/7NESrvDLHn2U9mab5fP6LMfdez0d6nwRg/x?= =?utf-8?q?B6JQZ8cHwi++gr2uDWJ/KNgaKHK6djERns/gDmqUoG934cqC+BksWphhRhyrpanin?= =?utf-8?q?11VGC7Nt8JeADI1bx0R01e3qBgRacGCp1/uH9GQHg/S88yUTvZ/n1zaexKDNT05JO?= =?utf-8?q?WHY6re2AMywMVJ/YDojPwiRfly4vD+fFvYQux3n88TqZ7g8UOgqzzTPearKP0X+FW?= =?utf-8?q?iy6VO5sKIQHu7EzdR0v7GuMW8PncYHf4tw7+Fk4Ov02hC1d8hyUhD/kUWdok0Jj/2?= =?utf-8?q?pvgU7Of0FnY8Hiv3qpom0QybdZkNPnA0/5QionfsnQStuePgFmvxNXDVMV/Moim6y?= =?utf-8?q?jcopCtmGhY8pV15Q787aTsoeWEi3f0lhwIoh9LIokuR55nN6uTx7AAE1jqTTxGFtM?= =?utf-8?q?MJWA9XDZJAK4gCIXvMWp12NWrrPGu+41NBQeGyc3nYm8SSsKzQNmvd7m1zuON8fXE?= =?utf-8?q?6lWiOFKf6ucMKSuWn9NsD+dmNBXFhp/vjSHKYGUhmO/gR+d220MT5bSyU/7ygJpSW?= =?utf-8?q?HWaVnzDxyy?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a9b8b29-ef9b-451e-9164-08d9c465214e X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB3148.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2021 09:34:48.1312 (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: HxQXCyr96XH/z2Xp5VyGRXBDZj3s2qD0cUIKUq49HJmCSEhLumnjFKrfxnzEOJxcxLtgG7IZNsTfDHqmBsMcSQ7Rq0K8ypayggIb/IlXaeU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1001MB2267 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10204 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112210041 X-Proofpoint-ORIG-GUID: jkOiKS1icsaone8YakJcqOj63J98PfMI X-Proofpoint-GUID: jkOiKS1icsaone8YakJcqOj63J98PfMI Received-SPF: pass client-ip=205.220.177.32; envelope-from=david.edmondson@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_H2=-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: , Cc: Juan Quintela , Eric Blake , Markus Armbruster , "Dr. David Alan Gilbert" , David Edmondson , =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Replace direct manipulation of ram_counters.transferred with a function. Signed-off-by: David Edmondson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Juan Quintela --- migration/ram.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 57efa67f20..bd53e50a7f 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -386,6 +386,11 @@ uint64_t ram_bytes_remaining(void) MigrationStats ram_counters; +static void ram_transferred_add(uint64_t bytes) +{ + ram_counters.transferred += bytes; +} + /* used by the search for pages to send */ struct PageSearchStatus { /* Current block being searched */ @@ -767,7 +772,7 @@ static int save_xbzrle_page(RAMState *rs, uint8_t **current_data, * RAM_SAVE_FLAG_CONTINUE. */ xbzrle_counters.bytes += bytes_xbzrle - 8; - ram_counters.transferred += bytes_xbzrle; + ram_transferred_add(bytes_xbzrle); return 1; } @@ -1198,7 +1203,7 @@ static int save_zero_page(RAMState *rs, RAMBlock *block, ram_addr_t offset) if (len) { ram_counters.duplicate++; - ram_counters.transferred += len; + ram_transferred_add(len); return 1; } return -1; @@ -1234,7 +1239,7 @@ static bool control_save_page(RAMState *rs, RAMBlock *block, ram_addr_t offset, } if (bytes_xmit) { - ram_counters.transferred += bytes_xmit; + ram_transferred_add(bytes_xmit); *pages = 1; } @@ -1265,8 +1270,8 @@ static bool control_save_page(RAMState *rs, RAMBlock *block, ram_addr_t offset, static int save_normal_page(RAMState *rs, RAMBlock *block, ram_addr_t offset, uint8_t *buf, bool async) { - ram_counters.transferred += save_page_header(rs, rs->f, block, - offset | RAM_SAVE_FLAG_PAGE); + ram_transferred_add(save_page_header(rs, rs->f, block, + offset | RAM_SAVE_FLAG_PAGE)); if (async) { qemu_put_buffer_async(rs->f, buf, TARGET_PAGE_SIZE, migrate_release_ram() & @@ -1274,7 +1279,7 @@ static int save_normal_page(RAMState *rs, RAMBlock *block, ram_addr_t offset, } else { qemu_put_buffer(rs->f, buf, TARGET_PAGE_SIZE); } - ram_counters.transferred += TARGET_PAGE_SIZE; + ram_transferred_add(TARGET_PAGE_SIZE); ram_counters.normal++; return 1; } @@ -1373,7 +1378,7 @@ exit: static void update_compress_thread_counts(const CompressParam *param, int bytes_xmit) { - ram_counters.transferred += bytes_xmit; + ram_transferred_add(bytes_xmit); if (param->zero_page) { ram_counters.duplicate++; @@ -2298,7 +2303,7 @@ void acct_update_position(QEMUFile *f, size_t size, bool zero) ram_counters.duplicate += pages; } else { ram_counters.normal += pages; - ram_counters.transferred += size; + ram_transferred_add(size); qemu_update_position(f, size); } } @@ -3133,7 +3138,7 @@ out: multifd_send_sync_main(rs->f); qemu_put_be64(f, RAM_SAVE_FLAG_EOS); qemu_fflush(f); - ram_counters.transferred += 8; + ram_transferred_add(8); ret = qemu_file_get_error(f); } From patchwork Tue Dec 21 09:34:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Edmondson X-Patchwork-Id: 12689329 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 B7605C433EF for ; Tue, 21 Dec 2021 09:39:40 +0000 (UTC) Received: from localhost ([::1]:60418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzbcR-0002Lj-OT for qemu-devel@archiver.kernel.org; Tue, 21 Dec 2021 04:39:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzbXr-0004wt-5u for qemu-devel@nongnu.org; Tue, 21 Dec 2021 04:34:55 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:11262) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzbXp-0002Tf-FF for qemu-devel@nongnu.org; Tue, 21 Dec 2021 04:34:54 -0500 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BL9Gw7f022358; Tue, 21 Dec 2021 09:34:52 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-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=yAuKOx5BHeoH/JWNSTQFJCK6ksl1PeDf0XWAt24zXTs=; b=rRUhIhMHsor9VjLbWsg8hBf6F8kHIhczk3DD8HPLOjPYuux35Zp0Ta1GH146+NRF+KQo VC9wF+t0bsm/zTZuTvsK4R577cn74t5WyAml6xb7ChpinHhJRQH0rY4sswa9Q5XrB+St RBs+vhZOWe2Hh2b/Yf7r5upoobwm0Ve38Xt4iBVlpXIQQgwEXBw3fzISP/EBSYbr50VU FDSwJTKamKz9ab9lRtgVUnL8PoWm/78QQXFQVE2D/UcRiejm66Irtt9bJ+dXoIulJWIG 2ZrP+D8+yJxznJZd3ROP0U8pXXIFtue4f35IjHtVTQo8SGPjW0ETXKJ5Dl9c+cR5aE4T Qw== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3d2rkujmfh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 Dec 2021 09:34:51 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1BL9GwJK018916; Tue, 21 Dec 2021 09:34:50 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2176.outbound.protection.outlook.com [104.47.59.176]) by userp3030.oracle.com with ESMTP id 3d14rv7dgb-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 Dec 2021 09:34:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SXvlVPXt5DxVjfTNNC7v5Xr/iDXIqRPPkrHkSVbWvOUDUQfS0kTvDb+EkRc6CvGbrBoIycbnQZ7BWGZ3crcd7s8v0S5qnahnaa+1jrp6RbTJx5fz6ix9UNz4N6pLwjvZkrzOPKHlvFR8Vnhvda8c/D9dPGUITNNZF5eIk7Vr4TeeI+lzI9kZ1kA9z42YA8IKIiaaPXFrJJ2wB/uhCBwYj0oXAg/+75akcIRu6PSsiY8vDWk/kanqt6deD4fMGx8XNgCEOGjpavWkY7H/pBdCO24DU9iPnqtmzDWcl5sqO/EUn4B5bGS5j6nNW8jPjIAPN+EOJjnSbifqg5CXnwN2sw== 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=yAuKOx5BHeoH/JWNSTQFJCK6ksl1PeDf0XWAt24zXTs=; b=dquG7ClZt2jtwdkuOw0RKlplm6VBvV/YnUjG5RJ434VN9bV8T8mUAurLkPZ8DeE3kJebw3vaBKvkrpDrbqjBcxCtFyfypqQbBujazHxljFBdcHshotxpqqG+ASttmiKa4Mbfk0/8FaM8wTpc8jJlePCyNSsYUTQjmE2D7iXJqVkq2mSn/pPXt+FJMqn76xYjBuGPezIXcHbopaz1KrNZelIHXsHIeXoThdi45HISPA2PQcnoTZCWO7VpxHYGVR01Bt8zeARLgiKlkzYZG4p4ggqEOjosATgjdYL5yqj21vOB+EwFNazsqUfg9gyUoGKDDA8OobEYgxcIDjilP3rAng== 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=yAuKOx5BHeoH/JWNSTQFJCK6ksl1PeDf0XWAt24zXTs=; b=qxa3fI40npv9JH/FRHb2D/4wTJPvYj4eiMXtLHLHcFgn/Bl2GN6jRV/ehbmQEfeUaqt5DpGOgkNVO14mPv1nLiDR4NbrFno6U9oST5jjdeJP89Sa/rsqlsrDEABNkkkCY8hfjATjAXGpodecEabeL3Md1zbtuTgtFgcMHQZZUHM= Received: from DM6PR10MB3148.namprd10.prod.outlook.com (2603:10b6:5:1a4::21) by DM5PR1001MB2267.namprd10.prod.outlook.com (2603:10b6:4:2e::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.19; Tue, 21 Dec 2021 09:34:49 +0000 Received: from DM6PR10MB3148.namprd10.prod.outlook.com ([fe80::c517:d737:a012:1a0e]) by DM6PR10MB3148.namprd10.prod.outlook.com ([fe80::c517:d737:a012:1a0e%6]) with mapi id 15.20.4801.020; Tue, 21 Dec 2021 09:34:49 +0000 From: David Edmondson To: qemu-devel@nongnu.org Subject: [PATCH v3 2/2] migration: Tally pre-copy, downtime and post-copy bytes independently Date: Tue, 21 Dec 2021 09:34:41 +0000 Message-Id: <20211221093441.1445590-3-david.edmondson@oracle.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211221093441.1445590-1-david.edmondson@oracle.com> References: <20211221093441.1445590-1-david.edmondson@oracle.com> X-ClientProxiedBy: LO4P123CA0122.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:192::19) To DM6PR10MB3148.namprd10.prod.outlook.com (2603:10b6:5:1a4::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f2783450-89fe-45a4-bb97-08d9c46521d8 X-MS-TrafficTypeDiagnostic: DM5PR1001MB2267:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:261; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fgqmBWpfR/Ia3wqLs3kC39c9oHAB0FzOBEQ7JSIba/jCTJM7VN5PDdHaGYFhWh9zymH+NyQ33jDmupFNnLyJ80kfAIdsg11HesVx1hbhjVV0slAcP0sclficvyMtSQVwvScjcGZdwp4qfb10UpBZhUJI0MLA0TZJfw0SNwEuxhKdK0SEnCkZsW7SRlMXsh8TzeeeB5SYI/0mY91IoopCUSBCnxbYz8DHunbjHvxCA/w71s3gm8EWqReHBc4HnRAwsedmkaR+jY5fzmn85AwvxzT5YzTKESOtXoWoR94HYNwnQQ12TRrDB1gw+GKfhkl9v1fhbwuzSLBMDvXBlR7HOz/juTZRSQIpbmhKjXFmZas02cAuPkF6gWtpaIE1ghxTINeeOw19b8hkfqB2ApTWxDO+tghqkLCglKSLLqOFb7tQ5Vs/2eQ+hhykI4XpWvjvbSUrGK24aoLwPkw1e5+1ltD/5g9/kLJMsmEeWZQO5ePDpChVaVPaZj2mL+nxR4LfDSBopsTPAvElte1u4q1IeWemRDErPdpOWW3H1FNk0h3WSvOnUqf02eRtgNsucBY6GepZYTKoL77+4+WI7RZFh7rZSy2SLs2RqqYQHr/jLcgkYvX66U1MEtgibNwqlSA/+SucsjY1LSat3VAWU0gx/w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR10MB3148.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(8676002)(52116002)(1076003)(83380400001)(54906003)(6512007)(44832011)(186003)(5660300002)(6486002)(86362001)(38100700002)(36756003)(8936002)(508600001)(66556008)(2616005)(6666004)(6916009)(6506007)(2906002)(316002)(4326008)(66476007)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X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-bb97-08d9c46521d8 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB3148.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2021 09:34:49.0767 (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: vti/bD8cPuipfyn4cyuXyPLbUc8CczXJebsP8X31O+8VQg+k+BnE4wkkyWqkRrh/ZWgWI6W/5tdzExKzW0d6i0/4aLqFwpByC+1D9L4/cDA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1001MB2267 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10204 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112210041 X-Proofpoint-ORIG-GUID: iYID7rXeMaFDScadoq8fsvc-g4SST8th X-Proofpoint-GUID: iYID7rXeMaFDScadoq8fsvc-g4SST8th Received-SPF: pass client-ip=205.220.177.32; envelope-from=david.edmondson@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_H2=-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: , Cc: Juan Quintela , Eric Blake , Markus Armbruster , "Dr. David Alan Gilbert" , David Edmondson , =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Provide information on the number of bytes copied in the pre-copy, downtime and post-copy phases of migration. Signed-off-by: David Edmondson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Juan Quintela --- migration/migration.c | 3 +++ migration/ram.c | 7 +++++++ monitor/hmp-cmds.c | 12 ++++++++++++ qapi/migration.json | 13 ++++++++++++- 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/migration/migration.c b/migration/migration.c index 3de11ae921..3950510be7 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1013,6 +1013,9 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s) info->ram->page_size = page_size; info->ram->multifd_bytes = ram_counters.multifd_bytes; info->ram->pages_per_second = s->pages_per_second; + info->ram->precopy_bytes = ram_counters.precopy_bytes; + info->ram->downtime_bytes = ram_counters.downtime_bytes; + info->ram->postcopy_bytes = ram_counters.postcopy_bytes; if (migrate_use_xbzrle()) { info->has_xbzrle_cache = true; diff --git a/migration/ram.c b/migration/ram.c index bd53e50a7f..389868c988 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -388,6 +388,13 @@ MigrationStats ram_counters; static void ram_transferred_add(uint64_t bytes) { + if (runstate_is_running()) { + ram_counters.precopy_bytes += bytes; + } else if (migration_in_postcopy()) { + ram_counters.postcopy_bytes += bytes; + } else { + ram_counters.downtime_bytes += bytes; + } ram_counters.transferred += bytes; } diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index 9c91bf93e9..6049772178 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -293,6 +293,18 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict) monitor_printf(mon, "postcopy request count: %" PRIu64 "\n", info->ram->postcopy_requests); } + if (info->ram->precopy_bytes) { + monitor_printf(mon, "precopy ram: %" PRIu64 " kbytes\n", + info->ram->precopy_bytes >> 10); + } + if (info->ram->downtime_bytes) { + monitor_printf(mon, "downtime ram: %" PRIu64 " kbytes\n", + info->ram->downtime_bytes >> 10); + } + if (info->ram->postcopy_bytes) { + monitor_printf(mon, "postcopy ram: %" PRIu64 " kbytes\n", + info->ram->postcopy_bytes >> 10); + } } if (info->has_disk) { diff --git a/qapi/migration.json b/qapi/migration.json index bbfd48cf0b..5975a0e104 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -46,6 +46,15 @@ # @pages-per-second: the number of memory pages transferred per second # (Since 4.0) # +# @precopy-bytes: The number of bytes sent in the pre-copy phase +# (since 7.0). +# +# @downtime-bytes: The number of bytes sent while the guest is paused +# (since 7.0). +# +# @postcopy-bytes: The number of bytes sent during the post-copy phase +# (since 7.0). +# # Since: 0.14 ## { 'struct': 'MigrationStats', @@ -54,7 +63,9 @@ 'normal-bytes': 'int', 'dirty-pages-rate' : 'int', 'mbps' : 'number', 'dirty-sync-count' : 'int', 'postcopy-requests' : 'int', 'page-size' : 'int', - 'multifd-bytes' : 'uint64', 'pages-per-second' : 'uint64' } } + 'multifd-bytes' : 'uint64', 'pages-per-second' : 'uint64', + 'precopy-bytes' : 'uint64', 'downtime-bytes' : 'uint64', + 'postcopy-bytes' : 'uint64' } } ## # @XBZRLECacheStats: