All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
Cc: xen-devel@lists.xenproject.org,
	Doug Goldstein <cardoe@cardoe.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH] automation: fix race condition in adl-suspend test
Date: Mon, 30 Oct 2023 12:42:52 +0100	[thread overview]
Message-ID: <ZT-WvAye6OlWGLAx@macbook> (raw)
In-Reply-To: <20231028033404.262729-1-marmarek@invisiblethingslab.com>

On Sat, Oct 28, 2023 at 05:33:57AM +0200, Marek Marczykowski-Górecki 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.
> 
> 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.
> 
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> ---
> 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(-)
> 
> 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/guest-domU.log; do
>      sleep 1
>  done
>  echo \"${wait_and_wakeup}\"
> +# let the above message flow to console, then suspend
> +sleep 5

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.

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.

Anyway, adding the extra sync might be good regardless, and keeping
the sleep.

Thanks, Roger.


  reply	other threads:[~2023-10-30 11:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-28  3:33 [PATCH] automation: fix race condition in adl-suspend test Marek Marczykowski-Górecki
2023-10-30 11:42 ` Roger Pau Monné [this message]
2023-10-30 16:32   ` Marek Marczykowski-Górecki
2023-10-30 16:38     ` Marek Marczykowski-Górecki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZT-WvAye6OlWGLAx@macbook \
    --to=roger.pau@citrix.com \
    --cc=cardoe@cardoe.com \
    --cc=marmarek@invisiblethingslab.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.