)]}'
{
  "commit": "21a03d17f2edb1e63f7137d97ba355cc6f19d79f",
  "tree": "37068ed33f88b2e8a8eae78a63d798f6f7aa4a30",
  "parents": [
    "eabc977973103527bbb8fed69c91cfaa6691f8ab"
  ],
  "author": {
    "name": "Paolo Bonzini",
    "email": "pbonzini@redhat.com",
    "time": "Tue Jul 21 16:07:52 2015 +0200"
  },
  "committer": {
    "name": "Stefan Hajnoczi",
    "email": "stefanha@redhat.com",
    "time": "Wed Jul 22 12:41:40 2015 +0100"
  },
  "message": "AioContext: fix broken placement of event_notifier_test_and_clear\n\nevent_notifier_test_and_clear must be called before processing events.\nOtherwise, an aio_poll could \"eat\" the notification before the main\nI/O thread invokes ppoll().  The main I/O thread then never wakes up.\nThis is an example of what could happen:\n\n   i/o thread       vcpu thread                     worker thread\n   ---------------------------------------------------------------------\n   lock_iothread\n   notify_me \u003d 1\n   ...\n   unlock_iothread\n                                                     bh-\u003escheduled \u003d 1\n                                                     event_notifier_set\n                    lock_iothread\n                    notify_me \u003d 3\n                    ppoll\n                    notify_me \u003d 1\n                    aio_dispatch\n                     aio_bh_poll\n                      thread_pool_completion_bh\n                                                     bh-\u003escheduled \u003d 1\n                                                     event_notifier_set\n                     node-\u003eio_read(node-\u003eopaque)\n                      event_notifier_test_and_clear\n   ppoll\n   *** hang ***\n\n\"Tracing\" with qemu_clock_get_ns shows pretty much the same behavior as\nin the previous bug, so there are no new tricks here---just stare more\nat the code until it is apparent.\n\nOne could also use a formal model, of course.  The included one shows\nthis with three processes: notifier corresponds to a QEMU thread pool\nworker, temporary_waiter to a VCPU thread that invokes aio_poll(),\nwaiter to the main I/O thread.  I would be happy to say that the\nformal model found the bug for me, but actually I wrote it after the\nfact.\n\nThis patch is a bit of a big hammer.  The next one optimizes it,\nwith help (this time for real rather than a posteriori :)) from\nanother, similar formal model.\n\nReported-by: Richard W. M. Jones \u003crjones@redhat.com\u003e\nSigned-off-by: Paolo Bonzini \u003cpbonzini@redhat.com\u003e\nReviewed-by: Fam Zheng \u003cfamz@redhat.com\u003e\nTested-by: Richard W.M. Jones \u003crjones@redhat.com\u003e\nMessage-id: 1437487673-23740-6-git-send-email-pbonzini@redhat.com\nSigned-off-by: Stefan Hajnoczi \u003cstefanha@redhat.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "249889f14ce2a895fc6226422b1bef83310374de",
      "old_mode": 33188,
      "old_path": "aio-posix.c",
      "new_id": "5c8b266c72b79e07f881a563da189e0267937766",
      "new_mode": 33188,
      "new_path": "aio-posix.c"
    },
    {
      "type": "modify",
      "old_id": "ea655b0935dd4577be30bcacc5f2fc13e9971da6",
      "old_mode": 33188,
      "old_path": "aio-win32.c",
      "new_id": "7afc9992d682d335b4fce58182b580f7f678f503",
      "new_mode": 33188,
      "new_path": "aio-win32.c"
    },
    {
      "type": "modify",
      "old_id": "a23219214836d6ff221ede489d53d9751c282323",
      "old_mode": 33188,
      "old_path": "async.c",
      "new_id": "d625e8a8035656711f156078bbc7784b4f4754b0",
      "new_mode": 33188,
      "new_path": "async.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "b3bfca1ca4f52f73365c413af97c0bd739be922d",
      "new_mode": 33188,
      "new_path": "docs/aio_notify_bug.promela"
    }
  ]
}
