From mboxrd@z Thu Jan 1 00:00:00 1970 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 E1709C0015E for ; Fri, 28 Jul 2023 11:50:49 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qPLy1-0000eX-EV; Fri, 28 Jul 2023 07:49:09 -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 1qPLxo-0000dI-Qw; Fri, 28 Jul 2023 07:48:56 -0400 Received: from proxmox-new.maurer-it.com ([94.136.29.106]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qPLxn-0003sC-1a; Fri, 28 Jul 2023 07:48:56 -0400 Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 559DD41935; Fri, 28 Jul 2023 13:48:29 +0200 (CEST) Message-ID: <8b7788bb-e7d6-ff54-2452-655891ac4e3f@proxmox.com> Date: Fri, 28 Jul 2023 13:48:21 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PULL 09/12] migration: Use migration_transferred_bytes() to calculate rate_limit From: Fiona Ebner To: Juan Quintela , qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , Leonardo Bras , David Hildenbrand , Christian Borntraeger , qemu-s390x@nongnu.org, Stefan Hajnoczi , Thomas Huth , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , Eric Farman , David Gibson , Ilya Leoshkevich , Fam Zheng , Vladimir Sementsov-Ogievskiy , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Greg Kurz , Halil Pasic , Paolo Bonzini , qemu-ppc@nongnu.org, Peter Xu , Harsh Prateek Bora , Hailiang Zhang , John Snow , =?UTF-8?Q?C=c3=a9dric_Le_Goater?= , qemu-block@nongnu.org, Eric Blake , Jason Wang , Richard Henderson , =?UTF-8?Q?Daniel_P=2e_Berrang=c3=a9?= References: <20230518171304.95006-1-quintela@redhat.com> <20230518171304.95006-10-quintela@redhat.com> <5023cb18-9e9a-4666-e6b5-a7eb0e8dbd6c@proxmox.com> Content-Language: en-US In-Reply-To: <5023cb18-9e9a-4666-e6b5-a7eb0e8dbd6c@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=94.136.29.106; envelope-from=f.ebner@proxmox.com; helo=proxmox-new.maurer-it.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.094, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Am 23.05.23 um 14:31 schrieb Fiona Ebner: > Am 18.05.23 um 19:13 schrieb Juan Quintela: >> diff --git a/migration/migration-stats.c b/migration/migration-stats.c >> index feec7d7369..97759a45f3 100644 >> --- a/migration/migration-stats.c >> +++ b/migration/migration-stats.c >> @@ -24,7 +24,9 @@ bool migration_rate_exceeded(QEMUFile *f) >> return true; >> } >> >> - uint64_t rate_limit_used = stat64_get(&mig_stats.rate_limit_used); >> + 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) { > > Hi, > just wanted to let you know that the call to > migration_transferred_bytes(f) here can introduce a huge performance > penalty when taking a snapshot. I ran into the issue when testing > something else, with a single-disk snapshot. Without this call it takes > about two seconds, with the call about two minutes. > > Unfortunately, the regression is still in current master and v8.1-rc1. Did the v2 [0] of the series never make it? [0]: https://lists.nongnu.org/archive/html/qemu-devel/2023-05/msg07708.html Best Regards, Fiona