From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 164D5C4167D for ; Mon, 30 Oct 2023 16:39:07 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.625324.974529 (Exim 4.92) (envelope-from ) id 1qxVHv-00040R-HM; Mon, 30 Oct 2023 16:38:51 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 625324.974529; Mon, 30 Oct 2023 16:38:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qxVHv-00040K-Ei; Mon, 30 Oct 2023 16:38:51 +0000 Received: by outflank-mailman (input) for mailman id 625324; Mon, 30 Oct 2023 16:38:50 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qxVHt-00040A-Uz for xen-devel@lists.xenproject.org; Mon, 30 Oct 2023 16:38:49 +0000 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id cb2619c5-7742-11ee-98d6-6d05b1d4d9a1; Mon, 30 Oct 2023 17:38:48 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id EC4A65C022C; Mon, 30 Oct 2023 12:38:44 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 30 Oct 2023 12:38:44 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 30 Oct 2023 12:38:43 -0400 (EDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: cb2619c5-7742-11ee-98d6-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1698683924; x=1698770324; bh=H3FMm/KCOvYupYm8lx7+FY9QkhQ2/K9SJCK V5VPpvSE=; b=CTiqYtHl00tCgERkKdZHfKZlS3dbXPQtBs/yP4mmxebTSEjRo+I WXNjhmQyf+gc4S7/f7cydfVcb8+HbJQgk7thZS4Bu+Xxhr9bt3A7TolkS8BzsUV7 thMxSMFNROrPylVw72Y/Dn85kOkcQjG6G6gZ2NidKQrrlq+aXUqHQcx48ZTTyf9d Lp1EK6J8gKADTVWxzMD+VSg7iVDhRlpsr1wZmYX2eybOXFp1aDpxy7lKo7I27RUN 27Gd2ZOgI6XvMrkbwtWaY70MsjVCcakuZhPerBjOEHT99uUYF6p8I59ExPDrsAJ2 hO1RcOxwGx3/Fk8cpH/bAuICVqTZLktROhA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1698683924; x=1698770324; bh=H3FMm/KCOvYup Ym8lx7+FY9QkhQ2/K9SJCKV5VPpvSE=; b=fRsIR26mJT/vGYovfsdFBVU4A+cDp djp+Wq2JaIxZhL9fRwcvf3MOjmFuncjR4PHvrsdiyloHfaSxND2gVCHfOF2RPVaf +74UW3USNehJ7l4a7VC0WEyoFDwAwjJxat6JCBWfsDp2bSTRyw7LYDfqo5s7IRmb PazezrbNPKAiIkyTOC4TuP8/DWkIQbR/x2JOb/bV+0BE9gwX9ReuV4AWCuViSB1A 7dlCMaahKTnFD0VIsatUGHZ0KQ+0d00s8nnaG/orJc75qRm61BFsCwtIXr+w2dme QJoVCTILI0oASgh/H29QwbCVsVxZLAf7RVqnaX/heDpX2kqgR+qaKZRnw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedruddttddgkeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtjeenucfhrhhomhepofgrrhgv khcuofgrrhgtiiihkhhofihskhhiqdfikphrvggtkhhiuceomhgrrhhmrghrvghksehinh hvihhsihgslhgvthhhihhnghhslhgrsgdrtghomheqnecuggftrfgrthhtvghrnhepgfdu leetfeevhfefheeiteeliefhjefhleduveetteekveettddvgeeuteefjedunecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghk sehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomh X-ME-Proxy: Feedback-ID: i1568416f:Fastmail Date: Mon, 30 Oct 2023 17:38:41 +0100 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: Roger Pau =?utf-8?B?TW9ubsOp?= Cc: xen-devel@lists.xenproject.org, Doug Goldstein , Stefano Stabellini Subject: Re: [PATCH] automation: fix race condition in adl-suspend test Message-ID: References: <20231028033404.262729-1-marmarek@invisiblethingslab.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="paK9yxII+R3FdtFG" Content-Disposition: inline In-Reply-To: --paK9yxII+R3FdtFG Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Oct 2023 17:38:41 +0100 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: Roger Pau =?utf-8?B?TW9ubsOp?= Cc: xen-devel@lists.xenproject.org, Doug Goldstein , Stefano Stabellini Subject: Re: [PATCH] automation: fix race condition in adl-suspend test On Mon, Oct 30, 2023 at 05:32:08PM +0100, Marek Marczykowski-G=C3=B3recki w= rote: > On Mon, Oct 30, 2023 at 12:42:52PM +0100, Roger Pau Monn=C3=A9 wrote: > > On Sat, Oct 28, 2023 at 05:33:57AM +0200, Marek Marczykowski-G=C3=B3rec= ki wrote: > > > If system suspends too quickly, the message for the test controller to > > > wake up the system may be not sent to the console before suspending. > > > This will cause the test to timeout. > > >=20 > > > Fix this by waiting a bit after printing the message. The test > > > controller then resumes the system 30s after the message, so as long = as > > > the delay + suspending takes less time it is okay. > > >=20 > > > Signed-off-by: Marek Marczykowski-G=C3=B3recki > > > --- > > > This is consistent with the observation that sync_console "fixes" the > > > issue. > > > --- > > > automation/scripts/qubes-x86-64.sh | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > >=20 > > > diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/= qubes-x86-64.sh > > > index 26131b082671..a34db96e4585 100755 > > > --- a/automation/scripts/qubes-x86-64.sh > > > +++ b/automation/scripts/qubes-x86-64.sh > > > @@ -54,11 +54,11 @@ until grep 'domU started' /var/log/xen/console/gu= est-domU.log; do > > > sleep 1 > > > done > > > echo \"${wait_and_wakeup}\" > > > +# let the above message flow to console, then suspend > > > +sleep 5 > >=20 > > Could you use `sync /dev/stdout`? I guess that might not be enough, > > since the sync won't be propagated to the hypervisor, and hence even > > if flushed from Linux, we have no guarantee that the hypervisor has > > also flushed it. >=20 > It seems `sync /dev/stdout` helps too, at least in a limited sample of > two. =2E.. and the third attempt (with sync instead of sleep) failed. > > Xen should flush the buffer when a newline character is found, but I > > have no idea whether context could return to guest while the buffer is > > still in the process of being fully flushed. >=20 > IIC Xen should flush the console buffer on the suspend path (there is > console_start_sync() in enter_state()). So, if linux manages to send it > to Xen in time, all should be good (in theory at least). >=20 > > Anyway, adding the extra sync might be good regardless, and keeping > > the sleep. >=20 > Good idea, I'll send v2 with it included. --=20 Best Regards, Marek Marczykowski-G=C3=B3recki Invisible Things Lab --paK9yxII+R3FdtFG Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmU/3BIACgkQ24/THMrX 1yxrDwf/UzxTdP8sfURuvoBtUSKDzS5kWeowPDyaxhZcyqa8LthzBme/GiY7vUil WOG2mtDAJSoDG3HleBdPpiPwtxPg8+NK0c+iLmLb15ulRkybYl0DlqpfCnXebtAm OqJA+Fxbsmw7vo+v+sNgGUOlZFrCAFraBlD+nkQliuN50sGJ0NRB7WRqR1aNSYXl SqifHkeUTYfh2aKpBxwph6goSESfmNzjGc7o0DmLv4IeLetBvlULT/zAPXcLFzsp QWzwVu9EGQrnkyOcKzIOk2XXxHUU9qq5s+zfuHxosiiHQgHnfjGLR+k9t4qyNk2y jfyCNQlvnAHsDHyixlzUi3XuPzsvOw== =eFxg -----END PGP SIGNATURE----- --paK9yxII+R3FdtFG--