From nobody Wed May 15 08:45:45 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=1683201239; cv=none; d=zohomail.com; s=zohoarc; b=YoJb+k1Ms9FJHaJpV9za5oxa14zJ0U4Cps7l2hsBz3+imrfpfwnEsspLbQKrj6Q4fBMjuHtPtD4dbC1iSO8/7Sbt5tH5qyfbxCgc5DSqpcDSOeRQq/YR/lftVuKZ0NIBQ4wXwMhuw8/R1BCMnD1eYrPG4iAS+Kv3fAgd0GKL7z8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683201239; h=Content-Type: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=uZy5BeUHyl/UrDmarPzqqglMMSReLvHwoJEoHEswzgs=; b=Tzx5abfoC7jClxBKHZbKmN5w5jmxGVrMAQADDcCAGOGalYSUNVjNl7fVlhVpts99qCU2xsEeUhP42MljQ5x3mXKbDNm8fs4F5HBr4IrEPD3yJFSFsk8WgY0xpN0Jc9ADgQ4iP7/cm3I904HMqO+Nw2nsnoksXyL5qh+Fu9KZ1+o= 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 1683201239671780.1848082777542; Thu, 4 May 2023 04:53:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puXWp-0001Fp-P8; Thu, 04 May 2023 07:53:43 -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 1puXWc-0001E2-Sj for qemu-devel@nongnu.org; Thu, 04 May 2023 07:53:32 -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 1puXWa-0001R4-Mo for qemu-devel@nongnu.org; Thu, 04 May 2023 07:53:29 -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-224-ar1a9dEWOGiOL22SgAD6nw-1; Thu, 04 May 2023 07:53:26 -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 0C2BD811E7C for ; Thu, 4 May 2023 11:53:26 +0000 (UTC) Received: from secure.mitica (unknown [10.39.193.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id E644D492C3E; Thu, 4 May 2023 11:53:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683201207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uZy5BeUHyl/UrDmarPzqqglMMSReLvHwoJEoHEswzgs=; b=KfhcYN+Z1nFIdoFVFxb8VZNXmFF78/iGSijx4E1NHIaekj8v8w3ViW3NgltnbUwOpq8iqd QTSQA/nlAFoQnFRsQ5HaZHj6eOM4mO0u7hzunUuKHQbtqn4TYqX711cBxqLndZObAVILWT ci4eMveQYvDGgxtTEfivc8AL/eFV/FQ= X-MC-Unique: ar1a9dEWOGiOL22SgAD6nw-1 From: Juan Quintela To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Leonardo Bras , Juan Quintela , Peter Xu Subject: [PATCH] migration: Rename xbzrle_enabled xbzrle_started Date: Thu, 4 May 2023 13:53:23 +0200 Message-Id: <20230504115323.24407-1-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.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.161, 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: 1683201241367100003 Otherwise it is confusing with the function xbzrle_enabled(). Suggested-by: Daniel P. Berrang=C3=A9 Signed-off-by: Juan Quintela Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Peter Xu --- migration/ram.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 43338e1f5b..06015eeb0b 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -388,8 +388,8 @@ struct RAMState { uint64_t xbzrle_pages_prev; /* Amount of xbzrle encoded bytes since the beginning of the period */ uint64_t xbzrle_bytes_prev; - /* Start using XBZRLE (e.g., after the first round). */ - bool xbzrle_enabled; + /* Are we really using XBZRLE (e.g., after the first round). */ + bool xbzrle_started; /* Are we on the last stage of migration */ bool last_stage; /* compression statistics since the beginning of the period */ @@ -1420,7 +1420,7 @@ static int ram_save_page(RAMState *rs, PageSearchStat= us *pss) trace_ram_save_page(block->idstr, (uint64_t)offset, p); =20 XBZRLE_cache_lock(); - if (rs->xbzrle_enabled && !migration_in_postcopy()) { + if (rs->xbzrle_started && !migration_in_postcopy()) { pages =3D save_xbzrle_page(rs, pss, &p, current_addr, block, offset); if (!rs->last_stage) { @@ -1636,7 +1636,7 @@ static int find_dirty_block(RAMState *rs, PageSearchS= tatus *pss) pss->complete_round =3D true; /* After the first round, enable XBZRLE. */ if (migrate_xbzrle()) { - rs->xbzrle_enabled =3D true; + rs->xbzrle_started =3D true; } } /* Didn't find anything this time, but try again on the new block = */ @@ -2288,7 +2288,7 @@ static bool save_page_use_compression(RAMState *rs) * using the data compression. In theory, xbzrle can do better than * compression. */ - if (rs->xbzrle_enabled) { + if (rs->xbzrle_started) { return false; } =20 @@ -2357,7 +2357,7 @@ static int ram_save_target_page_legacy(RAMState *rs, = PageSearchStatus *pss) /* Must let xbzrle know, otherwise a previous (now 0'd) cached * page would be stale */ - if (rs->xbzrle_enabled) { + if (rs->xbzrle_started) { XBZRLE_cache_lock(); xbzrle_cache_zero_page(rs, block->offset + offset); XBZRLE_cache_unlock(); @@ -2738,7 +2738,7 @@ static void ram_state_reset(RAMState *rs) rs->last_seen_block =3D NULL; rs->last_page =3D 0; rs->last_version =3D ram_list.version; - rs->xbzrle_enabled =3D false; + rs->xbzrle_started =3D false; } =20 #define MAX_WAIT 50 /* ms, half buffered_file limit */ --=20 2.40.0