* [Qemu-devel] [PATCH v3] audio: make audio poll timer deterministic
@ 2017-02-14 7:15 Pavel Dovgalyuk
2017-02-14 11:59 ` Paolo Bonzini
0 siblings, 1 reply; 5+ messages in thread
From: Pavel Dovgalyuk @ 2017-02-14 7:15 UTC (permalink / raw)
To: qemu-devel; +Cc: pbonzini, zyy, dovgaluk, kraxel, marcandre.lureau
This patch changes resetting strategy of the audio polling timer.
It does not change expiration time if the timer is already set.
This patch is needed to make this timer deterministic and to use execution
record/replay for audio devices.
audio_reset_timer is used in the function audio_vm_change_state_handler.
Therefore every time VM is stopped or restarted the timer will be reset
to new timeout. Virtual clock does not proceed while VM is stopped.
Therefore there is no need in resetting the timeout when VM restarts.
v2: updated commit message
v3: now using timer_mod_anticipate function (as suggested by Yurii Zubrytskyi)
Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
---
audio/audio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/audio/audio.c b/audio/audio.c
index c845a44..beadf7b 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -1112,7 +1112,7 @@ static int audio_is_timer_needed (void)
static void audio_reset_timer (AudioState *s)
{
if (audio_is_timer_needed ()) {
- timer_mod (s->ts,
+ timer_mod_anticipate_ns(s->ts,
qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + conf.period.ticks);
}
else {
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH v3] audio: make audio poll timer deterministic
2017-02-14 7:15 [Qemu-devel] [PATCH v3] audio: make audio poll timer deterministic Pavel Dovgalyuk
@ 2017-02-14 11:59 ` Paolo Bonzini
2017-02-16 15:12 ` Gerd Hoffmann
0 siblings, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2017-02-14 11:59 UTC (permalink / raw)
To: Pavel Dovgalyuk, qemu-devel; +Cc: zyy, kraxel, marcandre.lureau
On 14/02/2017 08:15, Pavel Dovgalyuk wrote:
> This patch changes resetting strategy of the audio polling timer.
> It does not change expiration time if the timer is already set.
> This patch is needed to make this timer deterministic and to use execution
> record/replay for audio devices.
>
> audio_reset_timer is used in the function audio_vm_change_state_handler.
> Therefore every time VM is stopped or restarted the timer will be reset
> to new timeout. Virtual clock does not proceed while VM is stopped.
> Therefore there is no need in resetting the timeout when VM restarts.
>
> v2: updated commit message
> v3: now using timer_mod_anticipate function (as suggested by Yurii Zubrytskyi)
Gerd, feel free to pick either v2 or v3.
Paolo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH v3] audio: make audio poll timer deterministic
2017-02-14 11:59 ` Paolo Bonzini
@ 2017-02-16 15:12 ` Gerd Hoffmann
2017-02-16 15:16 ` Pavel Dovgalyuk
0 siblings, 1 reply; 5+ messages in thread
From: Gerd Hoffmann @ 2017-02-16 15:12 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Pavel Dovgalyuk, qemu-devel, zyy
On Di, 2017-02-14 at 12:59 +0100, Paolo Bonzini wrote:
>
> On 14/02/2017 08:15, Pavel Dovgalyuk wrote:
> > This patch changes resetting strategy of the audio polling timer.
> > It does not change expiration time if the timer is already set.
> > This patch is needed to make this timer deterministic and to use execution
> > record/replay for audio devices.
> >
> > audio_reset_timer is used in the function audio_vm_change_state_handler.
> > Therefore every time VM is stopped or restarted the timer will be reset
> > to new timeout. Virtual clock does not proceed while VM is stopped.
> > Therefore there is no need in resetting the timeout when VM restarts.
> >
> > v2: updated commit message
> > v3: now using timer_mod_anticipate function (as suggested by Yurii Zubrytskyi)
>
> Gerd, feel free to pick either v2 or v3.
Picked up v3 now.
thanks,
Gerd
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH v3] audio: make audio poll timer deterministic
2017-02-16 15:12 ` Gerd Hoffmann
@ 2017-02-16 15:16 ` Pavel Dovgalyuk
2017-02-16 15:17 ` Gerd Hoffmann
0 siblings, 1 reply; 5+ messages in thread
From: Pavel Dovgalyuk @ 2017-02-16 15:16 UTC (permalink / raw)
To: 'Gerd Hoffmann', 'Paolo Bonzini'
Cc: 'Pavel Dovgalyuk', qemu-devel, zyy, marcandre.lureau
> From: Gerd Hoffmann [mailto:kraxel@redhat.com]
> On Di, 2017-02-14 at 12:59 +0100, Paolo Bonzini wrote:
> > On 14/02/2017 08:15, Pavel Dovgalyuk wrote:
> > > This patch changes resetting strategy of the audio polling timer.
> > > It does not change expiration time if the timer is already set.
> > > This patch is needed to make this timer deterministic and to use execution
> > > record/replay for audio devices.
> > >
> > > audio_reset_timer is used in the function audio_vm_change_state_handler.
> > > Therefore every time VM is stopped or restarted the timer will be reset
> > > to new timeout. Virtual clock does not proceed while VM is stopped.
> > > Therefore there is no need in resetting the timeout when VM restarts.
> > >
> > > v2: updated commit message
> > > v3: now using timer_mod_anticipate function (as suggested by Yurii Zubrytskyi)
> >
> > Gerd, feel free to pick either v2 or v3.
>
> Picked up v3 now.
Thanks!
And what about patch for audio record/replay?
http://lists.nongnu.org/archive/html/qemu-devel/2017-02/msg00345.html
Pavel Dovgalyuk
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH v3] audio: make audio poll timer deterministic
2017-02-16 15:16 ` Pavel Dovgalyuk
@ 2017-02-16 15:17 ` Gerd Hoffmann
0 siblings, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2017-02-16 15:17 UTC (permalink / raw)
To: Pavel Dovgalyuk
Cc: 'Paolo Bonzini', 'Pavel Dovgalyuk', qemu-devel,
zyy, marcandre.lureau
On Do, 2017-02-16 at 18:16 +0300, Pavel Dovgalyuk wrote:
> > From: Gerd Hoffmann [mailto:kraxel@redhat.com]
> > On Di, 2017-02-14 at 12:59 +0100, Paolo Bonzini wrote:
> > > On 14/02/2017 08:15, Pavel Dovgalyuk wrote:
> > > > This patch changes resetting strategy of the audio polling timer.
> > > > It does not change expiration time if the timer is already set.
> > > > This patch is needed to make this timer deterministic and to use execution
> > > > record/replay for audio devices.
> > > >
> > > > audio_reset_timer is used in the function audio_vm_change_state_handler.
> > > > Therefore every time VM is stopped or restarted the timer will be reset
> > > > to new timeout. Virtual clock does not proceed while VM is stopped.
> > > > Therefore there is no need in resetting the timeout when VM restarts.
> > > >
> > > > v2: updated commit message
> > > > v3: now using timer_mod_anticipate function (as suggested by Yurii Zubrytskyi)
> > >
> > > Gerd, feel free to pick either v2 or v3.
> >
> > Picked up v3 now.
>
> Thanks!
>
> And what about patch for audio record/replay?
> http://lists.nongnu.org/archive/html/qemu-devel/2017-02/msg00345.html
Picked that one too (busy preparing a audio pull req atm).
cheers,
Gerd
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-02-16 15:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-14 7:15 [Qemu-devel] [PATCH v3] audio: make audio poll timer deterministic Pavel Dovgalyuk
2017-02-14 11:59 ` Paolo Bonzini
2017-02-16 15:12 ` Gerd Hoffmann
2017-02-16 15:16 ` Pavel Dovgalyuk
2017-02-16 15:17 ` Gerd Hoffmann
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).