All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Dovgalyuk <pavel.dovgalyuk@ispras.ru>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: alex.bennee@linaro.org
Subject: Re: [PATCH v2] replay: notify CPU on event
Date: Mon, 29 Mar 2021 14:23:48 +0300	[thread overview]
Message-ID: <4be6bee2-fa58-09ec-439f-8ccd99a965e8@ispras.ru> (raw)
In-Reply-To: <0fa410cd-32e8-5349-dbde-0c61fdc29e80@redhat.com>

On 29.03.2021 13:29, Paolo Bonzini wrote:
> On 29/03/21 09:43, Pavel Dovgalyuk wrote:
>> This patch enables vCPU notification to wake it up
>> when new async event comes in replay mode.
>>
>> The motivation of this patch is the following.
>> Consider recorded block async event. It is saved into the log
>> with one of the checkpoints. This checkpoint may be passed in
>> vCPU loop. In replay mode when this async event is read from
>> the log, and block thread task is not finished yet, vCPU thread
>> goes to sleep. That is why this patch adds waking up the vCPU
>> to process this finished event.
>>
>> Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
>> ---
>>   replay/replay-events.c |    1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/replay/replay-events.c b/replay/replay-events.c
>> index a1c6bb934e..92dc800219 100644
>> --- a/replay/replay-events.c
>> +++ b/replay/replay-events.c
>> @@ -126,6 +126,7 @@ void replay_add_event(ReplayAsyncEventKind 
>> event_kind,
>>       g_assert(replay_mutex_locked());
>>       QTAILQ_INSERT_TAIL(&events_list, event, events);
>> +    qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
>>   }
> 
> I still do not understand why the qemu_clock_notify function is used to 
> notify the CPU.  It would be nice to have a description of the call 
> chain in a comment or to have a more appropriate API.  I can queue the 
> patch since it's deep in replay-events.c and not in common code, but if 
> you post a short description here I'll integrate it.

Maybe I missed something.
This call is needed for the case when vCPU is waiting in rr_wait_io_event.
You mean that we can use qemu_cpu_kick instead?

Pavel Dovgalyuk


  reply	other threads:[~2021-03-29 11:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-29  7:43 [PATCH v2] replay: notify CPU on event Pavel Dovgalyuk
2021-03-29 10:29 ` Paolo Bonzini
2021-03-29 11:23   ` Pavel Dovgalyuk [this message]
2021-03-29 12:10     ` Paolo Bonzini
  -- strict thread matches above, loose matches on Subject: below --
2021-02-16  9:34 Pavel Dovgalyuk
2021-02-24  8:26 ` Pavel Dovgalyuk
2021-03-15  6:01 ` Pavel Dovgalyuk

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=4be6bee2-fa58-09ec-439f-8ccd99a965e8@ispras.ru \
    --to=pavel.dovgalyuk@ispras.ru \
    --cc=alex.bennee@linaro.org \
    --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 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.