From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGYcX-0005xT-TG for qemu-devel@nongnu.org; Sat, 18 Jul 2015 16:22:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZGYcU-0006tN-Le for qemu-devel@nongnu.org; Sat, 18 Jul 2015 16:22:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52584) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGYcU-0006tD-HQ for qemu-devel@nongnu.org; Sat, 18 Jul 2015 16:22:02 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 3DBE392490 for ; Sat, 18 Jul 2015 20:22:02 +0000 (UTC) From: Paolo Bonzini Date: Sat, 18 Jul 2015 22:21:54 +0200 Message-Id: <1437250916-18905-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 0/2] AioContext: fix missing wakeups due to event_notifier_test_and_clear List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, famz@redhat.com, lersek@redhat.com, rjones@redhat.com, stefanha@redhat.com This series fixes the remaining case where aio_poll() could hang I/O on the main thread due to a missing wakeup. It consists of a bugfix and an optimization, both of which have survived hundreds of tests on aarch64. Both the bugfix and the optimization come with a formal model of the interactions between the main thread, the VCPU thread doing aio_poll, and the worker thread doing qemu_bh_schedule. The models can test the code both with and without ctx->notify_me, showing that this bug is independent from the other. The patches apply on top of the ctx->notify_me v3. The code changes are really pretty small; the second patch has a good deal of comments too. Paolo Paolo Bonzini (2): AioContext: fix broken placement of event_notifier_test_and_clear AioContext: optimize clearing the EventNotifier aio-posix.c | 2 + aio-win32.c | 2 + async.c | 16 ++++- docs/aio_notify_accept.promela | 152 +++++++++++++++++++++++++++++++++++++++++ docs/aio_notify_bug.promela | 140 +++++++++++++++++++++++++++++++++++++ include/block/aio.h | 32 ++++++++- 6 files changed, 342 insertions(+), 2 deletions(-) create mode 100644 docs/aio_notify_accept.promela create mode 100644 docs/aio_notify_bug.promela -- 2.4.3