From: Jan Kiszka <jan.kiszka@siemens.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "alex@alex.org.uk" <alex@alex.org.uk>,
Anthony Liguori <aliguori@us.ibm.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Stefan Hajnoczi <stefanha@redhat.com>,
"rth@twiddle.net" <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH 0/3] qemu-timer: make QEMUTimer functions thread-safe
Date: Mon, 15 Jul 2013 14:57:41 +0200 [thread overview]
Message-ID: <51E3F1C5.6030602@siemens.com> (raw)
In-Reply-To: <51E3EEDA.4080501@redhat.com>
On 2013-07-15 14:45, Paolo Bonzini wrote:
> Il 05/07/2013 19:51, Jan Kiszka ha scritto:
>> On 2013-07-05 14:39, Stefan Hajnoczi wrote:
>>> This series makes the following functions thread-safe:
>>>
>>> qemu_mod_timer_ns()
>>> qemu_mod_timer()
>>> qemu_del_timer()
>>> qemu_timer_pending()
>>>
>>> The following were already thread-safe:
>>>
>>> qemu_free_timer()
>>> qemu_new_timer()
>>> qemu_timer_expired()
>>>
>>> Now it is possible to use QEMUTimer outside the QEMU global mutex. Timer
>>> callbacks are still invoked from the main loop. If a thread wishes to run
>>> timer callbacks it must use a thread-safe QEMUBH (which Ping Fan Liu is working
>>> on).
>>
>> What do you mean with this? We need main-loop independent timers for any
>> task that depends on timely alarm delivery. Do your patches keep this in
>> mind as well?
>
> These are orthogonal issues. Stefan's usecase does not need timely
> delivery.
Not necessarily. Timely delivery is likely the harder requirement that
also fulfills the need to move timer setup/manipulation outside of BQL.
I didn't have time to look into details yet, but there is a risk that
this rework will not help to achieve RT qualities but rather needs
another, non-orthogonal rework.
>
>>> Note that host_clock is not thread-safe because it keeps state and invokes
>>> reset notifiers. Device emulation threads mostly care about vm_clock, so this
>>> is not a problem.
>>
>> I suppose you know that vm_clock cannot be read outside BQL yet due to
>> timers_state and, under TCG, icount. Any ideas regarding this already? I
>> didn't have to solve that problem so far as I only need CLOCK_REALTIME
>> outside BQL.
>
> I was thinking of a seqlock. It should be quite cheap, since there
> would be hardly any contention.
Will think about this as well.
>
> No ideas about host_clock's notifiers.
Hmm, we should be able to push the notification into BH context over the
main thread. Just jump detection requires the read context - unless we
want to poll for it.
Jan
--
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2013-07-15 12:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-05 12:39 [Qemu-devel] [PATCH 0/3] qemu-timer: make QEMUTimer functions thread-safe Stefan Hajnoczi
2013-07-05 12:39 ` [Qemu-devel] [PATCH 1/3] qemu-timer: drop outdated signal safety comments Stefan Hajnoczi
2013-07-05 17:52 ` Jan Kiszka
2013-07-05 12:39 ` [Qemu-devel] [PATCH 2/3] qemu-timer: add QEMUClock->active_timers list lock Stefan Hajnoczi
2013-07-05 13:01 ` Paolo Bonzini
2013-07-05 12:39 ` [Qemu-devel] [PATCH 3/3] qemu-timer: add qemu_alarm_timer->timer_modified_lock Stefan Hajnoczi
2013-07-05 17:51 ` [Qemu-devel] [PATCH 0/3] qemu-timer: make QEMUTimer functions thread-safe Jan Kiszka
2013-07-15 12:45 ` Paolo Bonzini
2013-07-15 12:57 ` Jan Kiszka [this message]
2013-07-15 13:38 ` Paolo Bonzini
2013-07-18 4:00 ` Stefan Hajnoczi
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=51E3F1C5.6030602@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=alex@alex.org.uk \
--cc=aliguori@us.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--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.