From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBgtT-0002wt-52 for qemu-devel@nongnu.org; Tue, 29 Nov 2016 06:48:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBgtN-0007yV-Tq for qemu-devel@nongnu.org; Tue, 29 Nov 2016 06:48:15 -0500 Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 29 Nov 2016 12:46:57 +0100 Message-Id: <20161129114707.2975-1-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH for-2.9 00/10] aio_context_acquire/release pushdown, part 1 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org This is the first step of pushing down the AioContext lock. Bottom halves are already protected by their own lock, use it also for walking_bh and for the handlers list (including walking_handlers). The (lock, walking_foo) pair is wrapped into the QemuLockCnt primitive. Paolo Paolo Bonzini (10): 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 async: optimize aio_bh_poll aio-posix.c | 81 ++++----- aio-win32.c | 107 ++++++------ async.c | 47 +++--- docs/lockcnt.txt | 342 ++++++++++++++++++++++++++++++++++++++ docs/multiple-iothreads.txt | 5 +- include/block/aio.h | 38 ++--- include/qemu/futex.h | 36 ++++ include/qemu/thread.h | 19 +++ util/Makefile.objs | 1 + util/lockcnt.c | 395 ++++++++++++++++++++++++++++++++++++++++++++ util/qemu-thread-posix.c | 25 +-- util/trace-events | 10 ++ 12 files changed, 955 insertions(+), 151 deletions(-) create mode 100644 docs/lockcnt.txt create mode 100644 include/qemu/futex.h create mode 100644 util/lockcnt.c -- 2.9.3