From: "Pavel Dovgaluk" <Pavel.Dovgaluk@ispras.ru>
To: 'Paolo Bonzini' <pbonzini@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 4/4] events doubts
Date: Wed, 7 Oct 2015 13:42:22 +0300 [thread overview]
Message-ID: <002f01d100ec$d97bb4e0$8c731ea0$@Dovgaluk@ispras.ru> (raw)
In-Reply-To: <5614F2AA.5080100@redhat.com>
> From: Paolo Bonzini [mailto:pbonzini@redhat.com]
> On 07/10/2015 11:50, Pavel Dovgaluk wrote:
> >> From: Paolo Bonzini [mailto:paolo.bonzini@gmail.com] On Behalf Of Paolo Bonzini
> >> On 07/10/2015 10:21, Pavel Dovgaluk wrote:
> >>> There are two kinds of events:
> >>> - read from the log and injected immediately (user input, network input)
> >>> - read from the log and wait for corresponding event in the queue (BH)
> >>>
> >>> We cannot inject BH event immediately because we do not have any information
> >>> about callback
> >>
> >> Actually we do (indirectly, through aio_bh_call). But that may not be
> >> the central issue, because...
> >>
> >>> and to preserve consistency - BH cannot be processed before
> >>> it is scheduled by qemu core.
> >>
> >> ... you are processing them differently anyway between record mode
> >> (where the BH is scheduled by the core) and replay (where the BH is
> >> called directly).
> >
> > In record it also called through replay. It is scheduled into the replay
> > events queue and called at checkpoint, where queue is flushed.
> >
> >> In fact, I don't understand what introduces the difference between
> >> record and replay that requires special handling of ptimers' bottom
> >> halves. In both cases, the ptimer triggers at the desired time (based
> >> on checkpoints) and then the bottom half is called as soon as possible.
> >> Why is a separate async event necessary?
> >
> > We want to preserve order of all events that affect virtual machine behavior,
> > not only instructions execution. These events include processing of
> > interrupts, exceptions, and bottom halves.
> > That is why bottom halves are bind to checkpoints and recorded into the log.
> >
> >> Because we only care about bottom halves from ptimers, their order
> >> should be the same for both record and replay.
> >>
> >> If bottom halves async events could be removed, that would simplify a
> >> lot the code, and it would make it a lot easier to understand for me.
> >
> > I added ptimer handling because replay didn't work when I removed BH queuing.
>
> Ok, got it. I still want to understand exactly the need for the init
> and reset checkpoints, and the placement of qemu_clock_warp calls, but
> apart from that the patches are good to go for 2.5. Thanks for your
> persistence!
Init checkpoint is needed to separate initialization events (mostly coming from block
devices) from execution ones.
Reset checkpoint is used for synchronization of machine reset call.
Pavel Dovgalyuk
next prev parent reply other threads:[~2015-10-07 10:42 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-06 20:00 [Qemu-devel] [RFH PATCH 0/4] record/replay fixups and doubts Paolo Bonzini
2015-10-06 20:00 ` [Qemu-devel] [PATCH 1/4] replay: generalize ptimer event to bottom halves Paolo Bonzini
2015-10-07 7:53 ` Pavel Dovgaluk
2015-10-06 20:00 ` [Qemu-devel] [PATCH 2/4] more replay fixes Paolo Bonzini
2015-10-06 20:13 ` Eric Blake
2015-10-07 8:11 ` Pavel Dovgaluk
2015-10-06 20:00 ` [Qemu-devel] [PATCH 3/4] why is runstate_is_running needed? Paolo Bonzini
2015-10-07 8:14 ` Pavel Dovgaluk
[not found] ` <22126.3941414238$1444205724@news.gmane.org>
2015-10-07 8:46 ` Paolo Bonzini
2015-10-07 9:37 ` Pavel Dovgaluk
2015-10-06 20:00 ` [Qemu-devel] [PATCH 4/4] events doubts Paolo Bonzini
2015-10-07 8:21 ` Pavel Dovgaluk
[not found] ` <35633.6639299572$1444206177@news.gmane.org>
2015-10-07 8:52 ` Paolo Bonzini
2015-10-07 9:50 ` Pavel Dovgaluk
2015-10-07 10:23 ` Paolo Bonzini
2015-10-07 10:42 ` Pavel Dovgaluk [this message]
2015-10-07 10:48 ` Paolo Bonzini
2015-10-07 10:51 ` Pavel Dovgaluk
2015-10-07 14:59 ` Paolo Bonzini
2015-10-13 8:10 ` [Qemu-devel] [RFH PATCH 0/4] record/replay fixups and doubts Pavel Dovgaluk
2015-10-13 16:39 ` Paolo Bonzini
2015-10-23 7:28 ` Pavel Dovgaluk
2015-10-23 8:12 ` Paolo Bonzini
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='002f01d100ec$d97bb4e0$8c731ea0$@Dovgaluk@ispras.ru' \
--to=pavel.dovgaluk@ispras.ru \
--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).