From nobody Sat May 18 08:46:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684430085; cv=none; d=zohomail.com; s=zohoarc; b=GoX+C0pD9KGsQTwUW4WurxV+UZekhef+F2H20Erg549kh4z8DVQWftrxQBkFvNLhlG3EprMj72A/4YuJYeSKxDS5Kym+mvHeQt/N+1F+7hcLwoovY4T7vzKlLMwEf/x4Hiwu7dc2qcpMvNidyEMBWMsqVyg8AtiG4pNYtNWh+vs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684430085; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GbUmN4Np0k7C5S0QmRLCXNeqruKAcVx4r+KXz18Q3AY=; b=ZvICStO2c04d4FN/7uEL5qkZucV3oD4KcUbJzQkk0EPMp7yTeJbMWMCgDL5176+7Sv3Q+W0wQ70Rfdf9ot8aNxAeMWLm8VCZrb0kllRGD2YTFo39L/ebHAEcn+84x3NOvejgegGU/tvH9jCpgJ3xdK1DXic92k8wmEqZGedN21o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684430085652587.5682086966033; Thu, 18 May 2023 10:14:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzhBw-0006VC-KH; Thu, 18 May 2023 13:13:28 -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 1pzhBu-0006TY-Oe for qemu-devel@nongnu.org; Thu, 18 May 2023 13:13:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzhBs-0000ff-TD for qemu-devel@nongnu.org; Thu, 18 May 2023 13:13:26 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-573--stvgVC8MDmKQRKJUrlVrg-1; Thu, 18 May 2023 13:13:18 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 11B701C04321; Thu, 18 May 2023 17:13:17 +0000 (UTC) Received: from secure.mitica (unknown [10.39.194.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3CEB940C6EC4; Thu, 18 May 2023 17:13:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684430002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GbUmN4Np0k7C5S0QmRLCXNeqruKAcVx4r+KXz18Q3AY=; b=NJwxTrOx6b6y6X7cyOL58fbSuOyf94r9ip0ZemfPCoT8o/RtaDtbsBcSCG7sGOB6ADO+uy ipNDDXGwsb735MM8CCtSFjTdU2gOsqp6v4sAFXGN1aYVaGNNeH4pXPFW2QLxsuFMOtkMfT cs51A76Wv4+8m2m+/8DdI8Pj6/Rwizo= X-MC-Unique: -stvgVC8MDmKQRKJUrlVrg-1 From: Juan Quintela To: 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=20Lureau?= , Eric Farman , David Gibson , Ilya Leoshkevich , Fam Zheng , Vladimir Sementsov-Ogievskiy , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Greg Kurz , Juan Quintela , Halil Pasic , Paolo Bonzini , qemu-ppc@nongnu.org, Peter Xu , Harsh Prateek Bora , Hailiang Zhang , John Snow , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-block@nongnu.org, Eric Blake , Jason Wang , Richard Henderson , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Zhang Chen Subject: [PULL 01/12] configure: add --disable-colo-proxy option Date: Thu, 18 May 2023 19:12:53 +0200 Message-Id: <20230518171304.95006-2-quintela@redhat.com> In-Reply-To: <20230518171304.95006-1-quintela@redhat.com> References: <20230518171304.95006-1-quintela@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684430087639100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Add option to not build filter-rewriter and colo-compare when they are not needed. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Juan Quintela Reviewed-by: Zhang Chen Message-Id: <20230515130640.46035-2-vsementsov@yandex-team.ru> Signed-off-by: Juan Quintela --- stubs/colo-compare.c | 7 +++++++ meson_options.txt | 2 ++ net/meson.build | 13 ++++++++++--- scripts/meson-buildoptions.sh | 3 +++ stubs/meson.build | 1 + 5 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 stubs/colo-compare.c diff --git a/stubs/colo-compare.c b/stubs/colo-compare.c new file mode 100644 index 0000000000..ec726665be --- /dev/null +++ b/stubs/colo-compare.c @@ -0,0 +1,7 @@ +#include "qemu/osdep.h" +#include "qemu/notify.h" +#include "net/colo-compare.h" + +void colo_compare_cleanup(void) +{ +} diff --git a/meson_options.txt b/meson_options.txt index 11aec2a441..d1b6738c1b 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -293,6 +293,8 @@ option('live_block_migration', type: 'feature', value: = 'auto', description: 'block migration in the main migration stream') option('replication', type: 'feature', value: 'auto', description: 'replication support') +option('colo_proxy', type: 'feature', value: 'auto', + description: 'colo-proxy support') option('bochs', type: 'feature', value: 'auto', description: 'bochs image format support') option('cloop', type: 'feature', value: 'auto', diff --git a/net/meson.build b/net/meson.build index 87afca3e93..6f4ecde57f 100644 --- a/net/meson.build +++ b/net/meson.build @@ -1,13 +1,10 @@ softmmu_ss.add(files( 'announce.c', 'checksum.c', - 'colo-compare.c', - 'colo.c', 'dump.c', 'eth.c', 'filter-buffer.c', 'filter-mirror.c', - 'filter-rewriter.c', 'filter.c', 'hub.c', 'net-hmp-cmds.c', @@ -19,6 +16,16 @@ softmmu_ss.add(files( 'util.c', )) =20 +if get_option('replication').allowed() or \ + get_option('colo_proxy').allowed() + softmmu_ss.add(files('colo-compare.c')) + softmmu_ss.add(files('colo.c')) +endif + +if get_option('colo_proxy').allowed() + softmmu_ss.add(files('filter-rewriter.c')) +endif + softmmu_ss.add(when: 'CONFIG_TCG', if_true: files('filter-replay.c')) =20 if have_l2tpv3 diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index 52fb079a60..a66eb31dae 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -86,6 +86,7 @@ meson_options_help() { printf "%s\n" ' capstone Whether and how to find the capstone li= brary' printf "%s\n" ' cloop cloop image format support' printf "%s\n" ' cocoa Cocoa user interface (macOS only)' + printf "%s\n" ' colo-proxy colo-proxy support' printf "%s\n" ' coreaudio CoreAudio sound support' printf "%s\n" ' crypto-afalg Linux AF_ALG crypto backend driver' printf "%s\n" ' curl CURL block device driver' @@ -245,6 +246,8 @@ _meson_option_parse() { --disable-cloop) printf "%s" -Dcloop=3Ddisabled ;; --enable-cocoa) printf "%s" -Dcocoa=3Denabled ;; --disable-cocoa) printf "%s" -Dcocoa=3Ddisabled ;; + --enable-colo-proxy) printf "%s" -Dcolo_proxy=3Denabled ;; + --disable-colo-proxy) printf "%s" -Dcolo_proxy=3Ddisabled ;; --enable-coreaudio) printf "%s" -Dcoreaudio=3Denabled ;; --disable-coreaudio) printf "%s" -Dcoreaudio=3Ddisabled ;; --enable-coroutine-pool) printf "%s" -Dcoroutine_pool=3Dtrue ;; diff --git a/stubs/meson.build b/stubs/meson.build index 8412cad15f..a56645e2f7 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -46,6 +46,7 @@ stub_ss.add(files('target-monitor-defs.c')) stub_ss.add(files('trace-control.c')) stub_ss.add(files('uuid.c')) stub_ss.add(files('colo.c')) +stub_ss.add(files('colo-compare.c')) stub_ss.add(files('vmstate.c')) stub_ss.add(files('vm-stop.c')) stub_ss.add(files('win32-kbd-hook.c')) --=20 2.40.1 From nobody Sat May 18 08:46:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684430061; cv=none; d=zohomail.com; s=zohoarc; b=LlDg9/pZSHi19PaC8E2Xms3d0VYwmeYBLMpeRwPTZ9fP8TZB407i7APnlxB5SnVrZF0JHipO27d/Xz5sV76F8kW7xycGDopddQPk1QtmeD3PsUBajzAvooIA+HaEVyXUKs0aoluJTS2yCIedpIdgk0h8fLEBGfGlKboZj9aC6x0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684430061; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=V64qzVfvNHyaMOEqqJTame3ALpovwKOsQAtuvwBl3Cw=; b=gMNxhDsMmYKHNT7L3O0Pjga02qXrjX36lWu7sTzYRTpu9ndkmks9QlwfuGSS2e6W/95Pk2Ba3ji2qL5jaClz/XPrc2cywSkslCkrL3Tfsh460LpbRIOQqUUgN2NoAZryTILUZs0A9/VnRvfE1GK1cVaVNX/28lO9m/YVk4tKbfA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684430061667441.1084089805538; Thu, 18 May 2023 10:14:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzhBx-0006XT-PT; Thu, 18 May 2023 13:13: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 1pzhBw-0006Un-4y for qemu-devel@nongnu.org; Thu, 18 May 2023 13:13:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzhBt-0000gW-Ue for qemu-devel@nongnu.org; Thu, 18 May 2023 13:13:27 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-637-2B-RWMPgNUC2HGad9Z_LIA-1; Thu, 18 May 2023 13:13:23 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0576C185A7A4; Thu, 18 May 2023 17:13:22 +0000 (UTC) Received: from secure.mitica (unknown [10.39.194.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D3C640C6EC4; Thu, 18 May 2023 17:13:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684430005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=V64qzVfvNHyaMOEqqJTame3ALpovwKOsQAtuvwBl3Cw=; b=Rj/SyigPsZWEl/oahc+qIW2UH33i8lGpPuaxbak/qpzF9cBXZ/qeSbiJil09UfCZxNzuEE DpnGtc25F+wCoNfC00oLHNPFGs4pQxmHnEnvCG3MjXZKMARJwYSnXffN+Kv+PX0FGBrULf 3Qed1BzpWZbRJH7+TuI2VJBuH1NiOjM= X-MC-Unique: 2B-RWMPgNUC2HGad9Z_LIA-1 From: Juan Quintela To: 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=20Lureau?= , Eric Farman , David Gibson , Ilya Leoshkevich , Fam Zheng , Vladimir Sementsov-Ogievskiy , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Greg Kurz , Juan Quintela , Halil Pasic , Paolo Bonzini , qemu-ppc@nongnu.org, Peter Xu , Harsh Prateek Bora , Hailiang Zhang , John Snow , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-block@nongnu.org, Eric Blake , Jason Wang , Richard Henderson , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 02/12] migration: split migration_incoming_co Date: Thu, 18 May 2023 19:12:54 +0200 Message-Id: <20230518171304.95006-3-quintela@redhat.com> In-Reply-To: <20230518171304.95006-1-quintela@redhat.com> References: <20230518171304.95006-1-quintela@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684430062897100003 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Originally, migration_incoming_co was introduced by 25d0c16f625feb3b6 "migration: Switch to COLO process after finishing loadvm" to be able to enter from COLO code to one specific yield point, added by 25d0c16f625feb3b6. Later in 923709896b1b0 "migration: poll the cm event for destination qemu" we reused this variable to wake the migration incoming coroutine from RDMA code. That was doubtful idea. Entering coroutines is a very fragile thing: you should be absolutely sure which yield point you are going to enter. I don't know how much is it safe to enter during qemu_loadvm_state() which I think what RDMA want to do. But for sure RDMA shouldn't enter the special COLO-related yield-point. As well, COLO code doesn't want to enter during qemu_loadvm_state(), it want to enter it's own specific yield-point. As well, when in 8e48ac95865ac97d "COLO: Add block replication into colo process" we added bdrv_invalidate_cache_all() call (now it's called activate_all()) it became possible to enter the migration incoming coroutine during that call which is wrong too. So, let't make these things separate and disjoint: loadvm_co for RDMA, non-NULL during qemu_loadvm_state(), and colo_incoming_co for COLO, non-NULL only around specific yield. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Juan Quintela Message-Id: <20230515130640.46035-3-vsementsov@yandex-team.ru> Signed-off-by: Juan Quintela --- migration/migration.h | 9 ++++++++- migration/colo.c | 4 ++-- migration/migration.c | 8 ++++++-- migration/rdma.c | 5 ++--- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/migration/migration.h b/migration/migration.h index 7721c7658b..48a46123a0 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -162,8 +162,15 @@ struct MigrationIncomingState { =20 int state; =20 + /* + * The incoming migration coroutine, non-NULL during qemu_loadvm_state= (). + * Used to wake the migration incoming coroutine from rdma code. How m= uch is + * it safe - it's a question. + */ + Coroutine *loadvm_co; + /* The coroutine we should enter (back) after failover */ - Coroutine *migration_incoming_co; + Coroutine *colo_incoming_co; QemuSemaphore colo_incoming_sem; =20 /* diff --git a/migration/colo.c b/migration/colo.c index 6c7c313956..a688ac553a 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -145,8 +145,8 @@ static void secondary_vm_do_failover(void) qemu_sem_post(&mis->colo_incoming_sem); =20 /* For Secondary VM, jump to incoming co */ - if (mis->migration_incoming_co) { - qemu_coroutine_enter(mis->migration_incoming_co); + if (mis->colo_incoming_co) { + qemu_coroutine_enter(mis->colo_incoming_co); } } =20 diff --git a/migration/migration.c b/migration/migration.c index 00d8ba8da0..a6f2f6cacd 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -520,12 +520,14 @@ process_incoming_migration_co(void *opaque) goto fail; } =20 - mis->migration_incoming_co =3D qemu_coroutine_self(); mis->largest_page_size =3D qemu_ram_pagesize_largest(); postcopy_state_set(POSTCOPY_INCOMING_NONE); migrate_set_state(&mis->state, MIGRATION_STATUS_NONE, MIGRATION_STATUS_ACTIVE); + + mis->loadvm_co =3D qemu_coroutine_self(); ret =3D qemu_loadvm_state(mis->from_src_file); + mis->loadvm_co =3D NULL; =20 ps =3D postcopy_state_get(); trace_process_incoming_migration_co_end(ret, ps); @@ -566,7 +568,10 @@ process_incoming_migration_co(void *opaque) =20 qemu_thread_create(&colo_incoming_thread, "COLO incoming", colo_process_incoming_thread, mis, QEMU_THREAD_JOINABLE); + + mis->colo_incoming_co =3D qemu_coroutine_self(); qemu_coroutine_yield(); + mis->colo_incoming_co =3D NULL; =20 qemu_mutex_unlock_iothread(); /* Wait checkpoint incoming thread exit before free resource */ @@ -578,7 +583,6 @@ process_incoming_migration_co(void *opaque) =20 mis->bh =3D qemu_bh_new(process_incoming_migration_bh, mis); qemu_bh_schedule(mis->bh); - mis->migration_incoming_co =3D NULL; return; fail: local_err =3D NULL; diff --git a/migration/rdma.c b/migration/rdma.c index 2cd8f1cc66..2e4dcff1c9 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -3342,9 +3342,8 @@ static void rdma_cm_poll_handler(void *opaque) } } rdma_ack_cm_event(cm_event); - - if (mis->migration_incoming_co) { - qemu_coroutine_enter(mis->migration_incoming_co); + if (mis->loadvm_co) { + qemu_coroutine_enter(mis->loadvm_co); } return; } --=20 2.40.1 From nobody Sat May 18 08:46:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684430127; cv=none; d=zohomail.com; s=zohoarc; b=P/dn7y+gbmn6GF6i5GuADS36tsT5BRQXPB5Q+w/NR9ShwEs/sJKR3qjz8hM0hDTHsix55ZKgDotZmZZb5JNDfrTqQOSKfrOnmhIsGmo2caXtidUQK+EDkaQ0xguhHysXFY9RyeSEtxiIbgIFxvTnuEevcwvSHlU7FS+8g1G6j0w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684430127; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=eYAXHMO9BDXAE1XcJTehLSfKXo8OzzhXB5VgtZQ4Tdo=; b=Q/z5v3pIHmzXgIz4UaFBzFrL83U2EkRWZ8W8sEFfQV74hsFCWPiIqoUQ4LKoFepf8IUaYGWXxH8Qw7YerXIm3NCREp/p52zxNAthhE4BiBSHSycxQRlrPzObQh41JaMLD9DmzC/OBs6OI3gudVNYuleMc4AqUuyySGDaDIvRYbs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684430127133679.2082224973316; Thu, 18 May 2023 10:15:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzhCF-0006uH-Iw; Thu, 18 May 2023 13:13:47 -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 1pzhCE-0006t8-9Z for qemu-devel@nongnu.org; Thu, 18 May 2023 13:13:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzhCC-0000kX-6k for qemu-devel@nongnu.org; Thu, 18 May 2023 13:13:46 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-146-DddOgGCwM_-DPHPakBE87g-1; Thu, 18 May 2023 13:13:41 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EA3E03C0E210; Thu, 18 May 2023 17:13:38 +0000 (UTC) Received: from secure.mitica (unknown [10.39.194.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5436D4078908; Thu, 18 May 2023 17:13:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684430022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eYAXHMO9BDXAE1XcJTehLSfKXo8OzzhXB5VgtZQ4Tdo=; b=VoeMBlT5ZvUUg3DRrRx/gyONjvPkfi4x7i7Hpv/wBC7D1CwGOLRXa6IYeKuCYyYsfmWzko HQHdZwOZmmYfTnIQuX5hIxyAwfYfCnKPTsW4t0O6BGSUqqMfyWNY78cB4PsphPvJdCGzyv 4Btua2HUts3YKRW8maTpRmdhtP5/dbg= X-MC-Unique: DddOgGCwM_-DPHPakBE87g-1 From: Juan Quintela To: 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=20Lureau?= , Eric Farman , David Gibson , Ilya Leoshkevich , Fam Zheng , Vladimir Sementsov-Ogievskiy , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Greg Kurz , Juan Quintela , Halil Pasic , Paolo Bonzini , qemu-ppc@nongnu.org, Peter Xu , Harsh Prateek Bora , Hailiang Zhang , John Snow , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-block@nongnu.org, Eric Blake , Jason Wang , Richard Henderson , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 03/12] migration: process_incoming_migration_co(): move colo part to colo Date: Thu, 18 May 2023 19:12:55 +0200 Message-Id: <20230518171304.95006-4-quintela@redhat.com> In-Reply-To: <20230518171304.95006-1-quintela@redhat.com> References: <20230518171304.95006-1-quintela@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684430127946100003 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Let's make better public interface for COLO: instead of colo_process_incoming_thread and not trivial logic around creating the thread let's make simple colo_incoming_co(), hiding implementation from generic code. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Juan Quintela Message-Id: <20230515130640.46035-4-vsementsov@yandex-team.ru> Signed-off-by: Juan Quintela --- include/migration/colo.h | 9 ++++++++- migration/colo.c | 39 ++++++++++++++++++++++++++++++++++++++- migration/migration.c | 28 ++-------------------------- stubs/colo.c | 6 ++---- 4 files changed, 50 insertions(+), 32 deletions(-) diff --git a/include/migration/colo.h b/include/migration/colo.h index 7ef315473e..eaac07f26d 100644 --- a/include/migration/colo.h +++ b/include/migration/colo.h @@ -28,7 +28,6 @@ bool migration_in_colo_state(void); int migration_incoming_enable_colo(void); void migration_incoming_disable_colo(void); bool migration_incoming_colo_enabled(void); -void *colo_process_incoming_thread(void *opaque); bool migration_incoming_in_colo_state(void); =20 COLOMode get_colo_mode(void); @@ -44,5 +43,13 @@ void colo_do_failover(void); */ void colo_checkpoint_delay_set(void); =20 +/* + * Starts COLO incoming process. Called from process_incoming_migration_co= () + * after loading the state. + * + * Called with BQL locked, may temporary release BQL. + */ +int coroutine_fn colo_incoming_co(void); + void colo_shutdown(void); #endif diff --git a/migration/colo.c b/migration/colo.c index a688ac553a..72f4f7b37e 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -817,7 +817,7 @@ void colo_shutdown(void) } } =20 -void *colo_process_incoming_thread(void *opaque) +static void *colo_process_incoming_thread(void *opaque) { MigrationIncomingState *mis =3D opaque; QEMUFile *fb =3D NULL; @@ -918,3 +918,40 @@ out: rcu_unregister_thread(); return NULL; } + +int coroutine_fn colo_incoming_co(void) +{ + MigrationIncomingState *mis =3D migration_incoming_get_current(); + Error *local_err =3D NULL; + QemuThread th; + + assert(qemu_mutex_iothread_locked()); + + if (!migration_incoming_colo_enabled()) { + return 0; + } + + /* Make sure all file formats throw away their mutable metadata */ + bdrv_activate_all(&local_err); + if (local_err) { + error_report_err(local_err); + return -EINVAL; + } + + qemu_thread_create(&th, "COLO incoming", colo_process_incoming_thread, + mis, QEMU_THREAD_JOINABLE); + + mis->colo_incoming_co =3D qemu_coroutine_self(); + qemu_coroutine_yield(); + mis->colo_incoming_co =3D NULL; + + qemu_mutex_unlock_iothread(); + /* Wait checkpoint incoming thread exit before free resource */ + qemu_thread_join(&th); + qemu_mutex_lock_iothread(); + + /* We hold the global iothread lock, so it is safe here */ + colo_release_ram_cache(); + + return 0; +} diff --git a/migration/migration.c b/migration/migration.c index a6f2f6cacd..039bba4804 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -511,7 +511,6 @@ process_incoming_migration_co(void *opaque) MigrationIncomingState *mis =3D migration_incoming_get_current(); PostcopyState ps; int ret; - Error *local_err =3D NULL; =20 assert(mis->from_src_file); =20 @@ -555,37 +554,14 @@ process_incoming_migration_co(void *opaque) goto fail; } =20 - /* we get COLO info, and know if we are in COLO mode */ - if (migration_incoming_colo_enabled()) { - QemuThread colo_incoming_thread; - - /* Make sure all file formats throw away their mutable metadata */ - bdrv_activate_all(&local_err); - if (local_err) { - error_report_err(local_err); - goto fail; - } - - qemu_thread_create(&colo_incoming_thread, "COLO incoming", - colo_process_incoming_thread, mis, QEMU_THREAD_JOINABLE); - - mis->colo_incoming_co =3D qemu_coroutine_self(); - qemu_coroutine_yield(); - mis->colo_incoming_co =3D NULL; - - qemu_mutex_unlock_iothread(); - /* Wait checkpoint incoming thread exit before free resource */ - qemu_thread_join(&colo_incoming_thread); - qemu_mutex_lock_iothread(); - /* We hold the global iothread lock, so it is safe here */ - colo_release_ram_cache(); + if (colo_incoming_co() < 0) { + goto fail; } =20 mis->bh =3D qemu_bh_new(process_incoming_migration_bh, mis); qemu_bh_schedule(mis->bh); return; fail: - local_err =3D NULL; migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE, MIGRATION_STATUS_FAILED); qemu_fclose(mis->from_src_file); diff --git a/stubs/colo.c b/stubs/colo.c index cf9816d368..f33379d0fd 100644 --- a/stubs/colo.c +++ b/stubs/colo.c @@ -10,11 +10,9 @@ void colo_shutdown(void) { } =20 -void *colo_process_incoming_thread(void *opaque) +int coroutine_fn colo_incoming_co(void) { - error_report("Impossible happend: trying to start COLO thread when COL= O " - "module is not built in"); - abort(); + return 0; } =20 void colo_checkpoint_delay_set(void) --=20 2.40.1 From nobody Sat May 18 08:46:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684430066; cv=none; d=zohomail.com; s=zohoarc; b=Fhdl7qPH/gEUGNSpPgiFta0stPQ0WDCFdBf5WqwgpvNhHg2Aje7DQYqYRVVd8cdACUDlqCc/M/eb5+b2vsKGCi+rjnwut4ZCkra7J/CJvMW8RJs6ncADspjot0iq/giI2V+j995Pc7EKMVtIGnIB3YP4UMrYBL7OSl4yzHQZAIs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684430066; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SqOb8gdw/Q/rkshH+ZIqwZ3T/JguoAfe2cg4FDvP/lI=; b=a5HwSQNseGNw9auw/cu5TYgbhhdMhL4yo6z93VVPXMqvGD6IfrHxpGHsDDUgK0Hm3+C8i0x2FDXtj09wgILFbkl+zdVNcUETlM2LHHsdB59aY3XdYVp7sEzaa+5H2sSdD1b8BfbpOkFgSRBR3UpIomOW43dLHo9sKwgDaa5TtO8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684430066397372.77731395761657; Thu, 18 May 2023 10:14:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzhCM-0007C8-SQ; Thu, 18 May 2023 13:13:54 -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 1pzhCK-00070k-OM for qemu-devel@nongnu.org; Thu, 18 May 2023 13:13:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzhCJ-0000mu-5o for qemu-devel@nongnu.org; Thu, 18 May 2023 13:13:52 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-623-2UTCxFdvMgeGmXwrBqJ_vw-1; Thu, 18 May 2023 13:13:46 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0E63C85A588; Thu, 18 May 2023 17:13:45 +0000 (UTC) Received: from secure.mitica (unknown [10.39.194.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id 42BC140C6EC4; Thu, 18 May 2023 17:13:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684430030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SqOb8gdw/Q/rkshH+ZIqwZ3T/JguoAfe2cg4FDvP/lI=; b=Xc3/q15cEnU0h9NV3Z+ibnalU/DxRW+07YLvriwJ+keK+DfGlGjeYHXoKrX6ymBoJxATka gWQ4iQl/GaM8qZaLiUdBkppvB20h4XyMAdTm8QXe981w9B+2gKrD1JrQS2tYFegs3icw0e 7eYDWytU2QOutlei3CODZQxEI+Jkl8Q= X-MC-Unique: 2UTCxFdvMgeGmXwrBqJ_vw-1 From: Juan Quintela To: 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=20Lureau?= , Eric Farman , David Gibson , Ilya Leoshkevich , Fam Zheng , Vladimir Sementsov-Ogievskiy , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Greg Kurz , Juan Quintela , Halil Pasic , Paolo Bonzini , qemu-ppc@nongnu.org, Peter Xu , Harsh Prateek Bora , Hailiang Zhang , John Snow , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-block@nongnu.org, Eric Blake , Jason Wang , Richard Henderson , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 04/12] migration: Don't use INT64_MAX for unlimited rate Date: Thu, 18 May 2023 19:12:56 +0200 Message-Id: <20230518171304.95006-5-quintela@redhat.com> In-Reply-To: <20230518171304.95006-1-quintela@redhat.com> References: <20230518171304.95006-1-quintela@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684430066998100001 Content-Type: text/plain; charset="utf-8" Define and use RATE_LIMIT_DISABLED instead. Signed-off-by: Juan Quintela Reviewed-by: Harsh Prateek Bora Message-Id: <20230515195709.63843-2-quintela@redhat.com> --- migration/migration-stats.h | 6 ++++++ migration/migration.c | 4 ++-- migration/qemu-file.c | 6 +++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/migration/migration-stats.h b/migration/migration-stats.h index cf8a4f0410..e7f1269769 100644 --- a/migration/migration-stats.h +++ b/migration/migration-stats.h @@ -15,6 +15,12 @@ =20 #include "qemu/stats64.h" =20 +/* + * If rate_limit_max is 0, there is special code to remove the rate + * limit. + */ +#define RATE_LIMIT_DISABLED 0 + /* * These are the ram migration statistic counters. It is loosely * based on MigrationStats. We change to Stat64 any counter that diff --git a/migration/migration.c b/migration/migration.c index 039bba4804..3ceaf29798 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2304,7 +2304,7 @@ static void migration_completion(MigrationState *s) * them if migration fails or is cancelled. */ s->block_inactive =3D !migrate_colo(); - qemu_file_set_rate_limit(s->to_dst_file, INT64_MAX); + qemu_file_set_rate_limit(s->to_dst_file, RATE_LIMIT_DISABL= ED); ret =3D qemu_savevm_state_complete_precopy(s->to_dst_file,= false, s->block_inactive= ); } @@ -3048,7 +3048,7 @@ static void *bg_migration_thread(void *opaque) rcu_register_thread(); object_ref(OBJECT(s)); =20 - qemu_file_set_rate_limit(s->to_dst_file, INT64_MAX); + qemu_file_set_rate_limit(s->to_dst_file, RATE_LIMIT_DISABLED); =20 setup_start =3D qemu_clock_get_ms(QEMU_CLOCK_HOST); /* diff --git a/migration/qemu-file.c b/migration/qemu-file.c index 597054759d..9728002de5 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -27,6 +27,7 @@ #include "qemu/error-report.h" #include "qemu/iov.h" #include "migration.h" +#include "migration-stats.h" #include "qemu-file.h" #include "trace.h" #include "options.h" @@ -732,7 +733,10 @@ int qemu_file_rate_limit(QEMUFile *f) if (qemu_file_get_error(f)) { return 1; } - if (f->rate_limit_max > 0 && f->rate_limit_used > f->rate_limit_max) { + if (f->rate_limit_max =3D=3D RATE_LIMIT_DISABLED) { + return 0; + } + if (f->rate_limit_used > f->rate_limit_max) { return 1; } return 0; --=20 2.40.1 From nobody Sat May 18 08:46:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684430094; cv=none; d=zohomail.com; s=zohoarc; b=ZPJb2gzH2dLXyiAs+atBzN0zWgqatAoIPbsXl961DXTmEe+JRQHsgbjqgmfhHT4TB+oJ08soixyes4p4qx8q+lgmcD0sRMD0Y8czsNZJ7hSKM2/E9GfZTsgpcoBxAeBy2oi94UcbNFf9ztV558Sx2yRvMAQdhgOSseFFdtPtmQ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684430094; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GsF9qWT21STVri0HTe7Z95CXLprSzpMdbCnFQsxQ4sg=; b=nFBt8qOOdGWw0b8UG2qgqPoXjCmcnpRZteZHSExCx8zxwNCNyXSwV4zz7S0OK6DPjoonbqKXQPY2Ep5SDvk5bdIWra/iO74/2t7K+rniGSpOfqsOdEfd8hZvLiKlQ5WZ/dMHjZgGBQzDy9xvrwnZQqIcTON91Oq7aE2oyiEldWA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684430094371614.4853931717212; Thu, 18 May 2023 10:14:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzhCf-0007lg-4n; Thu, 18 May 2023 13:14: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 1pzhCY-0007Vh-DS for qemu-devel@nongnu.org; Thu, 18 May 2023 13:14:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzhCW-0000ph-4k for qemu-devel@nongnu.org; Thu, 18 May 2023 13:14:06 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-664-m-dDPPDqOPq0HbmXRg1gfQ-1; Thu, 18 May 2023 13:13:52 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 22C0888B76F; Thu, 18 May 2023 17:13:50 +0000 (UTC) Received: from secure.mitica (unknown [10.39.194.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5A81740C6EC4; Thu, 18 May 2023 17:13:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684430043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GsF9qWT21STVri0HTe7Z95CXLprSzpMdbCnFQsxQ4sg=; b=IHz//Zx5fz02MejGGnB0Pr6vBUsB13xjXUZ/DP+Hg6r1tHnjn36UJlf+KJe7b+p5OxK4dv lFPxamIITLrbNKilCBT7p5igDRstVz8DMTgK+CX8BDD8YrY/MOg0lylT9G9Vj/CCFCvdLb pypRj62uLniSqliqwEuFWtrnAXDNnyM= X-MC-Unique: m-dDPPDqOPq0HbmXRg1gfQ-1 From: Juan Quintela To: 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=20Lureau?= , Eric Farman , David Gibson , Ilya Leoshkevich , Fam Zheng , Vladimir Sementsov-Ogievskiy , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Greg Kurz , Juan Quintela , Halil Pasic , Paolo Bonzini , qemu-ppc@nongnu.org, Peter Xu , Harsh Prateek Bora , Hailiang Zhang , John Snow , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-block@nongnu.org, Eric Blake , Jason Wang , Richard Henderson , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 05/12] qemu-file: Account for rate_limit usage on qemu_fflush() Date: Thu, 18 May 2023 19:12:57 +0200 Message-Id: <20230518171304.95006-6-quintela@redhat.com> In-Reply-To: <20230518171304.95006-1-quintela@redhat.com> References: <20230518171304.95006-1-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684430095639100003 That is the moment we know we have transferred something. Signed-off-by: Juan Quintela Reviewed-by: C=C3=A9dric Le Goater Message-Id: <20230515195709.63843-5-quintela@redhat.com> --- migration/qemu-file.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/migration/qemu-file.c b/migration/qemu-file.c index 9728002de5..3d66c5c512 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -302,7 +302,9 @@ void qemu_fflush(QEMUFile *f) &local_error) < 0) { qemu_file_set_error_obj(f, -EIO, local_error); } else { - f->total_transferred +=3D iov_size(f->iov, f->iovcnt); + uint64_t size =3D iov_size(f->iov, f->iovcnt); + qemu_file_acct_rate_limit(f, size); + f->total_transferred +=3D size; } =20 qemu_iovec_release_ram(f); @@ -519,7 +521,6 @@ void qemu_put_buffer_async(QEMUFile *f, const uint8_t *= buf, size_t size, return; } =20 - f->rate_limit_used +=3D size; add_to_iovec(f, buf, size, may_free); } =20 @@ -537,7 +538,6 @@ void qemu_put_buffer(QEMUFile *f, const uint8_t *buf, s= ize_t size) l =3D size; } memcpy(f->buf + f->buf_index, buf, l); - f->rate_limit_used +=3D l; add_buf_to_iovec(f, l); if (qemu_file_get_error(f)) { break; @@ -554,7 +554,6 @@ void qemu_put_byte(QEMUFile *f, int v) } =20 f->buf[f->buf_index] =3D v; - f->rate_limit_used++; add_buf_to_iovec(f, 1); } =20 --=20 2.40.1 From nobody Sat May 18 08:46:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684430109; cv=none; d=zohomail.com; s=zohoarc; b=bFKFnk1n8yAkJvMotGfq98xbyMR7GYqKhnNzmaJtsb8FR0EeRUn0F0ZAWYGHcBecb5C+VcRGhcwEzqwKo5MJ/wO7RuNUIAOgRWFKG1CZ3YqrrM/a3fj0PaM0iiDsEbHAkit30/APWrEc9YzEENQ28bMJY+YiV/ZZ1rDkEhdgjU0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684430109; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oc5x6CzAo31GCamryf228RDi28azBjSk9PoU8TgRgdw=; b=borm+XDwa9fQ+IezB+gcUEZORLfSg9aN0Vx8ouTnx7Hhj8bGzV7lbkMIwjpXxI8rMSODUtPqw24FCmX3ZOEOyqLfq//3R7yVUYGCLYcX/Yb+hXyl5k+mosEAmmNna23IzSpMmKydQVEvqpVUO7dG10DjYU5XnrTzn1rVH10Pamk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684430109402979.6334830659806; Thu, 18 May 2023 10:15:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzhCe-0007gA-4j; Thu, 18 May 2023 13:14:12 -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 1pzhCY-0007Vg-Bz for qemu-devel@nongnu.org; Thu, 18 May 2023 13:14:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzhCU-0000p4-I5 for qemu-devel@nongnu.org; Thu, 18 May 2023 13:14:05 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-615-tpFQhWAIMDW0-cxP3kUylg-1; Thu, 18 May 2023 13:13:56 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3A51585A588; Thu, 18 May 2023 17:13:55 +0000 (UTC) Received: from secure.mitica (unknown [10.39.194.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id 68CEC40C6EC4; Thu, 18 May 2023 17:13:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684430042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oc5x6CzAo31GCamryf228RDi28azBjSk9PoU8TgRgdw=; b=PwKwdsbPk6gyCvit3aU54bxiuTNnYF1dcSk5Xu8wJEcJITNvj17c6X8X/nmY0tfQrltwdf JK4PvIrXJ7PY53C18ys5g5QRxVrBVp1eQl34kPXcWb6FFBAVYEa3vzWcbFHhuvzzxzy0/M Rt4bq4XYWd/ZCL/5zxKovKuuZEwNaNE= X-MC-Unique: tpFQhWAIMDW0-cxP3kUylg-1 From: Juan Quintela To: 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=20Lureau?= , Eric Farman , David Gibson , Ilya Leoshkevich , Fam Zheng , Vladimir Sementsov-Ogievskiy , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Greg Kurz , Juan Quintela , Halil Pasic , Paolo Bonzini , qemu-ppc@nongnu.org, Peter Xu , Harsh Prateek Bora , Hailiang Zhang , John Snow , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-block@nongnu.org, Eric Blake , Jason Wang , Richard Henderson , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 06/12] migration: Move rate_limit_max and rate_limit_used to migration_stats Date: Thu, 18 May 2023 19:12:58 +0200 Message-Id: <20230518171304.95006-7-quintela@redhat.com> In-Reply-To: <20230518171304.95006-1-quintela@redhat.com> References: <20230518171304.95006-1-quintela@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684430111039100003 Content-Type: text/plain; charset="utf-8" These way we can make them atomic and use this functions from any place. I also moved all functions that use rate_limit to migration-stats. Functions got renamed, they are not qemu_file anymore. qemu_file_rate_limit -> migration_rate_exceeded qemu_file_set_rate_limit -> migration_rate_set qemu_file_get_rate_limit -> migration_rate_get qemu_file_reset_rate_limit -> migration_rate_reset qemu_file_acct_rate_limit -> migration_rate_account. Reviewed-by: Harsh Prateek Bora Signed-off-by: Juan Quintela Message-Id: <20230515195709.63843-6-quintela@redhat.com> Signed-off-by: Juan Quintela --- include/migration/qemu-file-types.h | 12 ++++++- migration/migration-stats.h | 46 +++++++++++++++++++++++++ migration/options.h | 7 ---- migration/qemu-file.h | 11 ------ hw/ppc/spapr.c | 4 +-- hw/s390x/s390-stattrib.c | 2 +- migration/block-dirty-bitmap.c | 2 +- migration/block.c | 5 +-- migration/migration-stats.c | 44 ++++++++++++++++++++++++ migration/migration.c | 14 ++++---- migration/multifd.c | 2 +- migration/options.c | 7 ++-- migration/qemu-file.c | 52 ++--------------------------- migration/ram.c | 2 +- migration/savevm.c | 2 +- migration/meson.build | 2 +- 16 files changed, 124 insertions(+), 90 deletions(-) diff --git a/include/migration/qemu-file-types.h b/include/migration/qemu-f= ile-types.h index 1436f9ce92..9ba163f333 100644 --- a/include/migration/qemu-file-types.h +++ b/include/migration/qemu-file-types.h @@ -165,6 +165,16 @@ size_t coroutine_mixed_fn qemu_get_counted_string(QEMU= File *f, char buf[256]); =20 void qemu_put_counted_string(QEMUFile *f, const char *name); =20 -int qemu_file_rate_limit(QEMUFile *f); +/** + * migration_rate_exceeded: Check if we have exceeded rate for this interv= al + * + * Checks if we have already transferred more data that we are allowed + * in the current interval. + * + * @f: QEMUFile used for main migration channel + * + * Returns if we should stop sending data for this interval. + */ +bool migration_rate_exceeded(QEMUFile *f); =20 #endif diff --git a/migration/migration-stats.h b/migration/migration-stats.h index e7f1269769..7b64dc7cc2 100644 --- a/migration/migration-stats.h +++ b/migration/migration-stats.h @@ -15,6 +15,12 @@ =20 #include "qemu/stats64.h" =20 +/* + * Amount of time to allocate to each "chunk" of bandwidth-throttled + * data. + */ +#define BUFFER_DELAY 100 + /* * If rate_limit_max is 0, there is special code to remove the rate * limit. @@ -75,6 +81,14 @@ typedef struct { * Number of bytes sent during precopy stage. */ Stat64 precopy_bytes; + /* + * Maximum amount of data we can send in a cycle. + */ + Stat64 rate_limit_max; + /* + * Amount of data we have sent in the current cycle. + */ + Stat64 rate_limit_used; /* * Total number of bytes transferred. */ @@ -87,4 +101,36 @@ typedef struct { =20 extern MigrationAtomicStats mig_stats; =20 +/** + * migration_rate_account: Increase the number of bytes transferred. + * + * Report on a number of bytes the have been transferred that need to + * be applied to the rate limiting calcuations. + * + * @len: amount of bytes transferred + */ +void migration_rate_account(uint64_t len); + +/** + * migration_rate_get: Get the maximum amount that can be transferred. + * + * Returns the maximum number of bytes that can be transferred in a cycle. + */ +uint64_t migration_rate_get(void); + +/** + * migration_rate_reset: Reset the rate limit counter. + * + * This is called when we know we start a new transfer cycle. + */ +void migration_rate_reset(void); + +/** + * migration_rate_set: Set the maximum amount that can be transferred. + * + * Sets the maximum amount of bytes that can be transferred in one cycle. + * + * @new_rate: new maximum amount + */ +void migration_rate_set(uint64_t new_rate); #endif diff --git a/migration/options.h b/migration/options.h index 5cca3326d6..45991af3c2 100644 --- a/migration/options.h +++ b/migration/options.h @@ -17,13 +17,6 @@ #include "hw/qdev-properties.h" #include "hw/qdev-properties-system.h" =20 -/* constants */ - -/* Amount of time to allocate to each "chunk" of bandwidth-throttled - * data. */ -#define BUFFER_DELAY 100 -#define XFER_LIMIT_RATIO (1000 / BUFFER_DELAY) - /* migration properties */ =20 extern Property migration_properties[]; diff --git a/migration/qemu-file.h b/migration/qemu-file.h index bcc39081f2..e649718492 100644 --- a/migration/qemu-file.h +++ b/migration/qemu-file.h @@ -130,17 +130,6 @@ void qemu_file_skip(QEMUFile *f, int size); * accounting information tracks the total migration traffic. */ void qemu_file_credit_transfer(QEMUFile *f, size_t size); -void qemu_file_reset_rate_limit(QEMUFile *f); -/* - * qemu_file_acct_rate_limit: - * - * Report on a number of bytes the have been transferred - * out of band from the main file object I/O methods, and - * need to be applied to the rate limiting calcuations - */ -void qemu_file_acct_rate_limit(QEMUFile *f, uint64_t len); -void qemu_file_set_rate_limit(QEMUFile *f, uint64_t new_rate); -uint64_t qemu_file_get_rate_limit(QEMUFile *f); int qemu_file_get_error_obj(QEMUFile *f, Error **errp); int qemu_file_get_error_obj_any(QEMUFile *f1, QEMUFile *f2, Error **errp); void qemu_file_set_error_obj(QEMUFile *f, int ret, Error *err); diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index ddc9c7b1a1..1baea16c96 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2166,7 +2166,7 @@ static void htab_save_first_pass(QEMUFile *f, SpaprMa= chineState *spapr, break; } } - } while ((index < htabslots) && !qemu_file_rate_limit(f)); + } while ((index < htabslots) && !migration_rate_exceeded(f)); =20 if (index >=3D htabslots) { assert(index =3D=3D htabslots); @@ -2237,7 +2237,7 @@ static int htab_save_later_pass(QEMUFile *f, SpaprMac= hineState *spapr, assert(index =3D=3D htabslots); index =3D 0; } - } while ((examined < htabslots) && (!qemu_file_rate_limit(f) || final)= ); + } while ((examined < htabslots) && (!migration_rate_exceeded(f) || fin= al)); =20 if (index >=3D htabslots) { assert(index =3D=3D htabslots); diff --git a/hw/s390x/s390-stattrib.c b/hw/s390x/s390-stattrib.c index aed919ad7d..220e845d12 100644 --- a/hw/s390x/s390-stattrib.c +++ b/hw/s390x/s390-stattrib.c @@ -209,7 +209,7 @@ static int cmma_save(QEMUFile *f, void *opaque, int fin= al) return -ENOMEM; } =20 - while (final ? 1 : qemu_file_rate_limit(f) =3D=3D 0) { + while (final ? 1 : migration_rate_exceeded(f) =3D=3D 0) { reallen =3D sac->get_stattr(sas, &start_gfn, buflen, buf); if (reallen < 0) { g_free(buf); diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c index 20f36e6bd8..032fc5f405 100644 --- a/migration/block-dirty-bitmap.c +++ b/migration/block-dirty-bitmap.c @@ -706,7 +706,7 @@ static void bulk_phase(QEMUFile *f, DBMSaveState *s, bo= ol limit) QSIMPLEQ_FOREACH(dbms, &s->dbms_list, entry) { while (!dbms->bulk_completed) { bulk_phase_send_chunk(f, s, dbms); - if (limit && qemu_file_rate_limit(f)) { + if (limit && migration_rate_exceeded(f)) { return; } } diff --git a/migration/block.c b/migration/block.c index 12617b4152..b9580a6c7e 100644 --- a/migration/block.c +++ b/migration/block.c @@ -23,6 +23,7 @@ #include "block/dirty-bitmap.h" #include "migration/misc.h" #include "migration.h" +#include "migration-stats.h" #include "migration/register.h" #include "qemu-file.h" #include "migration/vmstate.h" @@ -625,7 +626,7 @@ static int flush_blks(QEMUFile *f) =20 blk_mig_lock(); while ((blk =3D QSIMPLEQ_FIRST(&block_mig_state.blk_list)) !=3D NULL) { - if (qemu_file_rate_limit(f)) { + if (migration_rate_exceeded(f)) { break; } if (blk->ret < 0) { @@ -762,7 +763,7 @@ static int block_save_iterate(QEMUFile *f, void *opaque) /* control the rate of transfer */ blk_mig_lock(); while (block_mig_state.read_done * BLK_MIG_BLOCK_SIZE < - qemu_file_get_rate_limit(f) && + migration_rate_get() && block_mig_state.submitted < MAX_PARALLEL_IO && (block_mig_state.submitted + block_mig_state.read_done) < MAX_IO_BUFFERS) { diff --git a/migration/migration-stats.c b/migration/migration-stats.c index 2f2cea965c..0890220ba5 100644 --- a/migration/migration-stats.c +++ b/migration/migration-stats.c @@ -12,6 +12,50 @@ =20 #include "qemu/osdep.h" #include "qemu/stats64.h" +#include "qemu-file.h" #include "migration-stats.h" =20 MigrationAtomicStats mig_stats; + +bool migration_rate_exceeded(QEMUFile *f) +{ + if (qemu_file_get_error(f)) { + return true; + } + + uint64_t rate_limit_used =3D stat64_get(&mig_stats.rate_limit_used); + uint64_t rate_limit_max =3D stat64_get(&mig_stats.rate_limit_max); + + if (rate_limit_max =3D=3D RATE_LIMIT_DISABLED) { + return false; + } + if (rate_limit_max > 0 && rate_limit_used > rate_limit_max) { + return true; + } + return false; +} + +uint64_t migration_rate_get(void) +{ + return stat64_get(&mig_stats.rate_limit_max); +} + +#define XFER_LIMIT_RATIO (1000 / BUFFER_DELAY) + +void migration_rate_set(uint64_t limit) +{ + /* + * 'limit' is per second. But we check it each BUFER_DELAY milisecond= s. + */ + stat64_set(&mig_stats.rate_limit_max, limit / XFER_LIMIT_RATIO); +} + +void migration_rate_reset(void) +{ + stat64_set(&mig_stats.rate_limit_used, 0); +} + +void migration_rate_account(uint64_t len) +{ + stat64_add(&mig_stats.rate_limit_used, len); +} diff --git a/migration/migration.c b/migration/migration.c index 3ceaf29798..fc8974e274 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2120,7 +2120,7 @@ static int postcopy_start(MigrationState *ms) * will notice we're in POSTCOPY_ACTIVE and not actually * wrap their state up here */ - qemu_file_set_rate_limit(ms->to_dst_file, bandwidth); + migration_rate_set(bandwidth); if (migrate_postcopy_ram()) { /* Ping just for debugging, helps line traces up */ qemu_savevm_send_ping(ms->to_dst_file, 2); @@ -2304,7 +2304,7 @@ static void migration_completion(MigrationState *s) * them if migration fails or is cancelled. */ s->block_inactive =3D !migrate_colo(); - qemu_file_set_rate_limit(s->to_dst_file, RATE_LIMIT_DISABL= ED); + migration_rate_set(RATE_LIMIT_DISABLED); ret =3D qemu_savevm_state_complete_precopy(s->to_dst_file,= false, s->block_inactive= ); } @@ -2699,7 +2699,7 @@ static void migration_update_counters(MigrationState = *s, stat64_get(&mig_stats.dirty_bytes_last_sync) / bandwidth; } =20 - qemu_file_reset_rate_limit(s->to_dst_file); + migration_rate_reset(); =20 update_iteration_initial_status(s); =20 @@ -2852,7 +2852,7 @@ bool migration_rate_limit(void) =20 bool urgent =3D false; migration_update_counters(s, now); - if (qemu_file_rate_limit(s->to_dst_file)) { + if (migration_rate_exceeded(s->to_dst_file)) { =20 if (qemu_file_get_error(s->to_dst_file)) { return false; @@ -2974,7 +2974,7 @@ static void *migration_thread(void *opaque) trace_migration_thread_setup_complete(); =20 while (migration_is_active(s)) { - if (urgent || !qemu_file_rate_limit(s->to_dst_file)) { + if (urgent || !migration_rate_exceeded(s->to_dst_file)) { MigIterateState iter_state =3D migration_iteration_run(s); if (iter_state =3D=3D MIG_ITERATE_SKIP) { continue; @@ -3048,7 +3048,7 @@ static void *bg_migration_thread(void *opaque) rcu_register_thread(); object_ref(OBJECT(s)); =20 - qemu_file_set_rate_limit(s->to_dst_file, RATE_LIMIT_DISABLED); + migration_rate_set(RATE_LIMIT_DISABLED); =20 setup_start =3D qemu_clock_get_ms(QEMU_CLOCK_HOST); /* @@ -3220,7 +3220,7 @@ void migrate_fd_connect(MigrationState *s, Error *err= or_in) notifier_list_notify(&migration_state_notifiers, s); } =20 - qemu_file_set_rate_limit(s->to_dst_file, rate_limit); + migration_rate_set(rate_limit); qemu_file_set_blocking(s->to_dst_file, true); =20 /* diff --git a/migration/multifd.c b/migration/multifd.c index 5c4298eadf..5052091ce2 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -431,7 +431,7 @@ static int multifd_send_pages(QEMUFile *f) multifd_send_state->pages =3D p->pages; p->pages =3D pages; transferred =3D ((uint64_t) pages->num) * p->page_size + p->packet_len; - qemu_file_acct_rate_limit(f, transferred); + migration_rate_account(transferred); qemu_mutex_unlock(&p->mutex); stat64_add(&mig_stats.transferred, transferred); stat64_add(&mig_stats.multifd_bytes, transferred); diff --git a/migration/options.c b/migration/options.c index c2a278ee2d..b62ab30cd5 100644 --- a/migration/options.c +++ b/migration/options.c @@ -23,6 +23,7 @@ #include "migration/colo.h" #include "migration/misc.h" #include "migration.h" +#include "migration-stats.h" #include "qemu-file.h" #include "ram.h" #include "options.h" @@ -1242,8 +1243,7 @@ static void migrate_params_apply(MigrateSetParameters= *params, Error **errp) if (params->has_max_bandwidth) { s->parameters.max_bandwidth =3D params->max_bandwidth; if (s->to_dst_file && !migration_in_postcopy()) { - qemu_file_set_rate_limit(s->to_dst_file, - s->parameters.max_bandwidth); + migration_rate_set(s->parameters.max_bandwidth); } } =20 @@ -1272,8 +1272,7 @@ static void migrate_params_apply(MigrateSetParameters= *params, Error **errp) if (params->has_max_postcopy_bandwidth) { s->parameters.max_postcopy_bandwidth =3D params->max_postcopy_band= width; if (s->to_dst_file && migration_in_postcopy()) { - qemu_file_set_rate_limit(s->to_dst_file, - s->parameters.max_postcopy_bandwidth); + migration_rate_set(s->parameters.max_postcopy_bandwidth); } } if (params->has_max_cpu_throttle) { diff --git a/migration/qemu-file.c b/migration/qemu-file.c index 3d66c5c512..9c67b52fe0 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -41,17 +41,6 @@ struct QEMUFile { QIOChannel *ioc; bool is_writable; =20 - /* - * Maximum amount of data in bytes to transfer during one - * rate limiting time window - */ - uint64_t rate_limit_max; - /* - * Total amount of data in bytes queued for transfer - * during this rate limiting time window - */ - uint64_t rate_limit_used; - /* The sum of bytes transferred on the wire */ uint64_t total_transferred; =20 @@ -303,7 +292,7 @@ void qemu_fflush(QEMUFile *f) qemu_file_set_error_obj(f, -EIO, local_error); } else { uint64_t size =3D iov_size(f->iov, f->iovcnt); - qemu_file_acct_rate_limit(f, size); + migration_rate_account(size); f->total_transferred +=3D size; } =20 @@ -356,7 +345,7 @@ size_t ram_control_save_page(QEMUFile *f, ram_addr_t bl= ock_offset, int ret =3D f->hooks->save_page(f, block_offset, offset, size, bytes_sent); if (ret !=3D RAM_SAVE_CONTROL_NOT_SUPP) { - qemu_file_acct_rate_limit(f, size); + migration_rate_account(size); } =20 if (ret !=3D RAM_SAVE_CONTROL_DELAYED && @@ -727,43 +716,6 @@ uint64_t qemu_file_transferred(QEMUFile *f) return f->total_transferred; } =20 -int qemu_file_rate_limit(QEMUFile *f) -{ - if (qemu_file_get_error(f)) { - return 1; - } - if (f->rate_limit_max =3D=3D RATE_LIMIT_DISABLED) { - return 0; - } - if (f->rate_limit_used > f->rate_limit_max) { - return 1; - } - return 0; -} - -uint64_t qemu_file_get_rate_limit(QEMUFile *f) -{ - return f->rate_limit_max; -} - -void qemu_file_set_rate_limit(QEMUFile *f, uint64_t limit) -{ - /* - * 'limit' is per second. But we check it each 100 miliseconds. - */ - f->rate_limit_max =3D limit / XFER_LIMIT_RATIO; -} - -void qemu_file_reset_rate_limit(QEMUFile *f) -{ - f->rate_limit_used =3D 0; -} - -void qemu_file_acct_rate_limit(QEMUFile *f, uint64_t len) -{ - f->rate_limit_used +=3D len; -} - void qemu_put_be16(QEMUFile *f, unsigned int v) { qemu_put_byte(f, v >> 8); diff --git a/migration/ram.c b/migration/ram.c index f69d8d42b0..15cb15bceb 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -3116,7 +3116,7 @@ static int ram_save_iterate(QEMUFile *f, void *opaque) =20 t0 =3D qemu_clock_get_ns(QEMU_CLOCK_REALTIME); i =3D 0; - while ((ret =3D qemu_file_rate_limit(f)) =3D=3D 0 || + while ((ret =3D migration_rate_exceeded(f)) =3D=3D 0 || postcopy_has_request(rs)) { int pages; =20 diff --git a/migration/savevm.c b/migration/savevm.c index e33788343a..03795ce8dc 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1338,7 +1338,7 @@ int qemu_savevm_state_iterate(QEMUFile *f, bool postc= opy) !(se->ops->has_postcopy && se->ops->has_postcopy(se->opaque)))= { continue; } - if (qemu_file_rate_limit(f)) { + if (migration_rate_exceeded(f)) { return 0; } trace_savevm_section_start(se->idstr, se->section_id); diff --git a/migration/meson.build b/migration/meson.build index dc8b1daef5..b3d0c537c8 100644 --- a/migration/meson.build +++ b/migration/meson.build @@ -1,5 +1,6 @@ # Files needed by unit tests migration_files =3D files( + 'migration-stats.c', 'page_cache.c', 'xbzrle.c', 'vmstate-types.c', @@ -18,7 +19,6 @@ softmmu_ss.add(files( 'fd.c', 'global_state.c', 'migration-hmp-cmds.c', - 'migration-stats.c', 'migration.c', 'multifd.c', 'multifd-zlib.c', --=20 2.40.1 From nobody Sat May 18 08:46:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684430128; cv=none; d=zohomail.com; s=zohoarc; b=M3iTAdN8+baqMHDD3ksKKiKFxwEyRCNWfC4adGZRWM1/kh2dYvs3dqtgb0P+1Jx8LYrGiMfOsg6by3QnJRuJs5W4FE1u1xq96KVQvhuwoEpr/I57F++iXYqyBPBfwwKhpr5q0N5iL+B6JMYzgQ4ue1vWljtybKSkwvcBNKteo2Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684430128; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EGI5U92o7l0XyT2+/pZIYeiU7FO19U5jEFID4npkegc=; b=D7lkwzIvhG80w+rM2hjfoI12yIRmrhApIGG+LXVyXGOVKHbAl5/AsG4VX/I9jcTOYscvbOdvpIXYAXYHeF6mhPwooJ1J+US2LNt6iSNtaCtQmcs4sSP7LCabD6GFxTD4Q8PMVmEx7ZiOinQ3QHs/Gggqj/va2iBOT1OMWW7m1O8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684430128289759.163307575526; Thu, 18 May 2023 10:15:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzhCs-0008Jk-L8; Thu, 18 May 2023 13:14:26 -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 1pzhCr-00089A-KZ for qemu-devel@nongnu.org; Thu, 18 May 2023 13:14:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzhCp-0000tT-MV for qemu-devel@nongnu.org; Thu, 18 May 2023 13:14:25 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-468-oRbXf44rP82CC5VKrbSTYQ-1; Thu, 18 May 2023 13:14:18 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 535C685A588; Thu, 18 May 2023 17:14:00 +0000 (UTC) Received: from secure.mitica (unknown [10.39.194.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id 80A254078908; Thu, 18 May 2023 17:13:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684430063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EGI5U92o7l0XyT2+/pZIYeiU7FO19U5jEFID4npkegc=; b=hFQlevBicJONWs5k95VT9BKgtlQXhvXi+miGXNlH6zQRSaIw8BaT/EZjEHbyVEwdEJqkqd 8uHIdV4U0sSH+OQ/zyyeqmSc/DjRafZRfMB+0d5mkv5bZTIeLeNo2cMvedaVTAbyiyZe0r X4Rpn/FljSXM/gM/1jvdAYdIL+2PFRc= X-MC-Unique: oRbXf44rP82CC5VKrbSTYQ-1 From: Juan Quintela To: 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=20Lureau?= , Eric Farman , David Gibson , Ilya Leoshkevich , Fam Zheng , Vladimir Sementsov-Ogievskiy , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Greg Kurz , Juan Quintela , Halil Pasic , Paolo Bonzini , qemu-ppc@nongnu.org, Peter Xu , Harsh Prateek Bora , Hailiang Zhang , John Snow , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-block@nongnu.org, Eric Blake , Jason Wang , Richard Henderson , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 07/12] migration: Move migration_total_bytes() to migration-stats.c Date: Thu, 18 May 2023 19:12:59 +0200 Message-Id: <20230518171304.95006-8-quintela@redhat.com> In-Reply-To: <20230518171304.95006-1-quintela@redhat.com> References: <20230518171304.95006-1-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684430129061100005 Once there rename it to migration_transferred_bytes() and pass a QEMUFile instead of a migration object. Signed-off-by: Juan Quintela Reviewed-by: C=C3=A9dric Le Goater Message-Id: <20230515195709.63843-7-quintela@redhat.com> --- migration/migration-stats.h | 11 +++++++++++ migration/migration-stats.c | 5 +++++ migration/migration.c | 13 +++---------- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/migration/migration-stats.h b/migration/migration-stats.h index 7b64dc7cc2..827ea80c9b 100644 --- a/migration/migration-stats.h +++ b/migration/migration-stats.h @@ -133,4 +133,15 @@ void migration_rate_reset(void); * @new_rate: new maximum amount */ void migration_rate_set(uint64_t new_rate); + +/** + * migration_transferred_bytes: Return number of bytes transferred + * + * @f: QEMUFile used for main migration channel + * + * Returns how many bytes have we transferred since the beginning of + * the migration. It accounts for bytes sent through any migration + * channel, multifd, qemu_file, rdma, .... + */ +uint64_t migration_transferred_bytes(QEMUFile *f); #endif diff --git a/migration/migration-stats.c b/migration/migration-stats.c index 0890220ba5..39e98d6fa9 100644 --- a/migration/migration-stats.c +++ b/migration/migration-stats.c @@ -59,3 +59,8 @@ void migration_rate_account(uint64_t len) { stat64_add(&mig_stats.rate_limit_used, len); } + +uint64_t migration_transferred_bytes(QEMUFile *f) +{ + return qemu_file_transferred(f) + stat64_get(&mig_stats.multifd_bytes); +} diff --git a/migration/migration.c b/migration/migration.c index fc8974e274..952100c8d7 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2625,16 +2625,9 @@ static MigThrError migration_detect_error(MigrationS= tate *s) } } =20 -/* How many bytes have we transferred since the beginning of the migration= */ -static uint64_t migration_total_bytes(MigrationState *s) -{ - return qemu_file_transferred(s->to_dst_file) + - stat64_get(&mig_stats.multifd_bytes); -} - static void migration_calculate_complete(MigrationState *s) { - uint64_t bytes =3D migration_total_bytes(s); + uint64_t bytes =3D migration_transferred_bytes(s->to_dst_file); int64_t end_time =3D qemu_clock_get_ms(QEMU_CLOCK_REALTIME); int64_t transfer_time; =20 @@ -2660,7 +2653,7 @@ static void update_iteration_initial_status(Migration= State *s) * wrong speed calculation. */ s->iteration_start_time =3D qemu_clock_get_ms(QEMU_CLOCK_REALTIME); - s->iteration_initial_bytes =3D migration_total_bytes(s); + s->iteration_initial_bytes =3D migration_transferred_bytes(s->to_dst_f= ile); s->iteration_initial_pages =3D ram_get_total_transferred_pages(); } =20 @@ -2675,7 +2668,7 @@ static void migration_update_counters(MigrationState = *s, return; } =20 - current_bytes =3D migration_total_bytes(s); + current_bytes =3D migration_transferred_bytes(s->to_dst_file); transferred =3D current_bytes - s->iteration_initial_bytes; time_spent =3D current_time - s->iteration_start_time; bandwidth =3D (double)transferred / time_spent; --=20 2.40.1 From nobody Sat May 18 08:46:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684430152; cv=none; d=zohomail.com; s=zohoarc; b=e6s9ttZqqKmLdG0gFyy2szTnmOLphjiBJ03kWWeYKSvJjYN8PH0rLn9vshTFuTVRa4I8c6d/VOzZO4XvDuZVeuA/K6MHhQsbPdqIgHznUKNcqZbC1ycld4KntnG0xozABej5o4WNTeTIj3YptzwbeGkWbF6B1SiO9G/OYHwOcgY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684430152; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=odo2TCus3774e8X/ediiIVqjXa1IcGzjmTcApKzWtMY=; b=X1Po/SiWofo0TkpyyuZxGE8xsEJKg4l44M43qYztR4l0zp8IBVTLaxmfLwPczXuU6/zH8lGVj6lOCVnoD/7T6qd5JA/iaNmVqtNHo5xSBgtJK31qhmVdjkgqJqfiBy1kt0mwS9gJ1MGyDat8ll/ksum2U32a9VltOGZVi5RLikM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684430152041185.0676368793279; Thu, 18 May 2023 10:15:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzhD3-0000XF-Px; Thu, 18 May 2023 13:14:37 -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 1pzhD2-0000Ok-4T for qemu-devel@nongnu.org; Thu, 18 May 2023 13:14:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzhCx-0000v1-7A for qemu-devel@nongnu.org; Thu, 18 May 2023 13:14:35 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-381-8TzD7GNxP62jWAS1FmyXXQ-1; Thu, 18 May 2023 13:14:22 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EFE26831701; Thu, 18 May 2023 17:14:05 +0000 (UTC) Received: from secure.mitica (unknown [10.39.194.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9D59B40C6EC4; Thu, 18 May 2023 17:14:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684430069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=odo2TCus3774e8X/ediiIVqjXa1IcGzjmTcApKzWtMY=; b=hd9hWM8EsfleJhStQbm6skSSw5ZpjoNCHPXPev9t/oE+SjGbQ3O1EbK03U61/CNz2sNlPU cNB06CeCdfa2/07Z4XvvnQhZolD30X+C46cLXCpAGe07OudBKrdS+CSZJCHBzgZNXEy5qq EaByaDq84v3qh/amlHlXw3AHFT9SHHI= X-MC-Unique: 8TzD7GNxP62jWAS1FmyXXQ-1 From: Juan Quintela To: 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=20Lureau?= , Eric Farman , David Gibson , Ilya Leoshkevich , Fam Zheng , Vladimir Sementsov-Ogievskiy , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Greg Kurz , Juan Quintela , Halil Pasic , Paolo Bonzini , qemu-ppc@nongnu.org, Peter Xu , Harsh Prateek Bora , Hailiang Zhang , John Snow , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-block@nongnu.org, Eric Blake , Jason Wang , Richard Henderson , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 08/12] migration: Add a trace for migration_transferred_bytes Date: Thu, 18 May 2023 19:13:00 +0200 Message-Id: <20230518171304.95006-9-quintela@redhat.com> In-Reply-To: <20230518171304.95006-1-quintela@redhat.com> References: <20230518171304.95006-1-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684430153530100001 Signed-off-by: Juan Quintela Reviewed-by: C=C3=A9dric Le Goater Message-Id: <20230515195709.63843-8-quintela@redhat.com> --- migration/migration-stats.c | 7 ++++++- migration/trace-events | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/migration/migration-stats.c b/migration/migration-stats.c index 39e98d6fa9..feec7d7369 100644 --- a/migration/migration-stats.c +++ b/migration/migration-stats.c @@ -13,6 +13,7 @@ #include "qemu/osdep.h" #include "qemu/stats64.h" #include "qemu-file.h" +#include "trace.h" #include "migration-stats.h" =20 MigrationAtomicStats mig_stats; @@ -62,5 +63,9 @@ void migration_rate_account(uint64_t len) =20 uint64_t migration_transferred_bytes(QEMUFile *f) { - return qemu_file_transferred(f) + stat64_get(&mig_stats.multifd_bytes); + uint64_t multifd =3D stat64_get(&mig_stats.multifd_bytes); + uint64_t qemu_file =3D qemu_file_transferred(f); + + trace_migration_transferred_bytes(qemu_file, multifd); + return qemu_file + multifd; } diff --git a/migration/trace-events b/migration/trace-events index f39818c329..cdaef7a1ea 100644 --- a/migration/trace-events +++ b/migration/trace-events @@ -186,6 +186,9 @@ process_incoming_migration_co_end(int ret, int ps) "ret= =3D%d postcopy-state=3D%d" process_incoming_migration_co_postcopy_end_main(void) "" postcopy_preempt_enabled(bool value) "%d" =20 +# migration-stats +migration_transferred_bytes(uint64_t qemu_file, uint64_t multifd) "qemu_fi= le %" PRIu64 " multifd %" PRIu64 + # channel.c migration_set_incoming_channel(void *ioc, const char *ioctype) "ioc=3D%p i= octype=3D%s" migration_set_outgoing_channel(void *ioc, const char *ioctype, const char = *hostname, void *err) "ioc=3D%p ioctype=3D%s hostname=3D%s err=3D%p" --=20 2.40.1 From nobody Sat May 18 08:46:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684430159; cv=none; d=zohomail.com; s=zohoarc; b=EQH2i5SJZfxZybhg8cvzrZBKLqsOavwtD6lvBVMEeLXi7X61XcLbTacVz1OHWdho1s7Zd9fImr9/zrKmNLHAFUThR58XoOr+p96mq9w2DbzoWf/rNDeeMBmpm7Ix1a/vG6GCOMBKAq+hc1OTSW9QW9DYWWcfyX2WSP176KYieXU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684430159; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AjWEudMdh1T6laASbUZDoDLNI+iD6UdWKJzNhUcAbkw=; b=m71qvTl+al+PkpVUuGDM9r9mj6PF0U1kNLAP34MO1fStViTxUr4F4h7t9zH0niymNRZiMwIBjKZSSpcGcdGKAR8DoBQsrWlhK2jgkCvap4sARqcxf1XIzEByVUZG5mwMXnuGwmgCmarazsD8mRP1ieXKlxUe/BbYdtXdKXTBoTA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684430159332140.44093880336186; Thu, 18 May 2023 10:15:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzhD3-0000WB-Js; Thu, 18 May 2023 13:14:37 -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 1pzhD1-0000KA-EY for qemu-devel@nongnu.org; Thu, 18 May 2023 13:14:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzhCy-0000x3-DG for qemu-devel@nongnu.org; Thu, 18 May 2023 13:14:35 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-66-B-DbexnaPbyZ2c1LoPqvLw-1; Thu, 18 May 2023 13:14:27 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A454B3C0ED66; Thu, 18 May 2023 17:14:11 +0000 (UTC) Received: from secure.mitica (unknown [10.39.194.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id 46C62407890A; Thu, 18 May 2023 17:14:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684430071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AjWEudMdh1T6laASbUZDoDLNI+iD6UdWKJzNhUcAbkw=; b=GC7EaK/CvlYCjCY6V7y01zl07mokEPefeiBKboqA/WJmkSJfdNWTSOqdrU9VwG6/QRin6T /3l+oNnLMOwwfd79ptuosJ5sudMlodB8eTUBZqKswAk84clSby2tP4b+zHtiiw46Nib2Y3 CxNUbMM5ubLK6iUEuSw/HFf1uSbkdko= X-MC-Unique: B-DbexnaPbyZ2c1LoPqvLw-1 From: Juan Quintela To: 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=20Lureau?= , Eric Farman , David Gibson , Ilya Leoshkevich , Fam Zheng , Vladimir Sementsov-Ogievskiy , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Greg Kurz , Juan Quintela , Halil Pasic , Paolo Bonzini , qemu-ppc@nongnu.org, Peter Xu , Harsh Prateek Bora , Hailiang Zhang , John Snow , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-block@nongnu.org, Eric Blake , Jason Wang , Richard Henderson , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 09/12] migration: Use migration_transferred_bytes() to calculate rate_limit Date: Thu, 18 May 2023 19:13:01 +0200 Message-Id: <20230518171304.95006-10-quintela@redhat.com> In-Reply-To: <20230518171304.95006-1-quintela@redhat.com> References: <20230518171304.95006-1-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684430160172100001 Signed-off-by: Juan Quintela Reviewed-by: C=C3=A9dric Le Goater Message-Id: <20230515195709.63843-9-quintela@redhat.com> --- migration/migration-stats.h | 8 +++++++- migration/migration-stats.c | 7 +++++-- migration/migration.c | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/migration/migration-stats.h b/migration/migration-stats.h index 827ea80c9b..4c4daa2e97 100644 --- a/migration/migration-stats.h +++ b/migration/migration-stats.h @@ -81,6 +81,10 @@ typedef struct { * Number of bytes sent during precopy stage. */ Stat64 precopy_bytes; + /* + * Amount of transferred data at the start of current cycle. + */ + Stat64 rate_limit_start; /* * Maximum amount of data we can send in a cycle. */ @@ -122,8 +126,10 @@ uint64_t migration_rate_get(void); * migration_rate_reset: Reset the rate limit counter. * * This is called when we know we start a new transfer cycle. + * + * @f: QEMUFile used for main migration channel */ -void migration_rate_reset(void); +void migration_rate_reset(QEMUFile *f); =20 /** * migration_rate_set: Set the maximum amount that can be transferred. 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; } =20 - uint64_t rate_limit_used =3D stat64_get(&mig_stats.rate_limit_used); + uint64_t rate_limit_start =3D stat64_get(&mig_stats.rate_limit_start); + uint64_t rate_limit_current =3D migration_transferred_bytes(f); + uint64_t rate_limit_used =3D rate_limit_current - rate_limit_start; uint64_t rate_limit_max =3D stat64_get(&mig_stats.rate_limit_max); =20 if (rate_limit_max =3D=3D RATE_LIMIT_DISABLED) { @@ -51,9 +53,10 @@ void migration_rate_set(uint64_t limit) stat64_set(&mig_stats.rate_limit_max, limit / XFER_LIMIT_RATIO); } =20 -void migration_rate_reset(void) +void migration_rate_reset(QEMUFile *f) { stat64_set(&mig_stats.rate_limit_used, 0); + stat64_set(&mig_stats.rate_limit_start, migration_transferred_bytes(f)= ); } =20 void migration_rate_account(uint64_t len) diff --git a/migration/migration.c b/migration/migration.c index 952100c8d7..5de7f734b9 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2692,7 +2692,7 @@ static void migration_update_counters(MigrationState = *s, stat64_get(&mig_stats.dirty_bytes_last_sync) / bandwidth; } =20 - migration_rate_reset(); + migration_rate_reset(s->to_dst_file); =20 update_iteration_initial_status(s); =20 --=20 2.40.1 From nobody Sat May 18 08:46:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684430135; cv=none; d=zohomail.com; s=zohoarc; b=JqK6YdpSGKUPf0d1lCixV3yWVc0sRGwA0kdowVIKchz8XCcjsBWJGrs4oeZqQG0V0Y4Qxu/akLiFf1xzdJJyzpBlNdshHPqcJ+ONV2HpzxTpYW0ReNnBnDyO0izyWrxdmXKm7VUEhZMkfznGeaElCPJHetAgQU64kMdZTATzMxA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684430135; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZXwlxXfFk5NHyuG0EoqN0HwcGq55CrucUsfVYNjaXwI=; b=nzgoXgVqw5WLPPCIrYHgQ1Vb3yliCfbUPbRdhVSA1gMVNQFmoYCC45ZVhWX46kKKEmAjQmQH5CE4zEaygut43w3S/PglS8ADVsoxHEB4eN/4ljq952larlkxCLJXKTr+bF63YfjpQhhZBHugX3jzHyiWQUeNecaQU/6H1Y1oTfo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684430135366411.58285120628227; Thu, 18 May 2023 10:15:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzhDT-0002Un-Hm; Thu, 18 May 2023 13:15:03 -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 1pzhDR-0002J7-6Z for qemu-devel@nongnu.org; Thu, 18 May 2023 13:15:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzhDO-00012s-DY for qemu-devel@nongnu.org; Thu, 18 May 2023 13:15:00 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-201-XtyCXbmYNoeS8X8A--wtag-1; Thu, 18 May 2023 13:14:52 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A284B89109A; Thu, 18 May 2023 17:14:16 +0000 (UTC) Received: from secure.mitica (unknown [10.39.194.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB4A940C6EC4; Thu, 18 May 2023 17:14:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684430097; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZXwlxXfFk5NHyuG0EoqN0HwcGq55CrucUsfVYNjaXwI=; b=V6mxqOUAR+MrYz1WJvVy8I/yy6uGytrLT7HZKQCWRVmq8SALgIi3is8Vuy3/BfxHvUz/qP cvz/Yk79X01QAAsOwwMVYkDd+cjDoU75ZzxgKCz6gRQTwaCk7rayQTcQSd2nC1mOGYe7E5 F4hRlAE1VO90bZ4ewQE8+LXkS5YOq7A= X-MC-Unique: XtyCXbmYNoeS8X8A--wtag-1 From: Juan Quintela To: 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=20Lureau?= , Eric Farman , David Gibson , Ilya Leoshkevich , Fam Zheng , Vladimir Sementsov-Ogievskiy , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Greg Kurz , Juan Quintela , Halil Pasic , Paolo Bonzini , qemu-ppc@nongnu.org, Peter Xu , Harsh Prateek Bora , Hailiang Zhang , John Snow , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-block@nongnu.org, Eric Blake , Jason Wang , Richard Henderson , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 10/12] migration: We don't need the field rate_limit_used anymore Date: Thu, 18 May 2023 19:13:02 +0200 Message-Id: <20230518171304.95006-11-quintela@redhat.com> In-Reply-To: <20230518171304.95006-1-quintela@redhat.com> References: <20230518171304.95006-1-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684430137060100001 Since previous commit, we calculate how much data we have send with migration_transferred_bytes() so no need to maintain this counter and remember to always update it. Signed-off-by: Juan Quintela Reviewed-by: C=C3=A9dric Le Goater Message-Id: <20230515195709.63843-10-quintela@redhat.com> --- migration/migration-stats.h | 14 -------------- migration/migration-stats.c | 6 ------ migration/multifd.c | 1 - migration/qemu-file.c | 4 ---- 4 files changed, 25 deletions(-) diff --git a/migration/migration-stats.h b/migration/migration-stats.h index 4c4daa2e97..ac2260e987 100644 --- a/migration/migration-stats.h +++ b/migration/migration-stats.h @@ -89,10 +89,6 @@ typedef struct { * Maximum amount of data we can send in a cycle. */ Stat64 rate_limit_max; - /* - * Amount of data we have sent in the current cycle. - */ - Stat64 rate_limit_used; /* * Total number of bytes transferred. */ @@ -105,16 +101,6 @@ typedef struct { =20 extern MigrationAtomicStats mig_stats; =20 -/** - * migration_rate_account: Increase the number of bytes transferred. - * - * Report on a number of bytes the have been transferred that need to - * be applied to the rate limiting calcuations. - * - * @len: amount of bytes transferred - */ -void migration_rate_account(uint64_t len); - /** * migration_rate_get: Get the maximum amount that can be transferred. * diff --git a/migration/migration-stats.c b/migration/migration-stats.c index 97759a45f3..f98c8260be 100644 --- a/migration/migration-stats.c +++ b/migration/migration-stats.c @@ -55,15 +55,9 @@ void migration_rate_set(uint64_t limit) =20 void migration_rate_reset(QEMUFile *f) { - stat64_set(&mig_stats.rate_limit_used, 0); stat64_set(&mig_stats.rate_limit_start, migration_transferred_bytes(f)= ); } =20 -void migration_rate_account(uint64_t len) -{ - stat64_add(&mig_stats.rate_limit_used, len); -} - uint64_t migration_transferred_bytes(QEMUFile *f) { uint64_t multifd =3D stat64_get(&mig_stats.multifd_bytes); diff --git a/migration/multifd.c b/migration/multifd.c index 5052091ce2..aabf9b6d98 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -431,7 +431,6 @@ static int multifd_send_pages(QEMUFile *f) multifd_send_state->pages =3D p->pages; p->pages =3D pages; transferred =3D ((uint64_t) pages->num) * p->page_size + p->packet_len; - migration_rate_account(transferred); qemu_mutex_unlock(&p->mutex); stat64_add(&mig_stats.transferred, transferred); stat64_add(&mig_stats.multifd_bytes, transferred); diff --git a/migration/qemu-file.c b/migration/qemu-file.c index 9c67b52fe0..acc282654a 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -292,7 +292,6 @@ void qemu_fflush(QEMUFile *f) qemu_file_set_error_obj(f, -EIO, local_error); } else { uint64_t size =3D iov_size(f->iov, f->iovcnt); - migration_rate_account(size); f->total_transferred +=3D size; } =20 @@ -344,9 +343,6 @@ size_t ram_control_save_page(QEMUFile *f, ram_addr_t bl= ock_offset, if (f->hooks && f->hooks->save_page) { int ret =3D f->hooks->save_page(f, block_offset, offset, size, bytes_sent); - if (ret !=3D RAM_SAVE_CONTROL_NOT_SUPP) { - migration_rate_account(size); - } =20 if (ret !=3D RAM_SAVE_CONTROL_DELAYED && ret !=3D RAM_SAVE_CONTROL_NOT_SUPP) { --=20 2.40.1 From nobody Sat May 18 08:46:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684430135; cv=none; d=zohomail.com; s=zohoarc; b=GMJGqNZANet/KIbqyon/jFkO/YykJCQ8NzHhizPAZc4Sq3Io1azDd+KaCDUl5SXyBDA51lUMVkFBSJUsyQE29TawLxWDqFG1gNt/0CUwN1KF/uMuDBWZ8b3Vsax0obTgkDxGkfjqHJgp51kkv4BbjP3vzEQ9UuorqJJMVLVB+Fk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684430135; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=A1DmKRXTxVqsPIoMCXcdmQdE2wVAoC7wsmYiOVCHhwY=; b=TDROgqGUVIar/+IICOn0dFgXeGJFW2ry4kLF/jHmIDm4FLzbMiKxBb1Q1wptr3+bStqtE8zW7JkqmYurjLFYRBU5duO+8zbn6pGPSBTxxvfpmyrQiTzTog3ekFmlHpf9lnHbFI72c9/a/haBXa0cuSUjh/N7lHgz71RTfOT85FY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684430135279173.4764502591487; Thu, 18 May 2023 10:15:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzhDQ-0002GX-Vb; Thu, 18 May 2023 13:15:01 -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 1pzhDO-0001wM-Tv for qemu-devel@nongnu.org; Thu, 18 May 2023 13:14:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzhDL-00011j-I4 for qemu-devel@nongnu.org; Thu, 18 May 2023 13:14:58 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-608-4g2t3OV6MM2ggRGhqUTQ-A-1; Thu, 18 May 2023 13:14:51 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BCC323810B26; Thu, 18 May 2023 17:14:21 +0000 (UTC) Received: from secure.mitica (unknown [10.39.194.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id F03544078908; Thu, 18 May 2023 17:14:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684430094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=A1DmKRXTxVqsPIoMCXcdmQdE2wVAoC7wsmYiOVCHhwY=; b=SxGbKhvglbuPtYLKJs9xBsqmyIbrnnwqQUGn6mB32LLjdFzvNKC9gzemDV4UvfnQLMuGgb wZ0JXTxxxPADan9KeEYKZ7hhEYNH9k/rf19GNpMoRoSzwNMoaKx/egoIGVi7M+3mpa4uAI ncViyk8vRg6P4kgrVByiteiI+Kv1M70= X-MC-Unique: 4g2t3OV6MM2ggRGhqUTQ-A-1 From: Juan Quintela To: 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=20Lureau?= , Eric Farman , David Gibson , Ilya Leoshkevich , Fam Zheng , Vladimir Sementsov-Ogievskiy , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Greg Kurz , Juan Quintela , Halil Pasic , Paolo Bonzini , qemu-ppc@nongnu.org, Peter Xu , Harsh Prateek Bora , Hailiang Zhang , John Snow , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-block@nongnu.org, Eric Blake , Jason Wang , Richard Henderson , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 11/12] migration/multifd: Compute transferred bytes correctly Date: Thu, 18 May 2023 19:13:03 +0200 Message-Id: <20230518171304.95006-12-quintela@redhat.com> In-Reply-To: <20230518171304.95006-1-quintela@redhat.com> References: <20230518171304.95006-1-quintela@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684430137060100002 Content-Type: text/plain; charset="utf-8" In the past, we had to put the in the main thread all the operations related with sizes due to qemu_file not beeing thread safe. As now all counters are atomic, we can update the counters just after the do the write. As an aditional bonus, we are able to use the right value for the compression methods. Right now we were assuming that there were no compression at all. Signed-off-by: Juan Quintela Reviewed-by: Peter Xu Message-Id: <20230515195709.63843-17-quintela@redhat.com> --- migration/multifd.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/migration/multifd.c b/migration/multifd.c index aabf9b6d98..0bf5958a9c 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -175,6 +175,7 @@ void multifd_register_ops(int method, MultiFDMethods *o= ps) static int multifd_send_initial_packet(MultiFDSendParams *p, Error **errp) { MultiFDInit_t msg =3D {}; + size_t size =3D sizeof(msg); int ret; =20 msg.magic =3D cpu_to_be32(MULTIFD_MAGIC); @@ -182,10 +183,12 @@ static int multifd_send_initial_packet(MultiFDSendPar= ams *p, Error **errp) msg.id =3D p->id; memcpy(msg.uuid, &qemu_uuid.data, sizeof(msg.uuid)); =20 - ret =3D qio_channel_write_all(p->c, (char *)&msg, sizeof(msg), errp); + ret =3D qio_channel_write_all(p->c, (char *)&msg, size, errp); if (ret !=3D 0) { return -1; } + stat64_add(&mig_stats.multifd_bytes, size); + stat64_add(&mig_stats.transferred, size); return 0; } =20 @@ -395,7 +398,6 @@ static int multifd_send_pages(QEMUFile *f) static int next_channel; MultiFDSendParams *p =3D NULL; /* make happy gcc */ MultiFDPages_t *pages =3D multifd_send_state->pages; - uint64_t transferred; =20 if (qatomic_read(&multifd_send_state->exiting)) { return -1; @@ -430,10 +432,7 @@ static int multifd_send_pages(QEMUFile *f) p->packet_num =3D multifd_send_state->packet_num++; multifd_send_state->pages =3D p->pages; p->pages =3D pages; - transferred =3D ((uint64_t) pages->num) * p->page_size + p->packet_len; qemu_mutex_unlock(&p->mutex); - stat64_add(&mig_stats.transferred, transferred); - stat64_add(&mig_stats.multifd_bytes, transferred); qemu_sem_post(&p->sem); =20 return 1; @@ -715,6 +714,8 @@ static void *multifd_send_thread(void *opaque) if (ret !=3D 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 =3D p->packet_len; @@ -727,6 +728,8 @@ static void *multifd_send_thread(void *opaque) break; } =20 + stat64_add(&mig_stats.multifd_bytes, p->next_packet_size); + stat64_add(&mig_stats.transferred, p->next_packet_size); qemu_mutex_lock(&p->mutex); p->pending_job--; qemu_mutex_unlock(&p->mutex); --=20 2.40.1 From nobody Sat May 18 08:46:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684430118; cv=none; d=zohomail.com; s=zohoarc; b=aWRQcceHp25XlZJvaJq4ooOjYhlM/l8Oz18dMe7P5NDn4p1gjOwSu6Ce/BCaqv3jpQcI7hqKkS+tcIchPWzlrsFtxndqf6fcfNKj4hSUX/7yPCUXT6h7QVVE1WAOhXbvewF5/60B0n4RZWMzKksnv9Knuao86N+3I76k6KqTx0M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684430118; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cASQemPNNkl0p3N5MZKrqUdqk472MMfSyzxdU1hk/0M=; b=jeYOwnm0V0+MPqXZS9M9j86IFa5dzT/6c2H1m3hi5XeM6hM6ZF0WlsvM2zacmBcthuMmBO3znIu6sxIZmdwFIxA+9hK3VCx9R0loeANnLDXtYad0YRpC8jv3yGc6XHYSi60wdpBSgQIB5CxfyhLLLN/O1UAZY5UC/IQNEu1Kc+U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684430118742311.73172015543264; Thu, 18 May 2023 10:15:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzhDS-0002N3-Vq; Thu, 18 May 2023 13:15:03 -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 1pzhDQ-00028c-5C for qemu-devel@nongnu.org; Thu, 18 May 2023 13:15:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzhDN-00012Q-QB for qemu-devel@nongnu.org; Thu, 18 May 2023 13:14:59 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-251-FA_f1k0bPNGnFC3yqDiq1w-1; Thu, 18 May 2023 13:14:51 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BE0B81825061; Thu, 18 May 2023 17:14:26 +0000 (UTC) Received: from secure.mitica (unknown [10.39.194.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1BC014078908; Thu, 18 May 2023 17:14:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684430096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cASQemPNNkl0p3N5MZKrqUdqk472MMfSyzxdU1hk/0M=; b=JdjS65ilr4b/bAFaTZKbQgFuQUCeX/WkMOykOLSuhyevUR1ChcKUNjYZTHmwaqG3cH7zmk 5QOGRT/NqWWLXboCJEff+TR+vwCFPBTaLRHTbJR7UtXoCTFkrfb1ojHoJmxAleAm5GXnJZ zfV0s/sMaAX2L9Xqg9emOov2UE2ghjc= X-MC-Unique: FA_f1k0bPNGnFC3yqDiq1w-1 From: Juan Quintela To: 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=20Lureau?= , Eric Farman , David Gibson , Ilya Leoshkevich , Fam Zheng , Vladimir Sementsov-Ogievskiy , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Greg Kurz , Juan Quintela , Halil Pasic , Paolo Bonzini , qemu-ppc@nongnu.org, Peter Xu , Harsh Prateek Bora , Hailiang Zhang , John Snow , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-block@nongnu.org, Eric Blake , Jason Wang , Richard Henderson , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL 12/12] migration: Fix duplicated included in meson.build Date: Thu, 18 May 2023 19:13:04 +0200 Message-Id: <20230518171304.95006-13-quintela@redhat.com> In-Reply-To: <20230518171304.95006-1-quintela@redhat.com> References: <20230518171304.95006-1-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684430120881100003 This is the commint with the merge error (not in the submited patch). commit 52623f23b0d114837a0d6278180b3e3ae8947117 Author: Lukas Straub Date: Thu Apr 20 11:48:35 2023 +0200 ram-compress.c: Make target independent Make ram-compress.c target independent. Fixes: 52623f23b0d114837a0d6278180b3e3ae8947117 Signed-off-by: Juan Quintela Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Peter Xu Message-Id: <20230509170217.83246-1-quintela@redhat.com> --- migration/meson.build | 1 - 1 file changed, 1 deletion(-) diff --git a/migration/meson.build b/migration/meson.build index b3d0c537c8..a8e01e70ae 100644 --- a/migration/meson.build +++ b/migration/meson.build @@ -22,7 +22,6 @@ softmmu_ss.add(files( 'migration.c', 'multifd.c', 'multifd-zlib.c', - 'multifd-zlib.c', 'ram-compress.c', 'options.c', 'postcopy-ram.c', --=20 2.40.1