qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Pavel Dovgalyuk" <dovgaluk@ispras.ru>
To: 'Paolo Bonzini' <pbonzini@redhat.com>,
	'Artem Pisarenko' <artem.k.pisarenko@gmail.com>,
	'Clement Deschamps' <clement.deschamps@greensocs.com>
Cc: qemu-devel@nongnu.org, 'Pavel Dovgalyuk' <Pavel.Dovgaluk@ispras.ru>
Subject: Re: [Qemu-devel] [PATCH] Revert "icount: remove obsolete warp call"
Date: Wed, 17 Oct 2018 16:20:52 +0300	[thread overview]
Message-ID: <005c01d4661c$3a9cd0a0$afd671e0$@ru> (raw)
In-Reply-To: <a29da0a1-85d7-c57c-5c42-27594a7849ac@redhat.com>

> From: Paolo Bonzini [mailto:pbonzini@redhat.com]
> On 17/10/2018 13:38, Pavel Dovgalyuk wrote:
> >> From: Paolo Bonzini [mailto:pbonzini@redhat.com]
> >> On 17/10/2018 11:53, Artem Pisarenko wrote:
> >>> See my last comment in bug report. This kind of modification, even
> >>> adapted to changed function name, doesn't solve issue.
> >>> I thought long time that it does, but once I catched qemu with a hang.
> >>> And of course, I wasn't able to reproduce it. So it just better hides issue.
> >>> Take a look at alternative solution from
> >>> QBox: https://git.greensocs.com/qemu/qbox/commit/a8ed106032e375e715a531d6e93e4d9ec295dbdb
> >>> I didn't catched fail with it (yet).
> >
> > Tried to test it, but rr seems to be broken again.
> > I'll try to bisect now.
> 
> Can we add a test that runs with "make check" and covers the basics of
> record/replay's cpus.c bits?
> 
> rr is very cool, and we fixed/understood a lot of stuff when getting it
> ready for inclusion.  But now it's constantly broken and every time we
> change rr we also risk breaking icount.

I found the source of the bug. As QEMU becomes more multi-threaded and non-synchronized,
checkpoints move from thread to thread.
And the event queue that processed at checkpoints should belong to the same thread
in both record and replay executions.

Current problem was with the checkpoint for virtual timers. They are processed from different threads:
from vCPU and from aio_dispatch function.

Therefore the following patch fixes the problem, but I think that this part has to be refactored.
There should be nailed-to-thread events that process the event queue. Then checkpoints can become
just synchronization events and therefore omitted for empty timer lists, for example.


diff --git a/replay/replay-events.c b/replay/replay-events.c
index 83a7d81..60e8c21 100644
--- a/replay/replay-events.c
+++ b/replay/replay-events.c
@@ -205,6 +205,7 @@ void replay_save_events(int checkpoint)
 {
     g_assert(replay_mutex_locked());
     g_assert(checkpoint != CHECKPOINT_CLOCK_WARP_START);
+    g_assert(checkpoint != CHECKPOINT_CLOCK_VIRTUAL);
     while (!QTAILQ_EMPTY(&events_list)) {
         Event *event = QTAILQ_FIRST(&events_list);
         replay_save_event(event, checkpoint);
diff --git a/replay/replay.c b/replay/replay.c
index 93d2573..79b8485 100644
--- a/replay/replay.c
+++ b/replay/replay.c
@@ -231,7 +231,8 @@ bool replay_checkpoint(ReplayCheckpoint checkpoint)
         /* This checkpoint belongs to several threads.
            Processing events from different threads is
            non-deterministic */
-        if (checkpoint != CHECKPOINT_CLOCK_WARP_START) {
+        if (checkpoint != CHECKPOINT_CLOCK_WARP_START
+            && checkpoint != CHECKPOINT_CLOCK_VIRTUAL) {
             replay_save_events(checkpoint);
         }
         res = true;

Pavel Dovgalyuk

  parent reply	other threads:[~2018-10-17 13:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-17  9:07 [Qemu-devel] [PATCH] Revert "icount: remove obsolete warp call" Paolo Bonzini
2018-10-17  9:37 ` Pavel Dovgalyuk
2018-10-17  9:53   ` Artem Pisarenko
2018-10-17 10:17     ` Paolo Bonzini
2018-10-17 11:38       ` Pavel Dovgalyuk
2018-10-17 11:42         ` Paolo Bonzini
2018-10-17 11:43           ` Pavel Dovgalyuk
2018-10-17 12:30             ` Alex Bennée
2018-10-17 12:11           ` Pavel Dovgalyuk
2018-10-17 13:20           ` Pavel Dovgalyuk [this message]
2018-10-17 13:32             ` Artem Pisarenko
2018-10-18  5:49               ` Pavel Dovgalyuk
2018-10-17 14:43             ` Paolo Bonzini
2018-10-18  2:22               ` Clement Deschamps

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='005c01d4661c$3a9cd0a0$afd671e0$@ru' \
    --to=dovgaluk@ispras.ru \
    --cc=Pavel.Dovgaluk@ispras.ru \
    --cc=artem.k.pisarenko@gmail.com \
    --cc=clement.deschamps@greensocs.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).