From nobody Tue Dec 24 13:28:54 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1734691391; cv=none; d=zohomail.com; s=zohoarc; b=fJuxoX4P1gBr3v1yPcl0/NA/QrgYTA+uVrvqDQDquND/32LczlivhpDascuahE8KiXrQYc8Qa/LmeRtOrAiIWTue5/O5BvGiL3P+R0bzGjb6XmsxWvN72XPRevPF/GKz+j8ipOK/sIB6OfJ7MeN98LH9tyHGP9EZXITwvkscX1Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734691391; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=XupcwXC4o3WF/HULC2+F2cneFMCliOmRf8I9otsFFoY=; b=dz87GVTGVIkr849dqY06Lyy3OIL+7vg47QT5I77umObSUSUTkWreRZWHCTNPxjg2IlaTQ2EFZ7PeiVXF8Cq7G276AYgXLzp9aWdlBRffeZuQ7hXryv9BlnAs8n6ZNjJ52aHX/LgMncjLv+ZmpoeIg/lnqJkNbHdfL7EzDqTMxyg= 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 173469139162486.85862550153843; Fri, 20 Dec 2024 02:43:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOaT6-0001qc-SR; Fri, 20 Dec 2024 05:42:53 -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 1tOaSx-0001nM-Oq; Fri, 20 Dec 2024 05:42:45 -0500 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOaSw-0005CO-5K; Fri, 20 Dec 2024 05:42:43 -0500 Received: by mail-pg1-x533.google.com with SMTP id 41be03b00d2f7-7ea9739647bso1146473a12.0; Fri, 20 Dec 2024 02:42:41 -0800 (PST) Received: from wheely.local0.net (14-200-18-130.tpgi.com.au. [14.200.18.130]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee06dfd3sm5376942a91.32.2024.12.20.02.42.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2024 02:42:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734691360; x=1735296160; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XupcwXC4o3WF/HULC2+F2cneFMCliOmRf8I9otsFFoY=; b=Ynu1bUmlM2Rtrzp7v9pUsjTpReyS6Dg9Jc8nHfU/2r+nz6rNKKTReJOcp+tXfVp+CO A2HnpyKuf1sTZOLXDd2QySH1PBoH/YEPW2MEmurZjYorcYHH0mSQbmROvDqVwaTRCGuc k/pYgBWW8T/XwB3gC0cq0P0lVPhRDQVrjNkJsxG/9RUNjpzPrsnWgBGPCC4XRyQb/Eat UE4hFs076h4Upl5gZGevRZlT+8tFOSK42AjoC8fUveyAmeyhJs8AyB9GlEeB7dveM9cU ZcQJsNy2kTdEhvqZB1Fi35OKAnRH8AuPPJmdebFViI1Nw0DMEYd84gl7pVNkWY5l0Yim YGng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734691360; x=1735296160; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XupcwXC4o3WF/HULC2+F2cneFMCliOmRf8I9otsFFoY=; b=Z6B5ZLDxuFckeybKmCwNWgHjZdZuPAS5vMxcn/syXinuL66lci8GSIM92h7gTL0Gs9 uuv4/te/Nix1mQHiM39+clSIsm9jyFA1uxqpKY8375Sg3ELELxRXlSt2wMyion9dgVHw 8KqwHsgXErsxFIE7WFD1yPXA2a5ZJqLWNGaBAcu9U5fTvLsWD4i1z1H/ORVjJN++MTaW MTeyr0Hh3LMSnaA5B2baQsnduGHHqwDQojDU79ObYveh98JJv+9TT36SctuJoZOpd+w9 6w4wWW4vIAMy2htXKOcyV3C3pmjyTWVnak9x+enRHWnevxIii/1wafl2VtcUwzU4PD/b tSnw== X-Forwarded-Encrypted: i=1; AJvYcCU66/7USo7gPJmtnj5toDkWLOubmuXADI6M/5x9SVzNJX4OgcH3dsdPWsxffVBuBvicX20kFwDXACAy@nongnu.org X-Gm-Message-State: AOJu0YyzapgNBekOJkMRP6wJEmZNBi7MpOxJfZJ70GgJb56La2T0rnuo 5vTTWrap3RhUPzQJquuX682UZCy1khL7UqsBLFG2De1NWubsTutBHzd2RA== X-Gm-Gg: ASbGnct1CdgAD475rEpIqDETZFDyBSIyF2DDQxoPkWrBWFAVwpdmwMGhOFHqo2CnrjK thLF5FG6oNQyXh/xTgisyWL6k1gOdEXSBDee4UmcxyiorFt8DJIxsGDAFspDjS7UKmEN8oeoHIB 2w42UxDp6AskUhjXqxny7dBh4iQPeAlVFTgmxqR6ycWB9IC8CJlTBSdC/DCgPLLRhbAiECCUB3m 3yyuVxUz+ShXtvAgUTyWSSspy4nSMrO+UQlO4/XXBP723SZzi4Sxm4PVIb0okuk/6wJ70TVnibN diebb3G0jQ== X-Google-Smtp-Source: AGHT+IHJhPOBTvl9hvqnAZAZ22ZbgfEzsYzSOUpu2MkVulCan7laK8qWWrQZ8Uj1EucTtG726jT1rw== X-Received: by 2002:a17:90b:524b:b0:2ee:c457:bf83 with SMTP id 98e67ed59e1d1-2f452e38c6cmr3862965a91.19.1734691360038; Fri, 20 Dec 2024 02:42:40 -0800 (PST) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Kevin Wolf , Hanna Reitz , Pavel Dovgalyuk , Paolo Bonzini , Stefan Hajnoczi , Fam Zheng , Ronnie Sahlberg , John Snow , "Michael S. Tsirkin" , Jason Wang , Vladimir Sementsov-Ogievskiy , Peter Xu , Fabiano Rosas , "Dr. David Alan Gilbert" , Markus Armbruster , Michael Roth , Wainer dos Santos Moschetta Subject: [PATCH 01/17] replay: Fix migration use of clock for statistics Date: Fri, 20 Dec 2024 20:42:03 +1000 Message-ID: <20241220104220.2007786-2-npiggin@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241220104220.2007786-1-npiggin@gmail.com> References: <20241220104220.2007786-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2607:f8b0:4864:20::533; envelope-from=npiggin@gmail.com; helo=mail-pg1-x533.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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 @gmail.com) X-ZM-MESSAGEID: 1734691393760116600 Content-Type: text/plain; charset="utf-8" Migration reads CLOCK_HOST when not holding the replay_mutex, which asserts when recording a trace. These are not guest visible so should be CLOCK_REALTIME like other statistics in MigrationState, which do not require the replay_mutex. Signed-off-by: Nicholas Piggin --- migration/migration.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 8c5bd0a75c8..2eb9e50a263 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -3433,7 +3433,7 @@ static void *migration_thread(void *opaque) { MigrationState *s =3D opaque; MigrationThread *thread =3D NULL; - int64_t setup_start =3D qemu_clock_get_ms(QEMU_CLOCK_HOST); + int64_t setup_start =3D qemu_clock_get_ms(QEMU_CLOCK_REALTIME); MigThrError thr_error; bool urgent =3D false; Error *local_err =3D NULL; @@ -3504,7 +3504,7 @@ static void *migration_thread(void *opaque) goto out; } =20 - s->setup_time =3D qemu_clock_get_ms(QEMU_CLOCK_HOST) - setup_start; + s->setup_time =3D qemu_clock_get_ms(QEMU_CLOCK_REALTIME) - setup_start; =20 trace_migration_thread_setup_complete(); =20 @@ -3584,7 +3584,7 @@ static void *bg_migration_thread(void *opaque) =20 migration_rate_set(RATE_LIMIT_DISABLED); =20 - setup_start =3D qemu_clock_get_ms(QEMU_CLOCK_HOST); + setup_start =3D qemu_clock_get_ms(QEMU_CLOCK_REALTIME); /* * We want to save vmstate for the moment when migration has been * initiated but also we want to save RAM content while VM is running. @@ -3629,7 +3629,7 @@ static void *bg_migration_thread(void *opaque) goto fail_setup; } =20 - s->setup_time =3D qemu_clock_get_ms(QEMU_CLOCK_HOST) - setup_start; + s->setup_time =3D qemu_clock_get_ms(QEMU_CLOCK_REALTIME) - setup_start; =20 trace_migration_thread_setup_complete(); =20 --=20 2.45.2