* [PATCH] replay: notify the main loop when there are no instructions
@ 2020-05-22 6:47 Pavel Dovgalyuk
2020-05-22 13:00 ` no-reply
2020-06-01 10:35 ` Pavel Dovgalyuk
0 siblings, 2 replies; 6+ messages in thread
From: Pavel Dovgalyuk @ 2020-05-22 6:47 UTC (permalink / raw)
To: qemu-devel; +Cc: pbonzini, alex.bennee, pavel.dovgaluk, dovgaluk
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>
---
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();
+ }
}
}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] replay: notify the main loop when there are no instructions
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
1 sibling, 0 replies; 6+ messages in thread
From: no-reply @ 2020-05-22 13:00 UTC (permalink / raw)
To: Pavel.Dovgaluk
Cc: pbonzini, alex.bennee, qemu-devel, pavel.dovgaluk, dovgaluk
Patchew URL: https://patchew.org/QEMU/159013007895.28110.2020104406699709721.stgit@pasha-ThinkPad-X280/
Hi,
This series failed the docker-quick@centos7 build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===
qemu-system-aarch64: cannot set up guest memory 'cubieboard.ram': Cannot allocate memory
Broken pipe
/tmp/qemu-test/src/tests/qtest/libqtest.c:166: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0)
ERROR - too few tests run (expected 67, got 19)
make: *** [check-qtest-aarch64] Error 1
Traceback (most recent call last):
File "./tests/docker/docker.py", line 664, in <module>
sys.exit(main())
---
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=7ed21bd09cfe4abb91aa69bcf8295719', '-u', '1001', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-8uoujxs2/src/docker-src.2020-05-22-08.42.20.23794:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=7ed21bd09cfe4abb91aa69bcf8295719
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-8uoujxs2/src'
make: *** [docker-run-test-quick@centos7] Error 2
real 18m3.909s
user 0m8.461s
The full log is available at
http://patchew.org/logs/159013007895.28110.2020104406699709721.stgit@pasha-ThinkPad-X280/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] replay: notify the main loop when there are no instructions
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
1 sibling, 1 reply; 6+ messages in thread
From: Pavel Dovgalyuk @ 2020-06-01 10:35 UTC (permalink / raw)
To: Pavel Dovgalyuk, qemu-devel; +Cc: pbonzini, alex.bennee, pavel.dovgaluk
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>
> ---
> 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();
> + }
> }
> }
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] replay: notify the main loop when there are no instructions
2020-06-01 10:35 ` Pavel Dovgalyuk
@ 2020-06-01 14:01 ` Paolo Bonzini
2020-06-15 5:39 ` Pavel Dovgalyuk
0 siblings, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2020-06-01 14:01 UTC (permalink / raw)
To: Pavel Dovgalyuk, Pavel Dovgalyuk, qemu-devel; +Cc: alex.bennee, pavel.dovgaluk
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.
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();
>> + }
>> }
>> }
>>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] replay: notify the main loop when there are no instructions
2020-06-01 14:01 ` Paolo Bonzini
@ 2020-06-15 5:39 ` Pavel Dovgalyuk
2020-06-15 13:40 ` Paolo Bonzini
0 siblings, 1 reply; 6+ messages in thread
From: Pavel Dovgalyuk @ 2020-06-15 5:39 UTC (permalink / raw)
To: Paolo Bonzini, Pavel Dovgalyuk, qemu-devel; +Cc: alex.bennee, pavel.dovgaluk
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();
>>> + }
>>> }
>>> }
>>>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] replay: notify the main loop when there are no instructions
2020-06-15 5:39 ` Pavel Dovgalyuk
@ 2020-06-15 13:40 ` Paolo Bonzini
0 siblings, 0 replies; 6+ messages in thread
From: Paolo Bonzini @ 2020-06-15 13:40 UTC (permalink / raw)
To: Pavel Dovgalyuk, Pavel Dovgalyuk, qemu-devel; +Cc: alex.bennee, pavel.dovgaluk
On 15/06/20 07:39, Pavel Dovgalyuk wrote:
>>
>
> Thanks, but this patch and "replay: synchronize on every virtual timer
> callback" were not included.
>
> Replay tests are succeeded only with these patches.
Added back both. I'll be faster this time, promised.
Paolo
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-06-15 13:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2020-06-15 13:40 ` Paolo Bonzini
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).