From nobody Tue Feb 10 14:49:22 2026 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=1682343561; cv=none; d=zohomail.com; s=zohoarc; b=iPxqkJcybVIbv+R5jI0TowroduzwrXa7czd+eeZ+U39kg0rehdhKFOFlhIxjxqXpy4+s2hy0Vy9vfhdJnklegcJ7JP2X8xlG0ikZR+TMCw0em8M7hnBr3k0PO3MhsVe6Xbxtn22+FQQa0sL6sM0ohRGe6G8T+BKYQJAFniNUC0U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682343561; 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=s3/fr4JERXH8o/w7crf1qLjlhfQ2akXnUepo6lQE9fU=; b=cHQZr6O6Xr4kpLY0FUoVHgs8PQJqARJsFhUp+ofeRbn0geKjmQwyqKHowbva4V4lcKaofNlA4Pw6ycwsxMO5ctiKkYIVsLa65w7sW8e4A4acrLJfxmgsOmnAX/Mr0cndwVytj5uInvrfX8ojHzk3gJc1ZI9r/RCSMpkBXIzXKAM= 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 1682343561369402.58932702883146; Mon, 24 Apr 2023 06:39:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pqwG3-000099-V8; Mon, 24 Apr 2023 09:29:32 -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 1pqwFW-0007OM-Vr for qemu-devel@nongnu.org; Mon, 24 Apr 2023 09:29:02 -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 1pqwFT-0001XZ-DH for qemu-devel@nongnu.org; Mon, 24 Apr 2023 09:28:58 -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-60-pHz1a1DcMtKeRocjIWN0cw-1; Mon, 24 Apr 2023 09:28:46 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A254DA0F386; Mon, 24 Apr 2023 13:28:45 +0000 (UTC) Received: from secure.mitica (unknown [10.39.192.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1114D14171B8; Mon, 24 Apr 2023 13:28:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682342928; 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=s3/fr4JERXH8o/w7crf1qLjlhfQ2akXnUepo6lQE9fU=; b=EWPWYdTTWG4xi+admWgsO7y8Q5EhPli2H0lQ6NfQCRhCEgk7Ib7tJJzpi0nKklzMVnAih0 6+DZtAGFu8HKgN62fTBNrlOG0seY8zWO9GVeiYbOPP/aOK7f2im63+uXQhv+ghp6xXOpl1 q0s1HUhbPLzq0X6HN4s/JoFa0NYDjsQ= X-MC-Unique: pHz1a1DcMtKeRocjIWN0cw-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: Hailiang Zhang , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Fam Zheng , Eric Blake , John Snow , Vladimir Sementsov-Ogievskiy , Gerd Hoffmann , Peter Xu , Markus Armbruster , Leonardo Bras , David Hildenbrand , Stefan Hajnoczi , "Michael S. Tsirkin" , qemu-block@nongnu.org, Juan Quintela , Fabiano Rosas Subject: [PULL 24/30] migration: Create migrate_max_cpu_throttle() Date: Mon, 24 Apr 2023 15:27:24 +0200 Message-Id: <20230424132730.70752-25-quintela@redhat.com> In-Reply-To: <20230424132730.70752-1-quintela@redhat.com> References: <20230424132730.70752-1-quintela@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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: 1682343563389100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Juan Quintela Reviewed-by: Fabiano Rosas --- migration/migration.h | 2 -- migration/options.c | 9 +++++++++ migration/options.h | 1 + migration/ram.c | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/migration/migration.h b/migration/migration.h index 86051af132..3ae938b19c 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -451,8 +451,6 @@ bool migrate_postcopy(void); =20 int migrate_use_tls(void); =20 -int migrate_max_cpu_throttle(void); - uint64_t ram_get_total_transferred_pages(void); =20 /* Sending on the return path - generic and then for each message type */ diff --git a/migration/options.c b/migration/options.c index 0e102e5700..2cb04fbbd1 100644 --- a/migration/options.c +++ b/migration/options.c @@ -517,6 +517,15 @@ int migrate_decompress_threads(void) return s->parameters.decompress_threads; } =20 +uint8_t migrate_max_cpu_throttle(void) +{ + MigrationState *s; + + s =3D migrate_get_current(); + + return s->parameters.max_cpu_throttle; +} + int64_t migrate_max_postcopy_bandwidth(void) { MigrationState *s; diff --git a/migration/options.h b/migration/options.h index adc2879bbb..72b1a320b7 100644 --- a/migration/options.h +++ b/migration/options.h @@ -51,6 +51,7 @@ int migrate_compress_level(void); int migrate_compress_threads(void); int migrate_compress_wait_thread(void); int migrate_decompress_threads(void); +uint8_t migrate_max_cpu_throttle(void); int64_t migrate_max_postcopy_bandwidth(void); int migrate_multifd_channels(void); MultiFDCompression migrate_multifd_compression(void); diff --git a/migration/ram.c b/migration/ram.c index e82cee97c3..5c786513ef 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -715,7 +715,7 @@ static void mig_throttle_guest_down(uint64_t bytes_dirt= y_period, uint64_t pct_initial =3D s->parameters.cpu_throttle_initial; uint64_t pct_increment =3D s->parameters.cpu_throttle_increment; bool pct_tailslow =3D s->parameters.cpu_throttle_tailslow; - int pct_max =3D s->parameters.max_cpu_throttle; + int pct_max =3D migrate_max_cpu_throttle(); =20 uint64_t throttle_now =3D cpu_throttle_get_percentage(); uint64_t cpu_now, cpu_ideal, throttle_inc; --=20 2.39.2