From nobody Thu Apr 25 17:18:19 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1675066036; cv=none; d=zohomail.com; s=zohoarc; b=VKLqgJPUtx/z05YIOwtNK6WRY28EjFMkgce5ZpndE9DPCXIlU3lWBBRu7lt2k1hxg4wcTowFkCiFNNFIqlYeQMwPe0Twj7SYU4by+/xvAqAJOWaTJIwKsiT/UnJuQ64KV9ZiGVPw2o3f9NxLv2nRSJJWYus+C2o5gcdjSc9piDo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675066036; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=eWeT3xfbFlbzNACmTdGovKL/sOatcR1HKGVEFm0pv8M=; b=Nrf7wLkJ8gSg1RoN/sku+9aWqM8SPlu/6HGYa6chm9KJEtUARz5mG9iN3RcpuU1sU+5QVXMoO/fsfg98sfGriPKnM9nquDp7PcJuNSMEOKLfWmLyXos0+nztT4v+P9JtvtJYsgD4Cm3RJSURJcVDD570Yj3EKhBMbiX7ALGRBgY= 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+importer2=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 1675066036491120.756880027036; Mon, 30 Jan 2023 00:07:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMPBU-0007Tm-5s; Mon, 30 Jan 2023 03:06:36 -0500 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 1pMPBS-0007SH-IB for qemu-devel@nongnu.org; Mon, 30 Jan 2023 03:06:34 -0500 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 1pMPBP-0001k9-Pq for qemu-devel@nongnu.org; Mon, 30 Jan 2023 03:06:34 -0500 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-9-XMsCB3mfNTaUdXR1PS7Qgg-1; Mon, 30 Jan 2023 03:06:20 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E86AA3C0E453; Mon, 30 Jan 2023 08:06:18 +0000 (UTC) Received: from secure.mitica (unknown [10.39.192.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id B49DDC15BAD; Mon, 30 Jan 2023 08:06:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675065991; 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; bh=eWeT3xfbFlbzNACmTdGovKL/sOatcR1HKGVEFm0pv8M=; b=iJsYZONFcKJlRbHwpnsO6MY6zx1vn2SzUio058xM/GGVoc82SJePBHGW1QtLhWpKJF5eZH iTl0Nio5U7ZkyNxkaFMesfHBo8F9xIaS8OyMUBg3csuhg73TH9ZYJQSMLsQicB0Y4Iztiy mtfC55l84EcMp7ChoNI+zOxucOt9cXU= X-MC-Unique: XMsCB3mfNTaUdXR1PS7Qgg-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Jason Wang , qemu-arm@nongnu.org, Hanna Reitz , Juan Quintela , Halil Pasic , Eric Blake , Michael Tokarev , Fam Zheng , David Hildenbrand , Alex Williamson , John Snow , Stefan Hajnoczi , Ilya Leoshkevich , "Michael S. Tsirkin" , "Gonglei (Arei)" , Eric Farman , qemu-s390x@nongnu.org, Kevin Wolf , qemu-block@nongnu.org, Pavel Dovgalyuk , Laurent Vivier , Christian Borntraeger , Gerd Hoffmann , Thomas Huth , Mathieu Poirier , Peter Maydell , Viresh Kumar , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Eduardo Habkost , Vladimir Sementsov-Ogievskiy , Klaus Jensen , Raphael Norwitz , Laurent Vivier , Xiaojuan Yang , "Dr. David Alan Gilbert" , Keith Busch , Thomas Huth , Song Gao , Richard Henderson , Paolo Bonzini , qemu-trivial@nongnu.org, virtio-fs@redhat.com Subject: [PATCH v3] migration: Remove res_compatible parameter Date: Mon, 30 Jan 2023 09:06:08 +0100 Message-Id: <20230130080608.2100-1-quintela@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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+importer2=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, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1675066037425100003 Content-Type: text/plain; charset="utf-8" It was only used for RAM, and in that case, it means that this amount of data was sent for memory. Just delete the field in all callers. [Rest of the pages on the vfio series are already on my previous pull reque= st] Signed-off-by: Juan Quintela --- include/migration/register.h | 27 ++++++++++++--------------- migration/savevm.h | 10 ++++------ hw/s390x/s390-stattrib.c | 8 +++----- hw/vfio/migration.c | 10 ++++------ migration/block-dirty-bitmap.c | 7 +++---- migration/block.c | 8 +++----- migration/migration.c | 18 ++++++++---------- migration/ram.c | 20 ++++++++------------ migration/savevm.c | 28 ++++++++++------------------ hw/vfio/trace-events | 2 +- migration/trace-events | 4 ++-- 11 files changed, 58 insertions(+), 84 deletions(-) diff --git a/include/migration/register.h b/include/migration/register.h index b91a0cdbf8..5ef6b903ed 100644 --- a/include/migration/register.h +++ b/include/migration/register.h @@ -47,25 +47,22 @@ typedef struct SaveVMHandlers { /* This runs outside the iothread lock! */ int (*save_setup)(QEMUFile *f, void *opaque); /* Note for save_live_pending: - * - res_precopy_only is for data which must be migrated in precopy ph= ase - * or in stopped state, in other words - before target vm start - * - res_compatible is for data which may be migrated in any phase - * - res_postcopy_only is for data which must be migrated in postcopy = phase - * or in stopped state, in other words - after source vm stop + * - res_precopy is for data which must be migrated in precopy + * phase or in stopped state, in other words - before target + * vm start + * - res_postcopy is for data which must be migrated in postcopy + * phase or in stopped state, in other words - after source vm + * stop * - * Sum of res_postcopy_only, res_compatible and res_postcopy_only is t= he - * whole amount of pending data. + * Sum of res_precopy and res_postcopy is the whole amount of + * pending data. */ /* This estimates the remaining data to transfer */ - void (*state_pending_estimate)(void *opaque, - uint64_t *res_precopy_only, - uint64_t *res_compatible, - uint64_t *res_postcopy_only); + void (*state_pending_estimate)(void *opaque, uint64_t *res_precopy, + uint64_t *res_postcopy); /* This calculate the exact remaining data to transfer */ - void (*state_pending_exact)(void *opaque, - uint64_t *res_precopy_only, - uint64_t *res_compatible, - uint64_t *res_postcopy_only); + void (*state_pending_exact)(void *opaque, uint64_t *res_precopy, + uint64_t *res_postcopy); LoadStateHandler *load_state; int (*load_setup)(QEMUFile *f, void *opaque); int (*load_cleanup)(void *opaque); diff --git a/migration/savevm.h b/migration/savevm.h index b1901e68d5..3f51588341 100644 --- a/migration/savevm.h +++ b/migration/savevm.h @@ -40,12 +40,10 @@ void qemu_savevm_state_cleanup(void); void qemu_savevm_state_complete_postcopy(QEMUFile *f); int qemu_savevm_state_complete_precopy(QEMUFile *f, bool iterable_only, bool inactivate_disks); -void qemu_savevm_state_pending_exact(uint64_t *res_precopy_only, - uint64_t *res_compatible, - uint64_t *res_postcopy_only); -void qemu_savevm_state_pending_estimate(uint64_t *res_precopy_only, - uint64_t *res_compatible, - uint64_t *res_postcopy_only); +void qemu_savevm_state_pending_exact(uint64_t *res_precopy, + uint64_t *res_postcopy); +void qemu_savevm_state_pending_estimate(uint64_t *res_precopy,=20 + uint64_t *res_postcopy); void qemu_savevm_send_ping(QEMUFile *f, uint32_t value); void qemu_savevm_send_open_return_path(QEMUFile *f); int qemu_savevm_send_packaged(QEMUFile *f, const uint8_t *buf, size_t len); diff --git a/hw/s390x/s390-stattrib.c b/hw/s390x/s390-stattrib.c index f1ee2c65bb..b5f8f6d1b9 100644 --- a/hw/s390x/s390-stattrib.c +++ b/hw/s390x/s390-stattrib.c @@ -182,17 +182,15 @@ static int cmma_save_setup(QEMUFile *f, void *opaque) return 0; } =20 -static void cmma_state_pending(void * opaque, - uint64_t *res_precopy_only, - uint64_t *res_compatible, - uint64_t *res_postcopy_only) +static void cmma_state_pending(void * opaque, uint64_t *res_precopy, + uint64_t *res_postcopy) { S390StAttribState *sas =3D S390_STATTRIB(opaque); S390StAttribClass *sac =3D S390_STATTRIB_GET_CLASS(sas); long long res =3D sac->get_dirtycount(sas); =20 if (res >=3D 0) { - *res_precopy_only +=3D res; + *res_precopy +=3D res; } } =20 diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index b3318f0f20..d0f7459607 100644 --- a/hw/vfio/migration.c +++ b/hw/vfio/migration.c @@ -457,9 +457,8 @@ static void vfio_save_cleanup(void *opaque) } =20 static void vfio_state_pending(void *opaque, - uint64_t *res_precopy_only, - uint64_t *res_compatible, - uint64_t *res_postcopy_only) + uint64_t *res_precopy, + uint64_t *res_postcopy) { VFIODevice *vbasedev =3D opaque; VFIOMigration *migration =3D vbasedev->migration; @@ -470,10 +469,9 @@ static void vfio_state_pending(void *opaque, return; } =20 - *res_precopy_only +=3D migration->pending_bytes; + *res_precopy +=3D migration->pending_bytes; =20 - trace_vfio_state_pending(vbasedev->name, *res_precopy_only, - *res_postcopy_only, *res_compatible); + trace_vfio_state_pending(vbasedev->name, *res_precopy, *res_postcopy); } =20 static int vfio_save_iterate(QEMUFile *f, void *opaque) diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c index 5a621419d3..793bf4347d 100644 --- a/migration/block-dirty-bitmap.c +++ b/migration/block-dirty-bitmap.c @@ -763,9 +763,8 @@ static int dirty_bitmap_save_complete(QEMUFile *f, void= *opaque) } =20 static void dirty_bitmap_state_pending(void *opaque, - uint64_t *res_precopy_only, - uint64_t *res_compatible, - uint64_t *res_postcopy_only) + uint64_t *res_precopy, + uint64_t *res_postcopy) { DBMSaveState *s =3D &((DBMState *)opaque)->save; SaveBitmapState *dbms; @@ -785,7 +784,7 @@ static void dirty_bitmap_state_pending(void *opaque, =20 trace_dirty_bitmap_state_pending(pending); =20 - *res_postcopy_only +=3D pending; + *res_postcopy +=3D pending; } =20 /* First occurrence of this bitmap. It should be created if doesn't exist = */ diff --git a/migration/block.c b/migration/block.c index 29f69025af..21bcf560e0 100644 --- a/migration/block.c +++ b/migration/block.c @@ -863,10 +863,8 @@ static int block_save_complete(QEMUFile *f, void *opaq= ue) return 0; } =20 -static void block_state_pending(void *opaque, - uint64_t *res_precopy_only, - uint64_t *res_compatible, - uint64_t *res_postcopy_only) +static void block_state_pending(void *opaque, uint64_t *res_precopy, + uint64_t *res_postcopy) { /* Estimate pending number of bytes to send */ uint64_t pending; @@ -887,7 +885,7 @@ static void block_state_pending(void *opaque, =20 trace_migration_block_state_pending(pending); /* We don't do postcopy */ - *res_precopy_only +=3D pending; + *res_precopy +=3D pending; } =20 static int block_load(QEMUFile *f, void *opaque, int version_id) diff --git a/migration/migration.c b/migration/migration.c index 644c61e91d..79963983d3 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -3748,20 +3748,18 @@ typedef enum { */ static MigIterateState migration_iteration_run(MigrationState *s) { - uint64_t pend_pre, pend_compat, pend_post; + uint64_t pend_pre, pend_post; bool in_postcopy =3D s->state =3D=3D MIGRATION_STATUS_POSTCOPY_ACTIVE; =20 - qemu_savevm_state_pending_estimate(&pend_pre, &pend_compat, &pend_post= ); - uint64_t pending_size =3D pend_pre + pend_compat + pend_post; + qemu_savevm_state_pending_estimate(&pend_pre, &pend_post); + uint64_t pending_size =3D pend_pre + pend_post; =20 - trace_migrate_pending_estimate(pending_size, - pend_pre, pend_compat, pend_post); + trace_migrate_pending_estimate(pending_size, pend_pre, pend_post); =20 - if (pend_pre + pend_compat <=3D s->threshold_size) { - qemu_savevm_state_pending_exact(&pend_pre, &pend_compat, &pend_pos= t); - pending_size =3D pend_pre + pend_compat + pend_post; - trace_migrate_pending_exact(pending_size, - pend_pre, pend_compat, pend_post); + if (pend_pre <=3D s->threshold_size) { + qemu_savevm_state_pending_exact(&pend_pre, &pend_post); + pending_size =3D pend_pre + pend_post; + trace_migrate_pending_exact(pending_size, pend_pre, pend_post); } =20 if (pending_size < s->threshold_size) { diff --git a/migration/ram.c b/migration/ram.c index 885d7dbf23..779bebf648 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -3409,10 +3409,8 @@ static int ram_save_complete(QEMUFile *f, void *opaq= ue) return 0; } =20 -static void ram_state_pending_estimate(void *opaque, - uint64_t *res_precopy_only, - uint64_t *res_compatible, - uint64_t *res_postcopy_only) +static void ram_state_pending_estimate(void *opaque, uint64_t *res_precopy, + uint64_t *res_postcopy) { RAMState **temp =3D opaque; RAMState *rs =3D *temp; @@ -3421,16 +3419,14 @@ static void ram_state_pending_estimate(void *opaque, =20 if (migrate_postcopy_ram()) { /* We can do postcopy, and all the data is postcopiable */ - *res_postcopy_only +=3D remaining_size; + *res_postcopy +=3D remaining_size; } else { - *res_precopy_only +=3D remaining_size; + *res_precopy +=3D remaining_size; } } =20 -static void ram_state_pending_exact(void *opaque, - uint64_t *res_precopy_only, - uint64_t *res_compatible, - uint64_t *res_postcopy_only) +static void ram_state_pending_exact(void *opaque, uint64_t *res_precopy, + uint64_t *res_postcopy) { RAMState **temp =3D opaque; RAMState *rs =3D *temp; @@ -3448,9 +3444,9 @@ static void ram_state_pending_exact(void *opaque, =20 if (migrate_postcopy_ram()) { /* We can do postcopy, and all the data is postcopiable */ - *res_compatible +=3D remaining_size; + *res_postcopy +=3D remaining_size; } else { - *res_precopy_only +=3D remaining_size; + *res_precopy +=3D remaining_size; } } =20 diff --git a/migration/savevm.c b/migration/savevm.c index e1caa3ea7c..3efdbcbcd7 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1472,15 +1472,13 @@ flush: * the result is split into the amount for units that can and * for units that can't do postcopy. */ -void qemu_savevm_state_pending_estimate(uint64_t *res_precopy_only, - uint64_t *res_compatible, - uint64_t *res_postcopy_only) +void qemu_savevm_state_pending_estimate(uint64_t *res_precopy, + uint64_t *res_postcopy) { SaveStateEntry *se; =20 - *res_precopy_only =3D 0; - *res_compatible =3D 0; - *res_postcopy_only =3D 0; + *res_precopy =3D 0; + *res_postcopy =3D 0; =20 QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { if (!se->ops || !se->ops->state_pending_exact) { @@ -1491,21 +1489,17 @@ void qemu_savevm_state_pending_estimate(uint64_t *r= es_precopy_only, continue; } } - se->ops->state_pending_exact(se->opaque, - res_precopy_only, res_compatible, - res_postcopy_only); + se->ops->state_pending_exact(se->opaque, res_precopy, res_postcopy= ); } } =20 -void qemu_savevm_state_pending_exact(uint64_t *res_precopy_only, - uint64_t *res_compatible, - uint64_t *res_postcopy_only) +void qemu_savevm_state_pending_exact(uint64_t *res_precopy, + uint64_t *res_postcopy) { SaveStateEntry *se; =20 - *res_precopy_only =3D 0; - *res_compatible =3D 0; - *res_postcopy_only =3D 0; + *res_precopy =3D 0; + *res_postcopy =3D 0; =20 QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { if (!se->ops || !se->ops->state_pending_estimate) { @@ -1516,9 +1510,7 @@ void qemu_savevm_state_pending_exact(uint64_t *res_pr= ecopy_only, continue; } } - se->ops->state_pending_estimate(se->opaque, - res_precopy_only, res_compatible, - res_postcopy_only); + se->ops->state_pending_estimate(se->opaque, res_precopy, res_postc= opy); } } =20 diff --git a/hw/vfio/trace-events b/hw/vfio/trace-events index 52de1c84f8..90a8aecb37 100644 --- a/hw/vfio/trace-events +++ b/hw/vfio/trace-events @@ -157,7 +157,7 @@ vfio_save_cleanup(const char *name) " (%s)" vfio_save_buffer(const char *name, uint64_t data_offset, uint64_t data_siz= e, uint64_t pending) " (%s) Offset 0x%"PRIx64" size 0x%"PRIx64" pending 0x%= "PRIx64 vfio_update_pending(const char *name, uint64_t pending) " (%s) pending 0x%= "PRIx64 vfio_save_device_config_state(const char *name) " (%s)" -vfio_state_pending(const char *name, uint64_t precopy, uint64_t postcopy, = uint64_t compatible) " (%s) precopy 0x%"PRIx64" postcopy 0x%"PRIx64" compat= ible 0x%"PRIx64 +vfio_state_pending(const char *name, uint64_t precopy, uint64_t postcopy) = " (%s) precopy 0x%"PRIx64" postcopy 0x%"PRIx64 vfio_save_iterate(const char *name, int data_size) " (%s) data_size %d" vfio_save_complete_precopy(const char *name) " (%s)" vfio_load_device_config_state(const char *name) " (%s)" diff --git a/migration/trace-events b/migration/trace-events index 67b65a70ff..422823b1db 100644 --- a/migration/trace-events +++ b/migration/trace-events @@ -150,8 +150,8 @@ migrate_fd_cleanup(void) "" migrate_fd_error(const char *error_desc) "error=3D%s" migrate_fd_cancel(void) "" migrate_handle_rp_req_pages(const char *rbname, size_t start, size_t len) = "in %s at 0x%zx len 0x%zx" -migrate_pending_exact(uint64_t size, uint64_t pre, uint64_t compat, uint64= _t post) "exact pending size %" PRIu64 " (pre =3D %" PRIu64 " compat=3D%" P= RIu64 " post=3D%" PRIu64 ")" -migrate_pending_estimate(uint64_t size, uint64_t pre, uint64_t compat, uin= t64_t post) "estimate pending size %" PRIu64 " (pre =3D %" PRIu64 " compat= =3D%" PRIu64 " post=3D%" PRIu64 ")" +migrate_pending_exact(uint64_t size, uint64_t pre, uint64_t post) "exact p= ending size %" PRIu64 " (pre =3D %" PRIu64 " post=3D%" PRIu64 ")" +migrate_pending_estimate(uint64_t size, uint64_t pre, uint64_t post) "esti= mate pending size %" PRIu64 " (pre =3D %" PRIu64 " post=3D%" PRIu64 ")" migrate_send_rp_message(int msg_type, uint16_t len) "%d: len %d" migrate_send_rp_recv_bitmap(char *name, int64_t size) "block '%s' size 0x%= "PRIi64 migration_completion_file_err(void) "" --=20 2.39.1