From: Stefan Hajnoczi <stefanha@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kwolf@redhat.com, lersek@redhat.com, famz@redhat.com,
qemu-devel@nongnu.org, rjones@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2] AioContext: fix broken placement of event_notifier_test_and_clear
Date: Mon, 20 Jul 2015 17:36:20 +0100 [thread overview]
Message-ID: <20150720163620.GN12675@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1437370031-9070-1-git-send-email-pbonzini@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1204 bytes --]
On Mon, Jul 20, 2015 at 07:27:11AM +0200, Paolo Bonzini wrote:
> event_notifier_test_and_clear must be called before processing events.
> Otherwise, an aio_poll could "eat" the notification before the main
> I/O thread invokes ppoll(). The main I/O thread then never wakes up.
> This is an example of what could happen:
>
> i/o thread vcpu thread worker thread
> ---------------------------------------------------------------------
> lock_iothread
> notify_me = 1
> ...
> unlock_iothread
> lock_iothread
> notify_me = 3
> ppoll
> notify_me = 1
> bh->scheduled = 1
> event_notifier_set
> event_notifier_test_and_clear
> ppoll
> *** hang ***
I don't understand this diagram. Why is event_notifier_test_and_clear()
called by the vcpu thread? event_notifier_set() was called *after* vcpu
thread's ppoll() returned so I wouldn't expect the vcpu thread to see
the notify.
Was there a previous notify pending?
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2015-07-20 16:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-20 5:27 [Qemu-devel] [PATCH v2] AioContext: fix broken placement of event_notifier_test_and_clear Paolo Bonzini
2015-07-20 7:46 ` Fam Zheng
2015-07-20 10:06 ` Fam Zheng
2015-07-20 12:42 ` [Qemu-devel] R: " Paolo Bonzini
2015-07-21 1:19 ` [Qemu-devel] " Fam Zheng
2015-07-21 6:51 ` Paolo Bonzini
2015-07-20 16:36 ` Stefan Hajnoczi [this message]
2015-07-20 19:50 ` Paolo Bonzini
2015-07-21 11:04 ` 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=20150720163620.GN12675@stefanha-thinkpad.redhat.com \
--to=stefanha@redhat.com \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=lersek@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rjones@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 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).