From nobody Tue May 14 02:44:13 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=1683106058; cv=none; d=zohomail.com; s=zohoarc; b=IcotoHNMwy+EIkDcat+cFF+smvoJrvHuUttl9KVxXcfq5jGrA0qdvkT9bQKH7bD/MgCrWnh8u8qklxgmrgALrj6mH4XHxIIttOGLgeP9eWFZzWGBuh3CZBYR1yZojs0mdcpdLGt/33wqScpI9ylwejQVpk3i3cuwaYII3Ij0NxI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683106058; 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=x//nluauCeOMTwlVk/MtZbhxlX1fdBq+vgsF2NUk3W0=; b=RyniGQgeWoycP8RmB1XUCmnPGbEN01MmsCs1p5FcUNmiv7rcxB5Vfvf5XttEKo+NhvTdacHgrRIdBEQ/x4GXQgI6OQzHNVomC5133FSEpga51fYrbqIiBY8AyYqMmkXZp8GooOdTAVvpKxtEUnB2cOZbpx6v5+ZEmFhqhQViz1k= 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 1683106058501564.2271130521267; Wed, 3 May 2023 02:27:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pu8kc-0004en-6a; Wed, 03 May 2023 05:26:18 -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 1pu8kW-0004eD-LL for qemu-devel@nongnu.org; Wed, 03 May 2023 05:26:14 -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 1pu8kV-0001x1-8Z for qemu-devel@nongnu.org; Wed, 03 May 2023 05:26:12 -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-617-VH1rqG6tMoe49ZaDVryRkg-1; Wed, 03 May 2023 05:26:09 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1C70287B2A1; Wed, 3 May 2023 09:26:09 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2F824492C3E; Wed, 3 May 2023 09:26:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683105970; 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=x//nluauCeOMTwlVk/MtZbhxlX1fdBq+vgsF2NUk3W0=; b=ia/AMNnmdIVAji2UGE/dzv1BhCnvr61bBt9pbAuTyEgENKt0UWt3ChRt6AaPNNCgm4Boe6 sLXLKwzXUw8HaVdQJi/Xv/OXkUwrfMOc0hm8EeqrXwoZh5sggsDr96hQnK/yRQA0sTbdzi SXsR0GX4V8lydWbyFSGyEmled6my/ZA= X-MC-Unique: VH1rqG6tMoe49ZaDVryRkg-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Peter Xu , Juan Quintela , Leonardo Bras , Lukas Straub Subject: [PULL 1/8] multifd: We already account for this packet on the multifd thread Date: Wed, 3 May 2023 11:25:59 +0200 Message-Id: <20230503092606.9415-2-quintela@redhat.com> In-Reply-To: <20230503092606.9415-1-quintela@redhat.com> References: <20230503092606.9415-1-quintela@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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=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: 1683106058985100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Juan Quintela Reviewed-by: Lukas Straub --- migration/multifd.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/migration/multifd.c b/migration/multifd.c index 6a59c03dd2..6053012ad9 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -626,10 +626,7 @@ int multifd_send_sync_main(QEMUFile *f) p->packet_num =3D multifd_send_state->packet_num++; p->flags |=3D MULTIFD_FLAG_SYNC; p->pending_job++; - qemu_file_acct_rate_limit(f, p->packet_len); qemu_mutex_unlock(&p->mutex); - stat64_add(&ram_counters.transferred, p->packet_len); - stat64_add(&ram_counters.multifd_bytes, p->packet_len); qemu_sem_post(&p->sem); } for (i =3D 0; i < migrate_multifd_channels(); i++) { --=20 2.40.0 From nobody Tue May 14 02:44:13 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=1683106026; cv=none; d=zohomail.com; s=zohoarc; b=UM44/FshTovhHX7/PsPqHSDxwV5wezK2WlhbcVBIK2E7/JEOIhWofdLsz8Z70WAx0jzM2JU5lO8V0IhaK2RZskaOESGkd4qcUk1oZ5AP71eEeLJzQEflkw27I0Mz2Oxkm6cfyO/MXKRQUxBjRWGSnXXulBOA3c3bszXBwLNdGUE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683106026; 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=vSCB6KT7M6hoNQV4Q2mURuJbWzf3pyiKoUhw7b9R8Xc=; b=i1I6/ZavtNWyJR9wQQr8QbKiYosJGgnkcS2nnDmvfrmDNomWGobjyPATdR2w1GcQbuQ6aVzfVQ62ifqnjC2I2FZLtSsnnPXpXxyyk4wNZYRFRMW+1HyOlsTiXIhOsm6QqyHb5sqeNhbTPy/BAxKxhqThswChTQ85pWblS8X7AT8= 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 1683106026829229.19856702885784; Wed, 3 May 2023 02:27:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pu8kc-0004fN-Sj; Wed, 03 May 2023 05:26:18 -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 1pu8kZ-0004eU-EZ for qemu-devel@nongnu.org; Wed, 03 May 2023 05:26:16 -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 1pu8kX-00021M-It for qemu-devel@nongnu.org; Wed, 03 May 2023 05:26:15 -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-550-XSX6IBqXO4SWoVMKd0jJ8Q-1; Wed, 03 May 2023 05:26:10 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6241BA0F39C; Wed, 3 May 2023 09:26:10 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5DB79492C3E; Wed, 3 May 2023 09:26:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683105973; 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=vSCB6KT7M6hoNQV4Q2mURuJbWzf3pyiKoUhw7b9R8Xc=; b=aJ+gb5V6wg+t3Ml2TZpcopvMePIzKgLFhvQJyorhS5R+AsKDeJ0nl+JDJjc6LnIuG3hRJ+ q9uWn9iBovAa0HxX1ulhSz8trL+4abIL3jOymN3/U6BjWvlKmEHlFPKWB2hmyFQItpO+NK Cu+We2IKzpR2NgMFckjMzHUALjh7A8U= X-MC-Unique: XSX6IBqXO4SWoVMKd0jJ8Q-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Peter Xu , Juan Quintela , Leonardo Bras , Lukas Straub Subject: [PULL 2/8] migration: Move ram_stats to its own file migration-stats.[ch] Date: Wed, 3 May 2023 11:26:00 +0200 Message-Id: <20230503092606.9415-3-quintela@redhat.com> In-Reply-To: <20230503092606.9415-1-quintela@redhat.com> References: <20230503092606.9415-1-quintela@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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=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: 1683106028859100003 Content-Type: text/plain; charset="utf-8" There is already include/qemu/stats.h, so stats.h was a bad idea. We want this file to not depend on anything else, we will move all the migration counters/stats to this struct. Signed-off-by: Juan Quintela Reviewed-by: Lukas Straub --- migration/meson.build | 1 + migration/migration-stats.c | 17 +++++++++++++++ migration/migration-stats.h | 41 +++++++++++++++++++++++++++++++++++++ migration/migration.c | 1 + migration/multifd.c | 1 + migration/ram.c | 3 +-- migration/ram.h | 23 --------------------- migration/savevm.c | 1 + 8 files changed, 63 insertions(+), 25 deletions(-) create mode 100644 migration/migration-stats.c create mode 100644 migration/migration-stats.h diff --git a/migration/meson.build b/migration/meson.build index 480ff6854a..da1897fadf 100644 --- a/migration/meson.build +++ b/migration/meson.build @@ -19,6 +19,7 @@ softmmu_ss.add(files( 'fd.c', 'global_state.c', 'migration-hmp-cmds.c', + 'migration-stats.c', 'migration.c', 'multifd.c', 'multifd-zlib.c', diff --git a/migration/migration-stats.c b/migration/migration-stats.c new file mode 100644 index 0000000000..b0eb5ae73c --- /dev/null +++ b/migration/migration-stats.c @@ -0,0 +1,17 @@ +/* + * Migration stats + * + * Copyright (c) 2012-2023 Red Hat Inc + * + * Authors: + * Juan Quintela + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include "qemu/stats64.h" +#include "migration-stats.h" + +RAMStats ram_counters; diff --git a/migration/migration-stats.h b/migration/migration-stats.h new file mode 100644 index 0000000000..2edea0c779 --- /dev/null +++ b/migration/migration-stats.h @@ -0,0 +1,41 @@ +/* + * Migration stats + * + * Copyright (c) 2012-2023 Red Hat Inc + * + * Authors: + * Juan Quintela + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ + +#ifndef QEMU_MIGRATION_STATS_H +#define QEMU_MIGRATION_STATS_H + +#include "qemu/stats64.h" + +/* + * These are the ram migration statistic counters. It is loosely + * based on MigrationStats. We change to Stat64 any counter that + * needs to be updated using atomic ops (can be accessed by more than + * one thread). + */ +typedef struct { + Stat64 dirty_bytes_last_sync; + Stat64 dirty_pages_rate; + Stat64 dirty_sync_count; + Stat64 dirty_sync_missed_zero_copy; + Stat64 downtime_bytes; + Stat64 zero_pages; + Stat64 multifd_bytes; + Stat64 normal_pages; + Stat64 postcopy_bytes; + Stat64 postcopy_requests; + Stat64 precopy_bytes; + Stat64 transferred; +} RAMStats; + +extern RAMStats ram_counters; + +#endif diff --git a/migration/migration.c b/migration/migration.c index abcadbb619..5ecf3dc381 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -29,6 +29,7 @@ #include "migration/global_state.h" #include "migration/misc.h" #include "migration.h" +#include "migration-stats.h" #include "savevm.h" #include "qemu-file.h" #include "channel.h" diff --git a/migration/multifd.c b/migration/multifd.c index 6053012ad9..347999f84a 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -19,6 +19,7 @@ #include "qapi/error.h" #include "ram.h" #include "migration.h" +#include "migration-stats.h" #include "socket.h" #include "tls.h" #include "qemu-file.h" diff --git a/migration/ram.c b/migration/ram.c index 89be3e3320..a6d5478ef8 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -36,6 +36,7 @@ #include "xbzrle.h" #include "ram.h" #include "migration.h" +#include "migration-stats.h" #include "migration/register.h" #include "migration/misc.h" #include "qemu-file.h" @@ -460,8 +461,6 @@ uint64_t ram_bytes_remaining(void) 0; } =20 -RAMStats ram_counters; - void ram_transferred_add(uint64_t bytes) { if (runstate_is_running()) { diff --git a/migration/ram.h b/migration/ram.h index 04b05e1b2c..8692de6ba0 100644 --- a/migration/ram.h +++ b/migration/ram.h @@ -32,30 +32,7 @@ #include "qapi/qapi-types-migration.h" #include "exec/cpu-common.h" #include "io/channel.h" -#include "qemu/stats64.h" =20 -/* - * These are the ram migration statistic counters. It is loosely - * based on MigrationStats. We change to Stat64 any counter that - * needs to be updated using atomic ops (can be accessed by more than - * one thread). - */ -typedef struct { - Stat64 dirty_bytes_last_sync; - Stat64 dirty_pages_rate; - Stat64 dirty_sync_count; - Stat64 dirty_sync_missed_zero_copy; - Stat64 downtime_bytes; - Stat64 zero_pages; - Stat64 multifd_bytes; - Stat64 normal_pages; - Stat64 postcopy_bytes; - Stat64 postcopy_requests; - Stat64 precopy_bytes; - Stat64 transferred; -} RAMStats; - -extern RAMStats ram_counters; extern XBZRLECacheStats xbzrle_counters; extern CompressionStats compression_counters; =20 diff --git a/migration/savevm.c b/migration/savevm.c index a9181b444b..8e2efb1a19 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -31,6 +31,7 @@ #include "net/net.h" #include "migration.h" #include "migration/snapshot.h" +#include "migration-stats.h" #include "migration/vmstate.h" #include "migration/misc.h" #include "migration/register.h" --=20 2.40.0 From nobody Tue May 14 02:44:13 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=1683106070; cv=none; d=zohomail.com; s=zohoarc; b=ZR/AFly3/ivMy90TLWevyuwmdg9VR+08EsXVyK3X9E441lfDzTSV7zDmDE8mOC9xO2wkNwxaHNW6P+ZQRk6C+ty4sTZpnHrGXh1kxiMw8xlExObi9bIAlPVcFeSYEUdjqaHo950ZyG3sUYkP8vaNODSq580qNxll9nWtgx4/zpA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683106070; 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=fHBO4s/UNvKYohfBJJwq43wMwIPGWXuavyCOYVzB90U=; b=cJ14aix0Aso5WCkoy6XNPmVSUf3TAVICoaWlJGNdkpL6jwhUaeShRnNHheKbgW6eKeTupDEswhbVK4U788mrFYFilj7qG4airHJhhQKdjUHBcx0k3BVgEdnlC8cdg+2rNxmulaJn70PNuBXaDbCuAa3q4igFpyrRh5PUJIAH1A0= 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 1683106070379767.4286218598407; Wed, 3 May 2023 02:27:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pu8kd-0004g7-Iq; Wed, 03 May 2023 05:26:19 -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 1pu8kZ-0004eV-Rj for qemu-devel@nongnu.org; Wed, 03 May 2023 05:26:16 -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 1pu8kX-00021z-Kr for qemu-devel@nongnu.org; Wed, 03 May 2023 05:26:15 -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-480-CX2kIsJbO2aZCh95lTfUuw-1; Wed, 03 May 2023 05:26:12 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A9044A0F396; Wed, 3 May 2023 09:26:11 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id A2E0F492C3E; Wed, 3 May 2023 09:26:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683105973; 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=fHBO4s/UNvKYohfBJJwq43wMwIPGWXuavyCOYVzB90U=; b=Bz+PBCTYIM1NlP2IKnXgTE6hhQkM7W4R5lLOIGTrK7f5BSIgmu/5qJRDhozlosnLCoPqNK KgA1w9FMt0Z92kSz/AS+sX19Fw78ny9mJXICrUN26T4MqYeG7az0XQYA+SSlThEqCUO+f1 JZXFruJ0rFHuJ+2G2G8vHUnBfL0FPYk= X-MC-Unique: CX2kIsJbO2aZCh95lTfUuw-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Peter Xu , Juan Quintela , Leonardo Bras , Lukas Straub Subject: [PULL 3/8] migration: Rename ram_counters to mig_stats Date: Wed, 3 May 2023 11:26:01 +0200 Message-Id: <20230503092606.9415-4-quintela@redhat.com> In-Reply-To: <20230503092606.9415-1-quintela@redhat.com> References: <20230503092606.9415-1-quintela@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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=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: 1683106072527100006 Content-Type: text/plain; charset="utf-8" migration_stats is just too long, and it is going to have more than ram counters in the near future. Signed-off-by: Juan Quintela Reviewed-by: Lukas Straub --- migration/migration-stats.c | 2 +- migration/migration-stats.h | 2 +- migration/migration.c | 32 ++++++++++++------------- migration/multifd.c | 6 ++--- migration/ram.c | 48 ++++++++++++++++++------------------- migration/savevm.c | 2 +- 6 files changed, 46 insertions(+), 46 deletions(-) diff --git a/migration/migration-stats.c b/migration/migration-stats.c index b0eb5ae73c..8c0af9b80a 100644 --- a/migration/migration-stats.c +++ b/migration/migration-stats.c @@ -14,4 +14,4 @@ #include "qemu/stats64.h" #include "migration-stats.h" =20 -RAMStats ram_counters; +RAMStats mig_stats; diff --git a/migration/migration-stats.h b/migration/migration-stats.h index 2edea0c779..197374b4f6 100644 --- a/migration/migration-stats.h +++ b/migration/migration-stats.h @@ -36,6 +36,6 @@ typedef struct { Stat64 transferred; } RAMStats; =20 -extern RAMStats ram_counters; +extern RAMStats mig_stats; =20 #endif diff --git a/migration/migration.c b/migration/migration.c index 5ecf3dc381..feb5ab7493 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -909,26 +909,26 @@ static void populate_ram_info(MigrationInfo *info, Mi= grationState *s) size_t page_size =3D qemu_target_page_size(); =20 info->ram =3D g_malloc0(sizeof(*info->ram)); - info->ram->transferred =3D stat64_get(&ram_counters.transferred); + info->ram->transferred =3D stat64_get(&mig_stats.transferred); info->ram->total =3D ram_bytes_total(); - info->ram->duplicate =3D stat64_get(&ram_counters.zero_pages); + info->ram->duplicate =3D stat64_get(&mig_stats.zero_pages); /* legacy value. It is not used anymore */ info->ram->skipped =3D 0; - info->ram->normal =3D stat64_get(&ram_counters.normal_pages); + info->ram->normal =3D stat64_get(&mig_stats.normal_pages); info->ram->normal_bytes =3D info->ram->normal * page_size; info->ram->mbps =3D s->mbps; info->ram->dirty_sync_count =3D - stat64_get(&ram_counters.dirty_sync_count); + stat64_get(&mig_stats.dirty_sync_count); info->ram->dirty_sync_missed_zero_copy =3D - stat64_get(&ram_counters.dirty_sync_missed_zero_copy); + stat64_get(&mig_stats.dirty_sync_missed_zero_copy); info->ram->postcopy_requests =3D - stat64_get(&ram_counters.postcopy_requests); + stat64_get(&mig_stats.postcopy_requests); info->ram->page_size =3D page_size; - info->ram->multifd_bytes =3D stat64_get(&ram_counters.multifd_bytes); + info->ram->multifd_bytes =3D stat64_get(&mig_stats.multifd_bytes); info->ram->pages_per_second =3D s->pages_per_second; - info->ram->precopy_bytes =3D stat64_get(&ram_counters.precopy_bytes); - info->ram->downtime_bytes =3D stat64_get(&ram_counters.downtime_bytes); - info->ram->postcopy_bytes =3D stat64_get(&ram_counters.postcopy_bytes); + info->ram->precopy_bytes =3D stat64_get(&mig_stats.precopy_bytes); + info->ram->downtime_bytes =3D stat64_get(&mig_stats.downtime_bytes); + info->ram->postcopy_bytes =3D stat64_get(&mig_stats.postcopy_bytes); =20 if (migrate_xbzrle()) { info->xbzrle_cache =3D g_malloc0(sizeof(*info->xbzrle_cache)); @@ -960,7 +960,7 @@ static void populate_ram_info(MigrationInfo *info, Migr= ationState *s) if (s->state !=3D MIGRATION_STATUS_COMPLETED) { info->ram->remaining =3D ram_bytes_remaining(); info->ram->dirty_pages_rate =3D - stat64_get(&ram_counters.dirty_pages_rate); + stat64_get(&mig_stats.dirty_pages_rate); } } =20 @@ -1613,10 +1613,10 @@ static bool migrate_prepare(MigrationState *s, bool= blk, bool blk_inc, =20 migrate_init(s); /* - * set ram_counters compression_counters memory to zero for a + * set mig_stats compression_counters memory to zero for a * new migration */ - memset(&ram_counters, 0, sizeof(ram_counters)); + memset(&mig_stats, 0, sizeof(mig_stats)); memset(&compression_counters, 0, sizeof(compression_counters)); =20 return true; @@ -2627,7 +2627,7 @@ static MigThrError migration_detect_error(MigrationSt= ate *s) static uint64_t migration_total_bytes(MigrationState *s) { return qemu_file_total_transferred(s->to_dst_file) + - stat64_get(&ram_counters.multifd_bytes); + stat64_get(&mig_stats.multifd_bytes); } =20 static void migration_calculate_complete(MigrationState *s) @@ -2691,10 +2691,10 @@ static void migration_update_counters(MigrationStat= e *s, * if we haven't sent anything, we don't want to * recalculate. 10000 is a small enough number for our purposes */ - if (stat64_get(&ram_counters.dirty_pages_rate) && + if (stat64_get(&mig_stats.dirty_pages_rate) && transferred > 10000) { s->expected_downtime =3D - stat64_get(&ram_counters.dirty_bytes_last_sync) / bandwidth; + stat64_get(&mig_stats.dirty_bytes_last_sync) / bandwidth; } =20 qemu_file_reset_rate_limit(s->to_dst_file); diff --git a/migration/multifd.c b/migration/multifd.c index 347999f84a..4a2e1a47ce 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -434,8 +434,8 @@ static int multifd_send_pages(QEMUFile *f) transferred =3D ((uint64_t) pages->num) * p->page_size + p->packet_len; qemu_file_acct_rate_limit(f, transferred); qemu_mutex_unlock(&p->mutex); - stat64_add(&ram_counters.transferred, transferred); - stat64_add(&ram_counters.multifd_bytes, transferred); + stat64_add(&mig_stats.transferred, transferred); + stat64_add(&mig_stats.multifd_bytes, transferred); qemu_sem_post(&p->sem); =20 return 1; @@ -577,7 +577,7 @@ static int multifd_zero_copy_flush(QIOChannel *c) return -1; } if (ret =3D=3D 1) { - stat64_add(&ram_counters.dirty_sync_missed_zero_copy, 1); + stat64_add(&mig_stats.dirty_sync_missed_zero_copy, 1); } =20 return ret; diff --git a/migration/ram.c b/migration/ram.c index a6d5478ef8..c3981f64e4 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -464,13 +464,13 @@ uint64_t ram_bytes_remaining(void) void ram_transferred_add(uint64_t bytes) { if (runstate_is_running()) { - stat64_add(&ram_counters.precopy_bytes, bytes); + stat64_add(&mig_stats.precopy_bytes, bytes); } else if (migration_in_postcopy()) { - stat64_add(&ram_counters.postcopy_bytes, bytes); + stat64_add(&mig_stats.postcopy_bytes, bytes); } else { - stat64_add(&ram_counters.downtime_bytes, bytes); + stat64_add(&mig_stats.downtime_bytes, bytes); } - stat64_add(&ram_counters.transferred, bytes); + stat64_add(&mig_stats.transferred, bytes); } =20 struct MigrationOps { @@ -744,7 +744,7 @@ void mig_throttle_counter_reset(void) =20 rs->time_last_bitmap_sync =3D qemu_clock_get_ms(QEMU_CLOCK_REALTIME); rs->num_dirty_pages_period =3D 0; - rs->bytes_xfer_prev =3D stat64_get(&ram_counters.transferred); + rs->bytes_xfer_prev =3D stat64_get(&mig_stats.transferred); } =20 /** @@ -764,7 +764,7 @@ static void xbzrle_cache_zero_page(RAMState *rs, ram_ad= dr_t current_addr) /* We don't care if this fails to allocate a new cache page * as long as it updated an old one */ cache_insert(XBZRLE.cache, current_addr, XBZRLE.zero_target_page, - stat64_get(&ram_counters.dirty_sync_count)); + stat64_get(&mig_stats.dirty_sync_count)); } =20 #define ENCODING_FLAG_XBZRLE 0x1 @@ -790,7 +790,7 @@ static int save_xbzrle_page(RAMState *rs, PageSearchSta= tus *pss, int encoded_len =3D 0, bytes_xbzrle; uint8_t *prev_cached_page; QEMUFile *file =3D pss->pss_channel; - uint64_t generation =3D stat64_get(&ram_counters.dirty_sync_count); + uint64_t generation =3D stat64_get(&mig_stats.dirty_sync_count); =20 if (!cache_is_cached(XBZRLE.cache, current_addr, generation)) { xbzrle_counters.cache_miss++; @@ -1118,8 +1118,8 @@ uint64_t ram_pagesize_summary(void) =20 uint64_t ram_get_total_transferred_pages(void) { - return stat64_get(&ram_counters.normal_pages) + - stat64_get(&ram_counters.zero_pages) + + return stat64_get(&mig_stats.normal_pages) + + stat64_get(&mig_stats.zero_pages) + compression_counters.pages + xbzrle_counters.pages; } =20 @@ -1129,7 +1129,7 @@ static void migration_update_rates(RAMState *rs, int6= 4_t end_time) double compressed_size; =20 /* calculate period counters */ - stat64_set(&ram_counters.dirty_pages_rate, + stat64_set(&mig_stats.dirty_pages_rate, rs->num_dirty_pages_period * 1000 / (end_time - rs->time_last_bitmap_sync)); =20 @@ -1180,7 +1180,7 @@ static void migration_trigger_throttle(RAMState *rs) { uint64_t threshold =3D migrate_throttle_trigger_threshold(); uint64_t bytes_xfer_period =3D - stat64_get(&ram_counters.transferred) - rs->bytes_xfer_prev; + stat64_get(&mig_stats.transferred) - rs->bytes_xfer_prev; uint64_t bytes_dirty_period =3D rs->num_dirty_pages_period * TARGET_PA= GE_SIZE; uint64_t bytes_dirty_threshold =3D bytes_xfer_period * threshold / 100; =20 @@ -1209,7 +1209,7 @@ static void migration_bitmap_sync(RAMState *rs) RAMBlock *block; int64_t end_time; =20 - stat64_add(&ram_counters.dirty_sync_count, 1); + stat64_add(&mig_stats.dirty_sync_count, 1); =20 if (!rs->time_last_bitmap_sync) { rs->time_last_bitmap_sync =3D qemu_clock_get_ms(QEMU_CLOCK_REALTIM= E); @@ -1223,7 +1223,7 @@ static void migration_bitmap_sync(RAMState *rs) RAMBLOCK_FOREACH_NOT_IGNORED(block) { ramblock_sync_dirty_bitmap(rs, block); } - stat64_set(&ram_counters.dirty_bytes_last_sync, ram_bytes_remainin= g()); + stat64_set(&mig_stats.dirty_bytes_last_sync, ram_bytes_remaining()= ); } qemu_mutex_unlock(&rs->bitmap_mutex); =20 @@ -1243,10 +1243,10 @@ static void migration_bitmap_sync(RAMState *rs) /* reset period counters */ rs->time_last_bitmap_sync =3D end_time; rs->num_dirty_pages_period =3D 0; - rs->bytes_xfer_prev =3D stat64_get(&ram_counters.transferred); + rs->bytes_xfer_prev =3D stat64_get(&mig_stats.transferred); } if (migrate_events()) { - uint64_t generation =3D stat64_get(&ram_counters.dirty_sync_count); + uint64_t generation =3D stat64_get(&mig_stats.dirty_sync_count); qapi_event_send_migration_pass(generation); } } @@ -1320,7 +1320,7 @@ static int save_zero_page(PageSearchStatus *pss, QEMU= File *f, RAMBlock *block, int len =3D save_zero_page_to_file(pss, f, block, offset); =20 if (len) { - stat64_add(&ram_counters.zero_pages, 1); + stat64_add(&mig_stats.zero_pages, 1); ram_transferred_add(len); return 1; } @@ -1357,9 +1357,9 @@ static bool control_save_page(PageSearchStatus *pss, = RAMBlock *block, } =20 if (bytes_xmit > 0) { - stat64_add(&ram_counters.normal_pages, 1); + stat64_add(&mig_stats.normal_pages, 1); } else if (bytes_xmit =3D=3D 0) { - stat64_add(&ram_counters.zero_pages, 1); + stat64_add(&mig_stats.zero_pages, 1); } =20 return true; @@ -1391,7 +1391,7 @@ static int save_normal_page(PageSearchStatus *pss, RA= MBlock *block, qemu_put_buffer(file, buf, TARGET_PAGE_SIZE); } ram_transferred_add(TARGET_PAGE_SIZE); - stat64_add(&ram_counters.normal_pages, 1); + stat64_add(&mig_stats.normal_pages, 1); return 1; } =20 @@ -1447,7 +1447,7 @@ static int ram_save_multifd_page(QEMUFile *file, RAMB= lock *block, if (multifd_queue_page(file, block, offset) < 0) { return -1; } - stat64_add(&ram_counters.normal_pages, 1); + stat64_add(&mig_stats.normal_pages, 1); =20 return 1; } @@ -1486,7 +1486,7 @@ update_compress_thread_counts(const CompressParam *pa= ram, int bytes_xmit) ram_transferred_add(bytes_xmit); =20 if (param->zero_page) { - stat64_add(&ram_counters.zero_pages, 1); + stat64_add(&mig_stats.zero_pages, 1); return; } =20 @@ -2179,7 +2179,7 @@ int ram_save_queue_pages(const char *rbname, ram_addr= _t start, ram_addr_t len) RAMBlock *ramblock; RAMState *rs =3D ram_state; =20 - stat64_add(&ram_counters.postcopy_requests, 1); + stat64_add(&mig_stats.postcopy_requests, 1); RCU_READ_LOCK_GUARD(); =20 if (!rbname) { @@ -2634,9 +2634,9 @@ void acct_update_position(QEMUFile *f, size_t size, b= ool zero) uint64_t pages =3D size / TARGET_PAGE_SIZE; =20 if (zero) { - stat64_add(&ram_counters.zero_pages, pages); + stat64_add(&mig_stats.zero_pages, pages); } else { - stat64_add(&ram_counters.normal_pages, pages); + stat64_add(&mig_stats.normal_pages, pages); ram_transferred_add(size); qemu_file_credit_transfer(f, size); } diff --git a/migration/savevm.c b/migration/savevm.c index 8e2efb1a19..a9d0a88e62 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1622,7 +1622,7 @@ static int qemu_savevm_state(QEMUFile *f, Error **err= p) } =20 migrate_init(ms); - memset(&ram_counters, 0, sizeof(ram_counters)); + memset(&mig_stats, 0, sizeof(mig_stats)); memset(&compression_counters, 0, sizeof(compression_counters)); ms->to_dst_file =3D f; =20 --=20 2.40.0 From nobody Tue May 14 02:44:13 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=1683106067; cv=none; d=zohomail.com; s=zohoarc; b=Hv682cs3SRHCmWne7WA/VQiNpFNOXBCccgzIVK1hjNXQIhBcO1vTCxr8E1D+UUwh3YvXkSzIMt2yvjSDLNygx7wwhgcEpBW/uHrDkyXeDv+gZfJ2qV3rQrwYBEWw5320xD/OglLOPlMLQnkgv0KpuvUrabF8e3sm3A8LEXk3XvM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683106067; 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=jfae15PDbIUOl2CyCIvk9wObK0g/RFtr2m1QrHA2W6Q=; b=cVt1NM9zGdW4vtoAI/YTc7ucA6YZXpzNnKMEyu2UUeC013d4eFmYgdt/18nZLqJ6R9+ae3BgtIbZDjDvN4oIkWZpHQQFgabmZtw8HGxSdBkzxMY5OLXUD3rhRtrrOg/tjEQSNGmnFoJVnYthJtcZBG9qFd5AmzH9Sp6DpKrvuaw= 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 1683106067120970.7195652936824; Wed, 3 May 2023 02:27:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pu8kl-0004ib-MO; Wed, 03 May 2023 05:26:27 -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 1pu8kj-0004hq-TW for qemu-devel@nongnu.org; Wed, 03 May 2023 05:26:25 -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 1pu8ki-00031o-El for qemu-devel@nongnu.org; Wed, 03 May 2023 05:26:25 -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-325-dUVUv7VoMuOz1jKW2NbP3A-1; Wed, 03 May 2023 05:26:13 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D9B553822DE4; Wed, 3 May 2023 09:26:12 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id E9743492C3E; Wed, 3 May 2023 09:26:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683105983; 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=jfae15PDbIUOl2CyCIvk9wObK0g/RFtr2m1QrHA2W6Q=; b=LxL+nJR0NitjmOi68bKgcoUGcvrqmrsJExiaTFb5PcO/5EcmdHqYkMwYNgKRGRjN+Hf5UQ jU4cf0HbddWOeHMgbAZIRVthwPUI0TNX4fL+hyNqFFZvx0lLKGXxf/rYyhe/GHcs7Ztce5 poTrF/5Nb7BP7WGmP9eTBcnXzYeEkDw= X-MC-Unique: dUVUv7VoMuOz1jKW2NbP3A-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Peter Xu , Juan Quintela , Leonardo Bras , Lukas Straub Subject: [PULL 4/8] migration: Rename RAMStats to MigrationAtomicStats Date: Wed, 3 May 2023 11:26:02 +0200 Message-Id: <20230503092606.9415-5-quintela@redhat.com> In-Reply-To: <20230503092606.9415-1-quintela@redhat.com> References: <20230503092606.9415-1-quintela@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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=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: 1683106067344100001 Content-Type: text/plain; charset="utf-8" It is lousely based on MigrationStats, but that name is taken, so this is the best one that I came with. Signed-off-by: Juan Quintela Reviewed-by: Lukas Straub --- If you have any good suggestion for the name, I am all ears. --- migration/migration-stats.c | 2 +- migration/migration-stats.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/migration/migration-stats.c b/migration/migration-stats.c index 8c0af9b80a..2f2cea965c 100644 --- a/migration/migration-stats.c +++ b/migration/migration-stats.c @@ -14,4 +14,4 @@ #include "qemu/stats64.h" #include "migration-stats.h" =20 -RAMStats mig_stats; +MigrationAtomicStats mig_stats; diff --git a/migration/migration-stats.h b/migration/migration-stats.h index 197374b4f6..149af932d7 100644 --- a/migration/migration-stats.h +++ b/migration/migration-stats.h @@ -34,8 +34,8 @@ typedef struct { Stat64 postcopy_requests; Stat64 precopy_bytes; Stat64 transferred; -} RAMStats; +} MigrationAtomicStats; =20 -extern RAMStats mig_stats; +extern MigrationAtomicStats mig_stats; =20 #endif --=20 2.40.0 From nobody Tue May 14 02:44:13 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=1683106018; cv=none; d=zohomail.com; s=zohoarc; b=e45qhsnGwLAvpxVkUOqEJ1tLQ9cwHclcYaxa6h+kHIsGbi8WGg37ctkckKebZ6o6VXjipJhNNlu2Z8MlWk4CohM2LyUGR+lA8HQ1EVHlQvxN5+ymK1bRSLubv0E42OL9v0OKdQf4PVS18eZ6IjZ90KcyRIytpDj9hA4EoQLwqd8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683106018; 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=DxWHGYZc3NZRKmU+RyiF9FLRsVkR3VPuMtGQEkyhY2k=; b=FWPhnIXnJXkozDw2iy3r2UV/IsQy17gXWgpj0wy8std+GlAdIB5PyDSiunmIjYYoSDCHoZw0WgXFI2iv//1WCc4fR3wEzyOKgT41LKTscTyfwZFgu4er6/OKY1SpGZa08tLfsfhK4X6qhTuhYbuNCgu9rcm1NYtFR1XmozAeaIc= 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 1683106018535178.58383144463232; Wed, 3 May 2023 02:26:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pu8kk-0004iE-Ku; Wed, 03 May 2023 05:26: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 1pu8ki-0004gv-A1 for qemu-devel@nongnu.org; Wed, 03 May 2023 05:26:24 -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 1pu8kg-0002xB-Pu for qemu-devel@nongnu.org; Wed, 03 May 2023 05:26:24 -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-562-umUnJaBpPSKL-I1AuTGM1A-1; Wed, 03 May 2023 05:26:14 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 094E23C11788; Wed, 3 May 2023 09:26:14 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id 25E85492C3E; Wed, 3 May 2023 09:26:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683105981; 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=DxWHGYZc3NZRKmU+RyiF9FLRsVkR3VPuMtGQEkyhY2k=; b=W+Uqs+ib20piVuRCuHIihTieFmN55Aa4IYIk4k6rud0y4upTGyMNL40GkCtt75ZjXMn6AO Bpx3iEl0pYLcrJ1UV8qwcDvA5iSeL5cMbz+Mg3fAq54HlXF8SSRcyKHBZmQewhfe/9GBZS PTfIdGz4NdQsGiCcQUHZKAJ7fZmuLIg= X-MC-Unique: umUnJaBpPSKL-I1AuTGM1A-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Peter Xu , Juan Quintela , Leonardo Bras , Lukas Straub Subject: [PULL 5/8] migration/rdma: Split the zero page case from acct_update_position Date: Wed, 3 May 2023 11:26:03 +0200 Message-Id: <20230503092606.9415-6-quintela@redhat.com> In-Reply-To: <20230503092606.9415-1-quintela@redhat.com> References: <20230503092606.9415-1-quintela@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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=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: 1683106020883100003 Content-Type: text/plain; charset="utf-8" Now that we have atomic counters, we can do it on the place that we need it, no need to do it inside ram.c. Signed-off-by: Juan Quintela Reviewed-by: Lukas Straub --- migration/ram.c | 12 ++++-------- migration/ram.h | 2 +- migration/rdma.c | 7 +++++-- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index c3981f64e4..c249a1f468 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -2629,17 +2629,13 @@ static int ram_find_and_save_block(RAMState *rs) return pages; } =20 -void acct_update_position(QEMUFile *f, size_t size, bool zero) +void acct_update_position(QEMUFile *f, size_t size) { uint64_t pages =3D size / TARGET_PAGE_SIZE; =20 - if (zero) { - stat64_add(&mig_stats.zero_pages, pages); - } else { - stat64_add(&mig_stats.normal_pages, pages); - ram_transferred_add(size); - qemu_file_credit_transfer(f, size); - } + stat64_add(&mig_stats.normal_pages, pages); + ram_transferred_add(size); + qemu_file_credit_transfer(f, size); } =20 static uint64_t ram_bytes_total_with_ignored(void) diff --git a/migration/ram.h b/migration/ram.h index 8692de6ba0..3804753ca3 100644 --- a/migration/ram.h +++ b/migration/ram.h @@ -53,7 +53,7 @@ void mig_throttle_counter_reset(void); =20 uint64_t ram_pagesize_summary(void); int ram_save_queue_pages(const char *rbname, ram_addr_t start, ram_addr_t = len); -void acct_update_position(QEMUFile *f, size_t size, bool zero); +void acct_update_position(QEMUFile *f, size_t size); void ram_postcopy_migrated_memory_release(MigrationState *ms); /* For outgoing discard bitmap */ void ram_postcopy_send_discard_bitmap(MigrationState *ms); diff --git a/migration/rdma.c b/migration/rdma.c index 0af5e944f0..7a9b284c3f 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -17,8 +17,10 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/cutils.h" +#include "exec/target_page.h" #include "rdma.h" #include "migration.h" +#include "migration-stats.h" #include "qemu-file.h" #include "ram.h" #include "qemu/error-report.h" @@ -2120,7 +2122,8 @@ retry: return -EIO; } =20 - acct_update_position(f, sge.length, true); + stat64_add(&mig_stats.zero_pages, + sge.length / qemu_target_page_size()); =20 return 1; } @@ -2228,7 +2231,7 @@ retry: } =20 set_bit(chunk, block->transit_bitmap); - acct_update_position(f, sge.length, false); + acct_update_position(f, sge.length); rdma->total_writes++; =20 return 0; --=20 2.40.0 From nobody Tue May 14 02:44:13 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=1683106071; cv=none; d=zohomail.com; s=zohoarc; b=gwvs1oz9CQuz+6/JQVjK3tgAy48JVYH04u3ofuEIhrAKJHXEiUijyEC1gDvH/KMBpch5ONUUTixDca6ohsdxLjHZNGfLPfqdk0A0qwiyWgdmiNrmVqS1KXp7uSfnzyKQj3ndoRMEhhqYQLQ2eU9LOUP+EyoN6kzsj7vd4vKN5a4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683106071; 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=l38tWqn5Fu5lrmauLijpLYzD9pCl3Gw0p0V7GhyMam8=; b=TmFaF7X3OT8hVjzpWNK2qfjBRQCB9U6jGiMp+tg+19EOx+df9xpVKx0cGjVKUtwZTcK+XvXxfr6wso/qglWfSyh60T7IAdkSnptg0dfwN1wbyYPKYjbEz2+lws5cp2XmnCZh5QnThdv8rI9D7OkWWZXsiYVPSfxKqO5GGtNs1lM= 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 1683106071171214.08294913527277; Wed, 3 May 2023 02:27:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pu8kg-0004gW-CU; Wed, 03 May 2023 05:26:22 -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 1pu8ke-0004gC-Py for qemu-devel@nongnu.org; Wed, 03 May 2023 05:26:20 -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 1pu8kd-0002fg-Bz for qemu-devel@nongnu.org; Wed, 03 May 2023 05:26:20 -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-399-RCdC6i10MmGttxY91A0UFg-1; Wed, 03 May 2023 05:26:15 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2CE661C04331; Wed, 3 May 2023 09:26:15 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4AA95492B00; Wed, 3 May 2023 09:26:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683105978; 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=l38tWqn5Fu5lrmauLijpLYzD9pCl3Gw0p0V7GhyMam8=; b=JaVDKp3wsDZdXpKwjH0wvzF3rwsegG9HP/JJFKoCOQrjh+cUdig7yxXY52tKo/rU6J7aNk RBK21WOLpxa0bYQKnJD/MQZW7fGtRYMfV8tCNQEEpbhPdXbTNKXop8G1H87P7IEPDjp7L6 hv0X6HbqJi14cLvyBsOXVcNxVXfXBi4= X-MC-Unique: RCdC6i10MmGttxY91A0UFg-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Peter Xu , Juan Quintela , Leonardo Bras , Lukas Straub Subject: [PULL 6/8] migration/rdma: Unfold last user of acct_update_position() Date: Wed, 3 May 2023 11:26:04 +0200 Message-Id: <20230503092606.9415-7-quintela@redhat.com> In-Reply-To: <20230503092606.9415-1-quintela@redhat.com> References: <20230503092606.9415-1-quintela@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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=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: 1683106072460100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Juan Quintela Reviewed-by: Lukas Straub --- migration/ram.c | 9 --------- migration/ram.h | 1 - migration/rdma.c | 4 +++- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index c249a1f468..7d81c4a39e 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -2629,15 +2629,6 @@ static int ram_find_and_save_block(RAMState *rs) return pages; } =20 -void acct_update_position(QEMUFile *f, size_t size) -{ - uint64_t pages =3D size / TARGET_PAGE_SIZE; - - stat64_add(&mig_stats.normal_pages, pages); - ram_transferred_add(size); - qemu_file_credit_transfer(f, size); -} - static uint64_t ram_bytes_total_with_ignored(void) { RAMBlock *block; diff --git a/migration/ram.h b/migration/ram.h index 3804753ca3..6fffbeb5f1 100644 --- a/migration/ram.h +++ b/migration/ram.h @@ -53,7 +53,6 @@ void mig_throttle_counter_reset(void); =20 uint64_t ram_pagesize_summary(void); int ram_save_queue_pages(const char *rbname, ram_addr_t start, ram_addr_t = len); -void acct_update_position(QEMUFile *f, size_t size); void ram_postcopy_migrated_memory_release(MigrationState *ms); /* For outgoing discard bitmap */ void ram_postcopy_send_discard_bitmap(MigrationState *ms); diff --git a/migration/rdma.c b/migration/rdma.c index 7a9b284c3f..7e747b2595 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -2231,7 +2231,9 @@ retry: } =20 set_bit(chunk, block->transit_bitmap); - acct_update_position(f, sge.length); + stat64_add(&mig_stats.normal_pages, sge.length / qemu_target_page_size= ()); + ram_transferred_add(sge.length); + qemu_file_credit_transfer(f, sge.length); rdma->total_writes++; =20 return 0; --=20 2.40.0 From nobody Tue May 14 02:44:13 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=1683106073; cv=none; d=zohomail.com; s=zohoarc; b=e8t/9SsAMIfVipqgYsfxaae6ZU8/dKbEAAQDpuBGV4yy93rULoE39Wcpq6mv8C2pJ+GCTuYIMszBgzRFQFnsr+oHSadSCq/Uur2ob0AMSrbyXqEsAnUcEYT/A1dW/yJuzpDWE0wBmAmaYCJY7z8REVJjr+A5OSiyu4ExtRI06O8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683106073; 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=bezRbyElX4oDQkDmYg3oZ+p/BWTANa/wf2MhX9HYs/8=; b=kfasyXQn7l9DpSGrbTuXDcBqFILHogveFjEDUyzjUjbCGrOMkow1nBknwALXAWhwDJDgpPQMbs6STzWLDFX81anr21gSHSMkJBDDhp/6hCT643be9zHpmfEF7AyZFLaZjP8j4rRLrwzNeBep4+deK/5U2ZvA8ro8Ewq8f+l8vlI= 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 168310607375876.26322266247587; Wed, 3 May 2023 02:27:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pu8kj-0004hZ-1b; Wed, 03 May 2023 05:26:25 -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 1pu8kh-0004gg-BD for qemu-devel@nongnu.org; Wed, 03 May 2023 05:26:23 -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 1pu8ke-0002r2-L9 for qemu-devel@nongnu.org; Wed, 03 May 2023 05:26:23 -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-246-MXFxSzCLPr-xjZQumChZAA-1; Wed, 03 May 2023 05:26:16 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8EDAF3C11785; Wed, 3 May 2023 09:26:16 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6E0BF492C3E; Wed, 3 May 2023 09:26:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683105980; 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=bezRbyElX4oDQkDmYg3oZ+p/BWTANa/wf2MhX9HYs/8=; b=NB1dFYoV1juLHF0KKNJCNp9vs7kkc7mggdJg8+Eux47ibMHH7Cc+jxOvjnvO6XhLEGQd62 wXZCYSdOPHt7nL5dfQQm/TdjeDNGwQzTfmCBSntAaHphRcW+lXNR7BKWYCfpWKdxjzS8EZ IoOfh7TxvkDuv65RoakoCs28bSmixsQ= X-MC-Unique: MXFxSzCLPr-xjZQumChZAA-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Peter Xu , Juan Quintela , Leonardo Bras , Vladimir Sementsov-Ogievskiy Subject: [PULL 7/8] migration: Drop unused parameter for migration_tls_get_creds() Date: Wed, 3 May 2023 11:26:05 +0200 Message-Id: <20230503092606.9415-8-quintela@redhat.com> In-Reply-To: <20230503092606.9415-1-quintela@redhat.com> References: <20230503092606.9415-1-quintela@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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=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: 1683106074663100001 Content-Type: text/plain; charset="utf-8" It is not needed since we moved the accessor for tls properties to options.c. Suggested-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Juan Quintela Reviewed-by: Vladimir Sementsov-Ogievskiy --- migration/tls.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/migration/tls.c b/migration/tls.c index cd29177957..d4a76cf590 100644 --- a/migration/tls.c +++ b/migration/tls.c @@ -29,9 +29,7 @@ #include "trace.h" =20 static QCryptoTLSCreds * -migration_tls_get_creds(MigrationState *s, - QCryptoTLSCredsEndpoint endpoint, - Error **errp) +migration_tls_get_creds(QCryptoTLSCredsEndpoint endpoint, Error **errp) { Object *creds; const char *tls_creds =3D migrate_tls_creds(); @@ -80,8 +78,7 @@ void migration_tls_channel_process_incoming(MigrationStat= e *s, QCryptoTLSCreds *creds; QIOChannelTLS *tioc; =20 - creds =3D migration_tls_get_creds( - s, QCRYPTO_TLS_CREDS_ENDPOINT_SERVER, errp); + creds =3D migration_tls_get_creds(QCRYPTO_TLS_CREDS_ENDPOINT_SERVER, e= rrp); if (!creds) { return; } @@ -124,8 +121,7 @@ QIOChannelTLS *migration_tls_client_create(MigrationSta= te *s, { QCryptoTLSCreds *creds; =20 - creds =3D migration_tls_get_creds( - s, QCRYPTO_TLS_CREDS_ENDPOINT_CLIENT, errp); + creds =3D migration_tls_get_creds(QCRYPTO_TLS_CREDS_ENDPOINT_CLIENT, e= rrp); if (!creds) { return NULL; } --=20 2.40.0 From nobody Tue May 14 02:44:13 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=1683106042; cv=none; d=zohomail.com; s=zohoarc; b=MuKb/IGjmIdhwOlBNnGoWHelhgUORAEXBKeQ6zX52uennRmpnbSUaJeA0WaxNiaaPwNMqrpy2eHXVoJpm0TpvrGeaMYO6nkYWjv8Qu4NvobUqfQ99y7a0AWGo06hCcSdIXea3/wjQra3/I9fK/cP7VR/sb2OYnAVRcAYjlxR2d8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683106042; 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=E4P9/Comv2W+9H69u3LnQkSLu/Ua9tCZaXw7xoUFIfw=; b=KzfKc/K3ISPgugdK8PinVQs/u3irytNbkztA0C2pxMMqoz2vHB38j1z9gqyEUK7AvA+1diQ3OjLC5pUfggHStuVKtAZhOryn76c/pvn8CkaOBl8QsYMTeRj8IeESjFtc5rRV9qdjqyIBQdNrdAqoTebi5yco6MfDMDh1HGvHD3M= 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 1683106042464316.5471435982291; Wed, 3 May 2023 02:27:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pu8ki-0004gz-FI; Wed, 03 May 2023 05:26:24 -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 1pu8kh-0004ge-6R for qemu-devel@nongnu.org; Wed, 03 May 2023 05:26:23 -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 1pu8ke-0002nU-4R for qemu-devel@nongnu.org; Wed, 03 May 2023 05:26:22 -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-209-Ctalv4poMImfyz6516us7w-1; Wed, 03 May 2023 05:26:18 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B20B83C11783; Wed, 3 May 2023 09:26:17 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id CFAAE492C3E; Wed, 3 May 2023 09:26:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683105979; 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=E4P9/Comv2W+9H69u3LnQkSLu/Ua9tCZaXw7xoUFIfw=; b=fQPWYNQmofQPVF32yzMXU7Mly0dfNZuuCVXPV/O7fPZHs+rHfTMgcqdWBwriivIBWn5D/Z 33xNRogxdwddKfILKwZ6mHos53EmrjPTwurpBqU1qkj38ut7Si3Z4OkIeMQphZ2ta/7pJ8 MxpjS+JeGG2U0eGhoVPj7lea/zCajks= X-MC-Unique: Ctalv4poMImfyz6516us7w-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Peter Xu , Juan Quintela , Leonardo Bras , Vladimir Sementsov-Ogievskiy Subject: [PULL 8/8] migration: Drop unused parameter for migration_tls_client_create() Date: Wed, 3 May 2023 11:26:06 +0200 Message-Id: <20230503092606.9415-9-quintela@redhat.com> In-Reply-To: <20230503092606.9415-1-quintela@redhat.com> References: <20230503092606.9415-1-quintela@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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=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: 1683106043289100001 Content-Type: text/plain; charset="utf-8" It is not needed since we moved the accessor for tls properties to options.c. Suggested-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Juan Quintela Reviewed-by: Vladimir Sementsov-Ogievskiy --- migration/multifd.c | 2 +- migration/postcopy-ram.c | 2 +- migration/tls.c | 5 ++--- migration/tls.h | 3 +-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/migration/multifd.c b/migration/multifd.c index 4a2e1a47ce..4e71c19292 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -821,7 +821,7 @@ static void multifd_tls_channel_connect(MultiFDSendPara= ms *p, const char *hostname =3D s->hostname; QIOChannelTLS *tioc; =20 - tioc =3D migration_tls_client_create(s, ioc, hostname, errp); + tioc =3D migration_tls_client_create(ioc, hostname, errp); if (!tioc) { return; } diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 75aa276bb1..5615ec29eb 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -1632,7 +1632,7 @@ postcopy_preempt_send_channel_new(QIOTask *task, gpoi= nter opaque) } =20 if (migrate_channel_requires_tls_upgrade(ioc)) { - tioc =3D migration_tls_client_create(s, ioc, s->hostname, &local_e= rr); + tioc =3D migration_tls_client_create(ioc, s->hostname, &local_err); if (!tioc) { goto out; } diff --git a/migration/tls.c b/migration/tls.c index d4a76cf590..fa03d9136c 100644 --- a/migration/tls.c +++ b/migration/tls.c @@ -114,8 +114,7 @@ static void migration_tls_outgoing_handshake(QIOTask *t= ask, object_unref(OBJECT(ioc)); } =20 -QIOChannelTLS *migration_tls_client_create(MigrationState *s, - QIOChannel *ioc, +QIOChannelTLS *migration_tls_client_create(QIOChannel *ioc, const char *hostname, Error **errp) { @@ -141,7 +140,7 @@ void migration_tls_channel_connect(MigrationState *s, { QIOChannelTLS *tioc; =20 - tioc =3D migration_tls_client_create(s, ioc, hostname, errp); + tioc =3D migration_tls_client_create(ioc, hostname, errp); if (!tioc) { return; } diff --git a/migration/tls.h b/migration/tls.h index 98e23c9b0e..5797d153cb 100644 --- a/migration/tls.h +++ b/migration/tls.h @@ -28,8 +28,7 @@ void migration_tls_channel_process_incoming(MigrationStat= e *s, QIOChannel *ioc, Error **errp); =20 -QIOChannelTLS *migration_tls_client_create(MigrationState *s, - QIOChannel *ioc, +QIOChannelTLS *migration_tls_client_create(QIOChannel *ioc, const char *hostname, Error **errp); =20 --=20 2.40.0