qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Dovgalyuk <dovgaluk@ispras.ru>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Pavel Dovgalyuk <Pavel.Dovgaluk@gmail.com>,
	qemu-devel@nongnu.org
Cc: alex.bennee@linaro.org, pavel.dovgaluk@ispras.ru
Subject: Re: [PATCH] replay: notify the main loop when there are no instructions
Date: Mon, 15 Jun 2020 08:39:03 +0300	[thread overview]
Message-ID: <44b8f06f-aa8f-33ac-175a-f3af5f9e87e5@ispras.ru> (raw)
In-Reply-To: <d0f6ee58-39fd-e8a0-11a4-b7692183dcbb@redhat.com>


On 01.06.2020 17:01, Paolo Bonzini wrote:
> On 01/06/20 12:35, Pavel Dovgalyuk wrote:
>> ping
>>
>> On 22.05.2020 09:47, Pavel Dovgalyuk wrote:
>>> When QEMU is executed in console mode without any external event sources,
>>> main loop may sleep for a very long time. But in case of replay
>>> there is another event source - event log.
>>> This patch adds main loop notification when the vCPU loop has nothing
>>> to do and main loop should process the inputs from the event log.
>>>
>>> Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
> It's a long weekend here today but I should get a QEMU pull request
> submitted on Wednesday.

Thanks, but this patch and "replay: synchronize on every virtual timer 
callback" were not included.

Replay tests are succeeded only with these patches.


>
> Paolo
>
>>>    0 files changed
>>>
>>> diff --git a/cpus.c b/cpus.c
>>> index 7ce0d569b3..b4d0d9f21b 100644
>>> --- a/cpus.c
>>> +++ b/cpus.c
>>> @@ -1362,6 +1362,13 @@ static int64_t tcg_get_icount_limit(void)
>>>        }
>>>    }
>>>    +static void notify_aio_contexts(void)
>>> +{
>>> +    /* Wake up other AioContexts.  */
>>> +    qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
>>> +    qemu_clock_run_timers(QEMU_CLOCK_VIRTUAL);
>>> +}
>>> +
>>>    static void handle_icount_deadline(void)
>>>    {
>>>        assert(qemu_in_vcpu_thread());
>>> @@ -1370,9 +1377,7 @@ static void handle_icount_deadline(void)
>>>                                                         
>>> QEMU_TIMER_ATTR_ALL);
>>>              if (deadline == 0) {
>>> -            /* Wake up other AioContexts.  */
>>> -            qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
>>> -            qemu_clock_run_timers(QEMU_CLOCK_VIRTUAL);
>>> +            notify_aio_contexts();
>>>            }
>>>        }
>>>    }
>>> @@ -1395,6 +1400,10 @@ static void prepare_icount_for_run(CPUState *cpu)
>>>            cpu->icount_extra = cpu->icount_budget - insns_left;
>>>              replay_mutex_lock();
>>> +
>>> +        if (cpu->icount_budget == 0 && replay_has_checkpoint()) {
>>> +            notify_aio_contexts();
>>> +        }
>>>        }
>>>    }
>>>   


  reply	other threads:[~2020-06-15  5:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22  6:47 [PATCH] replay: notify the main loop when there are no instructions Pavel Dovgalyuk
2020-05-22 13:00 ` no-reply
2020-06-01 10:35 ` Pavel Dovgalyuk
2020-06-01 14:01   ` Paolo Bonzini
2020-06-15  5:39     ` Pavel Dovgalyuk [this message]
2020-06-15 13:40       ` 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=44b8f06f-aa8f-33ac-175a-f3af5f9e87e5@ispras.ru \
    --to=dovgaluk@ispras.ru \
    --cc=Pavel.Dovgaluk@gmail.com \
    --cc=alex.bennee@linaro.org \
    --cc=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).