Received: from eggs.gnu.org ([2001:4830:134:3::10]:46160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK639-0005HL-L7 for qemu-devel@nongnu.org; Fri, 15 Jan 2016 10:12:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aK634-0006Be-JZ for qemu-devel@nongnu.org; Fri, 15 Jan 2016 10:12:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53052) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK634-0006BV-BU for qemu-devel@nongnu.org; Fri, 15 Jan 2016 10:12:22 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id E5E73C057EC9 for ; Fri, 15 Jan 2016 15:12:21 +0000 (UTC) From: Paolo Bonzini Date: Fri, 15 Jan 2016 16:12:03 +0100 Message-Id: <1452870739-28484-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 00/16] aio: first part of aio_context_acquire/release pushdown List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: stefanha@redhat.com This is the infrastructure part of the aio_context_acquire/release pushdown, which in turn is the first step towards a real multiqueue block layer in QEMU. The next step is to touch all the drivers and move calls to the aio_context_acquire/release functions from aio-*.c to the drivers. This will be done in a separate patch series. While the inserted lines are a lot, more than half of it are in documentation and formal models of the code, as well as in the implementation of the new "lockcnt" synchronization primitive. The code is also very heavily commented. The first four patches are new, as the issue they fix was found after posting the previous patch. Everything else is more or less the same as before. Paolo Paolo Bonzini (16): aio: introduce aio_context_in_iothread aio: do not really acquire/release the main AIO context aio: introduce aio_poll_internal aio: only call aio_poll_internal from iothread iothread: release AioContext around aio_poll qemu-thread: introduce QemuRecMutex aio: convert from RFifoLock to QemuRecMutex aio: rename bh_lock to list_lock qemu-thread: introduce QemuLockCnt aio: make ctx->list_lock a QemuLockCnt, subsuming ctx->walking_bh qemu-thread: optimize QemuLockCnt with futexes on Linux aio: tweak walking in dispatch phase aio-posix: remove walking_handlers, protecting AioHandler list with list_lock aio-win32: remove walking_handlers, protecting AioHandler list with list_lock aio: document locking aio: push aio_context_acquire/release down to dispatching aio-posix.c | 86 +++++---- aio-win32.c | 106 ++++++----- async.c | 277 +++++++++++++++++++++++---- block/io.c | 14 +- docs/aio_poll_drain.promela | 210 +++++++++++++++++++++ docs/aio_poll_drain_bug.promela | 158 ++++++++++++++++ docs/aio_poll_sync_io.promela | 88 +++++++++ docs/lockcnt.txt | 342 ++++++++++++++++++++++++++++++++++ docs/multiple-iothreads.txt | 48 ++--- include/block/aio.h | 69 ++++--- include/qemu/futex.h | 36 ++++ include/qemu/rfifolock.h | 54 ------ include/qemu/thread-posix.h | 6 + include/qemu/thread-win32.h | 10 + include/qemu/thread.h | 23 +++ iothread.c | 20 +- stubs/iothread-lock.c | 5 + tests/.gitignore | 1 - tests/Makefile | 2 - tests/test-aio.c | 19 +- tests/test-rfifolock.c | 91 --------- trace-events | 10 + util/Makefile.objs | 2 +- util/lockcnt.c | 404 ++++++++++++++++++++++++++++++++++++++++ util/qemu-thread-posix.c | 38 ++-- util/qemu-thread-win32.c | 25 +++ util/rfifolock.c | 78 -------- 27 files changed, 1779 insertions(+), 443 deletions(-) create mode 100644 docs/aio_poll_drain.promela create mode 100644 docs/aio_poll_drain_bug.promela create mode 100644 docs/aio_poll_sync_io.promela create mode 100644 docs/lockcnt.txt create mode 100644 include/qemu/futex.h delete mode 100644 include/qemu/rfifolock.h delete mode 100644 tests/test-rfifolock.c create mode 100644 util/lockcnt.c delete mode 100644 util/rfifolock.c -- 2.5.0