From: Avi Kivity <avi@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
liu ping fan <qemulist@gmail.com>,
Anthony Liguori <anthony@codemonkey.ws>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [big lock] Discussion about the convention of device's DMA each other after breaking down biglock
Date: Wed, 19 Sep 2012 13:27:26 +0300 [thread overview]
Message-ID: <50599E0E.7010704@redhat.com> (raw)
In-Reply-To: <50599C25.1020904@redhat.com>
On 09/19/2012 01:19 PM, Paolo Bonzini wrote:
> Il 19/09/2012 12:06, Avi Kivity ha scritto:
>>> > (The hunch is that ts could be deleted exactly at the moment the
>>> > callback is unlocked. This can be solved with ref/unref on the opaque
>>> > value, as you mention below).
>> Are you saying that this works as is or not? It does seem broken wrt
>> deletion; after qemu_del_timer() completes the caller expects the
>> callback not to be called.
>
> Ouch, then I think the only solution is to remove this invariant if you
> add fine-grained locking and re-check the enable conditions in the timer
> callback.
I think so too, I know authors of GUI frameworks suffer from this
problem (the GUI calling into the framework vs. the framework asking the
GUI to repaint). Don't know what the state of the art solution is.
>
> If you allow calling del_timer to be called with the device lock held,
> you cannot fixing without deadlocking. If you don't, the caller of
> del_timer cannot set any expectation because the timer could be run in
> the window between dropping the device lock and calling del_timer
>
Right. Callbacks should check qemu_timer_deleted() after taking their
little lock. The reference held by the timer subsystem protects against
qemu_free_timer().
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2012-09-19 10:27 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-19 3:02 [Qemu-devel] [big lock] Discussion about the convention of device's DMA each other after breaking down biglock liu ping fan
2012-09-19 8:06 ` Avi Kivity
2012-09-19 9:00 ` liu ping fan
2012-09-19 9:07 ` Avi Kivity
2012-09-19 9:11 ` liu ping fan
2012-09-19 9:14 ` Paolo Bonzini
2012-09-19 9:19 ` liu ping fan
2012-09-19 9:23 ` Avi Kivity
2012-09-19 9:27 ` Jan Kiszka
2012-09-19 9:28 ` Jan Kiszka
2012-09-20 7:51 ` liu ping fan
2012-09-20 7:54 ` Paolo Bonzini
2012-09-20 8:09 ` liu ping fan
2012-09-20 8:27 ` Paolo Bonzini
2012-09-20 9:07 ` Avi Kivity
2012-09-21 7:27 ` liu ping fan
2012-09-21 8:21 ` Paolo Bonzini
2012-09-19 9:21 ` Avi Kivity
2012-09-19 9:51 ` Paolo Bonzini
2012-09-19 10:06 ` Avi Kivity
2012-09-19 10:19 ` Paolo Bonzini
2012-09-19 10:27 ` Avi Kivity [this message]
2012-09-19 9:34 ` Jan Kiszka
2012-09-19 9:50 ` Avi Kivity
2012-09-19 10:18 ` Jan Kiszka
2012-09-24 6:33 ` liu ping fan
2012-09-24 7:44 ` Avi Kivity
2012-09-24 8:32 ` liu ping fan
2012-09-24 9:42 ` Avi Kivity
2012-09-27 3:13 ` liu ping fan
2012-09-27 9:16 ` Avi Kivity
2012-09-27 9:29 ` Paolo Bonzini
2012-09-27 9:34 ` Avi Kivity
2012-09-27 9:36 ` Paolo Bonzini
2012-09-27 10:08 ` Avi Kivity
2012-09-27 10:22 ` Paolo Bonzini
2012-09-27 10:48 ` Avi Kivity
2012-09-29 9:20 ` liu ping fan
2012-09-30 8:13 ` Avi Kivity
2012-09-30 8:48 ` liu ping fan
2012-09-30 11:18 ` Avi Kivity
2012-09-30 11:04 ` Blue Swirl
2012-09-30 11:17 ` Avi Kivity
2012-09-30 11:48 ` Blue Swirl
2012-09-20 8:11 ` liu ping fan
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=50599E0E.7010704@redhat.com \
--to=avi@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=jan.kiszka@siemens.com \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemulist@gmail.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 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).