* [Qemu-devel] [PATCH] audio: make audio poll timer deterministic
@ 2017-01-31 11:59 Pavel Dovgalyuk
2017-01-31 12:11 ` no-reply
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Pavel Dovgalyuk @ 2017-01-31 11:59 UTC (permalink / raw)
To: qemu-devel; +Cc: pbonzini, dovgaluk, kraxel
This patch changes resetting strategy of the audio polling timer.
It does not change expiration time if the timer is already set.
Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
---
audio/audio.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/audio/audio.c b/audio/audio.c
index c845a44..1ee95a5 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -1112,8 +1112,10 @@ static int audio_is_timer_needed (void)
static void audio_reset_timer (AudioState *s)
{
if (audio_is_timer_needed ()) {
- timer_mod (s->ts,
- qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + conf.period.ticks);
+ if (!timer_pending(s->ts)) {
+ timer_mod (s->ts,
+ qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + conf.period.ticks);
+ }
}
else {
timer_del (s->ts);
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] audio: make audio poll timer deterministic
2017-01-31 11:59 [Qemu-devel] [PATCH] audio: make audio poll timer deterministic Pavel Dovgalyuk
@ 2017-01-31 12:11 ` no-reply
2017-01-31 12:16 ` Marc-André Lureau
2017-02-13 5:04 ` Pavel Dovgalyuk
2 siblings, 0 replies; 8+ messages in thread
From: no-reply @ 2017-01-31 12:11 UTC (permalink / raw)
To: pavel.dovgaluk; +Cc: famz, qemu-devel, pbonzini, kraxel
Hi,
Your series seems to have some coding style problems. See output below for
more information:
Type: series
Subject: [Qemu-devel] [PATCH] audio: make audio poll timer deterministic
Message-id: 20170131115913.6828.12266.stgit@PASHA-ISP
=== TEST SCRIPT BEGIN ===
#!/bin/bash
BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0
# Useful git options
git config --local diff.renamelimit 0
git config --local diff.renames True
commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
failed=1
echo
fi
n=$((n+1))
done
exit $failed
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
* [new tag] patchew/20170131115913.6828.12266.stgit@PASHA-ISP -> patchew/20170131115913.6828.12266.stgit@PASHA-ISP
Switched to a new branch 'test'
9c7ac53 audio: make audio poll timer deterministic
=== OUTPUT BEGIN ===
Checking PATCH 1/1: audio: make audio poll timer deterministic...
ERROR: space prohibited between function name and open parenthesis '('
#23: FILE: audio/audio.c:1116:
+ timer_mod (s->ts,
total: 1 errors, 0 warnings, 12 lines checked
Your patch has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===
Test command exited with code: 1
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] audio: make audio poll timer deterministic
2017-01-31 11:59 [Qemu-devel] [PATCH] audio: make audio poll timer deterministic Pavel Dovgalyuk
2017-01-31 12:11 ` no-reply
@ 2017-01-31 12:16 ` Marc-André Lureau
2017-01-31 12:32 ` Pavel Dovgalyuk
2017-02-13 5:04 ` Pavel Dovgalyuk
2 siblings, 1 reply; 8+ messages in thread
From: Marc-André Lureau @ 2017-01-31 12:16 UTC (permalink / raw)
To: Pavel Dovgalyuk, qemu-devel; +Cc: pbonzini, kraxel
Hi
On Tue, Jan 31, 2017 at 4:03 PM Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
wrote:
> This patch changes resetting strategy of the audio polling timer.
> It does not change expiration time if the timer is already set.
>
>
You describe the change, but could you explain the reasons you propose it?
> Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
> ---
> audio/audio.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/audio/audio.c b/audio/audio.c
> index c845a44..1ee95a5 100644
> --- a/audio/audio.c
> +++ b/audio/audio.c
> @@ -1112,8 +1112,10 @@ static int audio_is_timer_needed (void)
> static void audio_reset_timer (AudioState *s)
> {
> if (audio_is_timer_needed ()) {
> - timer_mod (s->ts,
> - qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + conf.period.ticks);
> + if (!timer_pending(s->ts)) {
> + timer_mod (s->ts,
> + qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +
> conf.period.ticks);
> + }
> }
> else {
> timer_del (s->ts);
>
>
> --
Marc-André Lureau
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] audio: make audio poll timer deterministic
2017-01-31 12:16 ` Marc-André Lureau
@ 2017-01-31 12:32 ` Pavel Dovgalyuk
2017-02-01 13:20 ` Gerd Hoffmann
0 siblings, 1 reply; 8+ messages in thread
From: Pavel Dovgalyuk @ 2017-01-31 12:32 UTC (permalink / raw)
To: 'Marc-André Lureau', 'Pavel Dovgalyuk',
qemu-devel
Cc: pbonzini, kraxel
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.
Pavel Dovgalyuk
From: Marc-André Lureau [mailto:marcandre.lureau@gmail.com]
Sent: Tuesday, January 31, 2017 3:16 PM
To: Pavel Dovgalyuk; qemu-devel@nongnu.org
Cc: pbonzini@redhat.com; dovgaluk@ispras.ru; kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH] audio: make audio poll timer deterministic
Hi
On Tue, Jan 31, 2017 at 4:03 PM Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> wrote:
This patch changes resetting strategy of the audio polling timer.
It does not change expiration time if the timer is already set.
You describe the change, but could you explain the reasons you propose it?
Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
---
audio/audio.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/audio/audio.c b/audio/audio.c
index c845a44..1ee95a5 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -1112,8 +1112,10 @@ static int audio_is_timer_needed (void)
static void audio_reset_timer (AudioState *s)
{
if (audio_is_timer_needed ()) {
- timer_mod (s->ts,
- qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + conf.period.ticks);
+ if (!timer_pending(s->ts)) {
+ timer_mod (s->ts,
+ qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + conf.period.ticks);
+ }
}
else {
timer_del (s->ts);
--
Marc-André Lureau
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] audio: make audio poll timer deterministic
2017-01-31 12:32 ` Pavel Dovgalyuk
@ 2017-02-01 13:20 ` Gerd Hoffmann
0 siblings, 0 replies; 8+ messages in thread
From: Gerd Hoffmann @ 2017-02-01 13:20 UTC (permalink / raw)
To: Pavel Dovgalyuk
Cc: 'Marc-André Lureau', 'Pavel Dovgalyuk',
qemu-devel, pbonzini
On Di, 2017-01-31 at 15:32 +0300, Pavel Dovgalyuk wrote:
> 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.
Add that to the commit message please.
cheers,
Gerd
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] audio: make audio poll timer deterministic
2017-01-31 11:59 [Qemu-devel] [PATCH] audio: make audio poll timer deterministic Pavel Dovgalyuk
2017-01-31 12:11 ` no-reply
2017-01-31 12:16 ` Marc-André Lureau
@ 2017-02-13 5:04 ` Pavel Dovgalyuk
2017-02-13 18:40 ` Yurii Zubrytskyi
2 siblings, 1 reply; 8+ messages in thread
From: Pavel Dovgalyuk @ 2017-02-13 5:04 UTC (permalink / raw)
To: 'Pavel Dovgalyuk', qemu-devel; +Cc: pbonzini, kraxel
Ping?
Pavel Dovgalyuk
> -----Original Message-----
> From: Pavel Dovgalyuk [mailto:pavel.dovgaluk@ispras.ru]
> Sent: Tuesday, January 31, 2017 2:59 PM
> To: qemu-devel@nongnu.org
> Cc: pbonzini@redhat.com; dovgaluk@ispras.ru; kraxel@redhat.com
> Subject: [PATCH] audio: make audio poll timer deterministic
>
> This patch changes resetting strategy of the audio polling timer.
> It does not change expiration time if the timer is already set.
>
> Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
> ---
> audio/audio.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/audio/audio.c b/audio/audio.c
> index c845a44..1ee95a5 100644
> --- a/audio/audio.c
> +++ b/audio/audio.c
> @@ -1112,8 +1112,10 @@ static int audio_is_timer_needed (void)
> static void audio_reset_timer (AudioState *s)
> {
> if (audio_is_timer_needed ()) {
> - timer_mod (s->ts,
> - qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + conf.period.ticks);
> + if (!timer_pending(s->ts)) {
> + timer_mod (s->ts,
> + qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + conf.period.ticks);
> + }
> }
> else {
> timer_del (s->ts);
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] audio: make audio poll timer deterministic
2017-02-13 5:04 ` Pavel Dovgalyuk
@ 2017-02-13 18:40 ` Yurii Zubrytskyi
2017-02-14 11:57 ` Paolo Bonzini
0 siblings, 1 reply; 8+ messages in thread
From: Yurii Zubrytskyi @ 2017-02-13 18:40 UTC (permalink / raw)
To: Pavel Dovgalyuk; +Cc: Pavel Dovgalyuk, qemu-devel, pbonzini, kraxel
Hi,
It looks to me that this behavior can be achieved with "timer_mod_anticipate()"
function instead of a separate check.
On Sun, Feb 12, 2017 at 9:04 PM, Pavel Dovgalyuk <dovgaluk@ispras.ru> wrote:
> Ping?
>
> Pavel Dovgalyuk
>
>
> > -----Original Message-----
> > From: Pavel Dovgalyuk [mailto:pavel.dovgaluk@ispras.ru]
> > Sent: Tuesday, January 31, 2017 2:59 PM
> > To: qemu-devel@nongnu.org
> > Cc: pbonzini@redhat.com; dovgaluk@ispras.ru; kraxel@redhat.com
> > Subject: [PATCH] audio: make audio poll timer deterministic
> >
> > This patch changes resetting strategy of the audio polling timer.
> > It does not change expiration time if the timer is already set.
> >
> > Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
> > ---
> > audio/audio.c | 6 ++++--
> > 1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/audio/audio.c b/audio/audio.c
> > index c845a44..1ee95a5 100644
> > --- a/audio/audio.c
> > +++ b/audio/audio.c
> > @@ -1112,8 +1112,10 @@ static int audio_is_timer_needed (void)
> > static void audio_reset_timer (AudioState *s)
> > {
> > if (audio_is_timer_needed ()) {
> > - timer_mod (s->ts,
> > - qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + conf.period.ticks);
> > + if (!timer_pending(s->ts)) {
> > + timer_mod (s->ts,
> > + qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +
> conf.period.ticks);
> > + }
> > }
> > else {
> > timer_del (s->ts);
>
>
>
>
--
Thanks, Yurii
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH] audio: make audio poll timer deterministic
2017-02-13 18:40 ` Yurii Zubrytskyi
@ 2017-02-14 11:57 ` Paolo Bonzini
0 siblings, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2017-02-14 11:57 UTC (permalink / raw)
To: Yurii Zubrytskyi, Pavel Dovgalyuk; +Cc: Pavel Dovgalyuk, qemu-devel, kraxel
On 13/02/2017 19:40, Yurii Zubrytskyi wrote:
> Hi,
>
> It looks to me that this behavior can be achieved with
> "timer_mod_anticipate()" function instead of a separate check.
True, but I think Pavel's version is more readable. Since the timer is
set to a fixed value from QEMU_CLOCK_VIRTUAL, timer_mod_anticipate is
never going to do anything if the timer is already set.
Paolo
> > diff --git a/audio/audio.c b/audio/audio.c
> > index c845a44..1ee95a5 100644
> > --- a/audio/audio.c
> > +++ b/audio/audio.c
> > @@ -1112,8 +1112,10 @@ static int audio_is_timer_needed (void)
> > static void audio_reset_timer (AudioState *s)
> > {
> > if (audio_is_timer_needed ()) {
> > - timer_mod (s->ts,
> > - qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +
> conf.period.ticks);
> > + if (!timer_pending(s->ts)) {
> > + timer_mod (s->ts,
> > + qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +
> conf.period.ticks);
> > + }
> > }
> > else {
> > timer_del (s->ts);
>
>
>
>
>
>
> --
> Thanks, Yurii
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-02-14 11:57 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-31 11:59 [Qemu-devel] [PATCH] audio: make audio poll timer deterministic Pavel Dovgalyuk
2017-01-31 12:11 ` no-reply
2017-01-31 12:16 ` Marc-André Lureau
2017-01-31 12:32 ` Pavel Dovgalyuk
2017-02-01 13:20 ` Gerd Hoffmann
2017-02-13 5:04 ` Pavel Dovgalyuk
2017-02-13 18:40 ` Yurii Zubrytskyi
2017-02-14 11:57 ` 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).