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: pgpD1hL9o1e6a.pgp
Description: PGP signature

Reply via email to