From: Jan Kiszka <jan.kiszka@siemens.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Alex Bligh <alex@alex.org.uk>,
Liu Ping Fan <qemulist@gmail.com>,
qemu-devel <qemu-devel@nongnu.org>,
Stefan Hajnoczi <stefanha@redhat.com>,
Anthony Liguori <anthony@codemonkey.ws>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [RFC 0/8] arm AioContext with its own timer stuff
Date: Thu, 25 Jul 2013 16:01:28 +0200 [thread overview]
Message-ID: <51F12FB8.5050003@siemens.com> (raw)
In-Reply-To: <CAJSP0QVpWSo4-iKVrGN0yiCmCCqJwdy3Qy=b8OtMHSM5wFjjZQ@mail.gmail.com>
On 2013-07-25 15:31, Stefan Hajnoczi wrote:
> On Thu, Jul 25, 2013 at 3:06 PM, Jan Kiszka <jan.kiszka@siemens.com> wrote:
>> On 2013-07-25 15:02, Paolo Bonzini wrote:
>>> Il 25/07/2013 14:48, Jan Kiszka ha scritto:
>>>> The concept of clocks (with start/stop property) and active timers shall
>>>> not be mixed, they are independent.
>>>
>>> Are you referring to this in particular:
>>>
>>> void pause_all_vcpus(void)
>>> {
>>> CPUState *cpu = first_cpu;
>>>
>>> qemu_clock_enable(vm_clock, false);
>>> ...
>>> }
>>>
>>> void resume_all_vcpus(void)
>>> {
>>> CPUState *cpu = first_cpu;
>>>
>>> qemu_clock_enable(vm_clock, true);
>>> ...
>>> }
>>>
>>> where _all_ the vm_clock timer lists need to be stopped at the same time?
>>
>> Still wrong abstraction: the vm_clock is stopped. And that implies that
>> no timer using this clock will fire anymore.
>
> Perhaps we should split QEMUClock into ClockSource and TimerList.
> Instead of using the int type field in TimerList we keep a ClockSource
> pointer.
>
> A ClockSource can be enabled/disabled.
>
> Then there's the question of ClockSource thread-safety. Host clock is
> weird because it notifies listeners when the clock source jumps.
Detection can be handled with a per-clock lock, dispatching can continue
to run under BQL for now.
> vm clock is hard because of icount.
True.
>
> It's also weird to think about multiple threads dispatching timer
> callbacks while a ClockSource is disabled. Basically, do we need a
> guarantee that timer callbacks have completed and will not be invoked
> in any thread after the disable function returns?
We need to make sure that no timer callback dispatcher works with a
clock value that is past the one at which we stopped. The simple answer
to this is a lock...
>
> But assuming thread-safety is addressed, this would fit the design
> you're suggesting.
Yes, this looks good.
Jan
--
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2013-07-25 14:01 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-21 8:42 [Qemu-devel] [RFC 0/8] arm AioContext with its own timer stuff Liu Ping Fan
2013-07-21 8:42 ` [Qemu-devel] [RFC 1/8] timer: associate alarm_timer with AioContext Liu Ping Fan
2013-07-22 6:55 ` Jan Kiszka
2013-07-21 8:42 ` [Qemu-devel] [RFC 2/8] timer: pick out timer list info from QemuClock Liu Ping Fan
2013-07-21 8:43 ` [Qemu-devel] [RFC 3/8] timer: make timers_state static Liu Ping Fan
2013-07-22 6:36 ` [Qemu-trivial] " Jan Kiszka
2013-07-22 6:36 ` [Qemu-devel] " Jan Kiszka
2013-07-22 17:40 ` [Qemu-trivial] " Michael Tokarev
2013-07-22 17:40 ` [Qemu-devel] " Michael Tokarev
2013-07-21 8:43 ` [Qemu-devel] [RFC 4/8] timer: protect timers_state with lock Liu Ping Fan
2013-07-22 6:40 ` Jan Kiszka
2013-07-21 8:43 ` [Qemu-devel] [RFC 5/8] timer: associate timer with AioContext Liu Ping Fan
2013-07-21 8:43 ` [Qemu-devel] [RFC 6/8] timer: run timers on aio_poll Liu Ping Fan
2013-07-21 9:55 ` Alex Bligh
2013-07-23 2:56 ` liu ping fan
2013-07-23 14:22 ` Alex Bligh
2013-07-21 8:43 ` [Qemu-devel] [RFC 7/8] block: associate BlockDriverState with AioContext Liu Ping Fan
2013-07-21 8:43 ` [Qemu-devel] [RFC 8/8] block: enable throttle with aiocontext Liu Ping Fan
2013-07-21 9:53 ` [Qemu-devel] [RFC 0/8] arm AioContext with its own timer stuff Alex Bligh
2013-07-22 4:38 ` liu ping fan
2013-07-22 6:28 ` Jan Kiszka
2013-07-23 2:51 ` liu ping fan
2013-07-25 11:44 ` Stefan Hajnoczi
2013-07-25 12:01 ` Jan Kiszka
2013-07-22 9:40 ` Alex Bligh
2013-07-22 10:18 ` liu ping fan
2013-07-23 2:53 ` liu ping fan
2013-07-23 10:30 ` Paolo Bonzini
2013-07-24 1:28 ` liu ping fan
2013-07-24 6:42 ` Paolo Bonzini
2013-07-24 7:31 ` Alex Bligh
2013-07-24 7:43 ` Paolo Bonzini
2013-07-24 8:01 ` Alex Bligh
2013-07-24 8:19 ` Paolo Bonzini
2013-07-24 8:37 ` Alex Bligh
2013-07-24 11:28 ` Paolo Bonzini
2013-07-24 8:30 ` liu ping fan
2013-07-24 7:43 ` liu ping fan
2013-07-24 7:54 ` Paolo Bonzini
2013-07-24 8:06 ` Alex Bligh
2013-07-24 14:46 ` [Qemu-devel] [PATCHv2a] [RFC 8/7 (really)] Add prctl(PR_SET_TIMERSLACK, 1, ...) to reduce timer slack Alex Bligh
2013-07-23 14:21 ` [Qemu-devel] [RFC 0/8] arm AioContext with its own timer stuff Alex Bligh
2013-07-25 11:47 ` Stefan Hajnoczi
2013-07-25 12:05 ` Stefan Hajnoczi
2013-07-25 12:21 ` Alex Bligh
2013-07-25 12:32 ` Jan Kiszka
2013-07-25 12:35 ` Paolo Bonzini
2013-07-25 12:38 ` Jan Kiszka
2013-07-25 12:41 ` Stefan Hajnoczi
2013-07-25 12:48 ` Jan Kiszka
2013-07-25 13:02 ` Paolo Bonzini
2013-07-25 13:06 ` Jan Kiszka
2013-07-25 13:31 ` Stefan Hajnoczi
2013-07-25 14:01 ` Jan Kiszka [this message]
2013-07-25 12:59 ` Paolo Bonzini
2013-07-25 18:53 ` Alex Bligh
2013-07-26 8:43 ` Stefan Hajnoczi
2013-07-26 9:08 ` Alex Bligh
2013-07-26 9:19 ` Paolo Bonzini
2013-07-29 8:58 ` Kevin Wolf
2013-07-29 10:22 ` Alex Bligh
2013-07-29 10:45 ` Paolo Bonzini
2013-07-31 9:02 ` Stefan Hajnoczi
2013-07-26 10:05 ` Jan Kiszka
2013-07-26 19:29 ` Alex Bligh
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=51F12FB8.5050003@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=alex@alex.org.uk \
--cc=anthony@codemonkey.ws \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemulist@gmail.com \
--cc=stefanha@gmail.com \
--cc=stefanha@redhat.com \
/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.