[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-commits] [qemu/qemu] c2b38b: block: move AioContext, QEMUTimer, ma
From: |
GitHub |
Subject: |
[Qemu-commits] [qemu/qemu] c2b38b: block: move AioContext, QEMUTimer, main-loop to li... |
Date: |
Tue, 21 Feb 2017 06:00:13 -0800 |
Branch: refs/heads/master
Home: https://github.com/qemu/qemu
Commit: c2b38b277a7882a592f4f2ec955084b2b756daaa
https://github.com/qemu/qemu/commit/c2b38b277a7882a592f4f2ec955084b2b756daaa
Author: Paolo Bonzini <address@hidden>
Date: 2017-02-21 (Tue, 21 Feb 2017)
Changed paths:
M Makefile.objs
R aio-posix.c
R aio-win32.c
R async.c
M block/io.c
R iohandler.c
R main-loop.c
R qemu-timer.c
M stubs/Makefile.objs
A stubs/linux-aio.c
M stubs/set-fd-handler.c
M tests/Makefile.include
R thread-pool.c
M trace-events
M util/Makefile.objs
A util/aio-posix.c
A util/aio-win32.c
A util/aiocb.c
A util/async.c
A util/iohandler.c
A util/main-loop.c
A util/qemu-timer.c
A util/thread-pool.c
M util/trace-events
Log Message:
-----------
block: move AioContext, QEMUTimer, main-loop to libqemuutil
AioContext is fairly self contained, the only dependency is QEMUTimer but
that in turn doesn't need anything else. So move them out of block-obj-y
to avoid introducing a dependency from io/ to block-obj-y.
main-loop and its dependency iohandler also need to be moved, because
later in this series io/ will call iohandler_get_aio_context.
[Changed copyright "the QEMU team" to "other QEMU contributors" as
suggested by Daniel Berrange and agreed by Paolo.
--Stefan]
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Commit: 0c330a734b51c177ab8488932ac3b0c4d63a718a
https://github.com/qemu/qemu/commit/0c330a734b51c177ab8488932ac3b0c4d63a718a
Author: Paolo Bonzini <address@hidden>
Date: 2017-02-21 (Tue, 21 Feb 2017)
Changed paths:
M include/block/aio.h
M include/qemu/coroutine_int.h
M tests/Makefile.include
A tests/iothread.c
A tests/iothread.h
A tests/test-aio-multithread.c
M util/async.c
M util/qemu-coroutine.c
M util/trace-events
Log Message:
-----------
aio: introduce aio_co_schedule and aio_co_wake
aio_co_wake provides the infrastructure to start a coroutine on a "home"
AioContext. It will be used by CoMutex and CoQueue, so that coroutines
don't jump from one context to another when they go to sleep on a
mutex or waitqueue. However, it can also be used as a more efficient
alternative to one-shot bottom halves, and saves the effort of tracking
which AioContext a coroutine is running on.
aio_co_schedule is the part of aio_co_wake that starts a coroutine
on a remove AioContext, but it is also useful to implement e.g.
bdrv_set_aio_context callbacks.
The implementation of aio_co_schedule is based on a lock-free
multiple-producer, single-consumer queue. The multiple producers use
cmpxchg to add to a LIFO stack. The consumer (a per-AioContext bottom
half) grabs all items added so far, inverts the list to make it FIFO,
and goes through it one item at a time until it's empty. The data
structure was inspired by OSv, which uses it in the very code we'll
"port" to QEMU for the thread-safe CoMutex.
Most of the new code is really tests.
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Commit: 35f106e68464d4ed9f2059a93f5c2ecd0750c05b
https://github.com/qemu/qemu/commit/35f106e68464d4ed9f2059a93f5c2ecd0750c05b
Author: Paolo Bonzini <address@hidden>
Date: 2017-02-21 (Tue, 21 Feb 2017)
Changed paths:
M block/block-backend.c
Log Message:
-----------
block-backend: allow blk_prw from coroutine context
qcow2_create2 calls this. Do not run a nested event loop, as that
breaks when aio_co_wake tries to queue the coroutine on the co_queue_wakeup
list of the currently running one.
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Commit: 934ebf48c0e81dd1f3febb53ae9b8eb8f2a12aab
https://github.com/qemu/qemu/commit/934ebf48c0e81dd1f3febb53ae9b8eb8f2a12aab
Author: Paolo Bonzini <address@hidden>
Date: 2017-02-21 (Tue, 21 Feb 2017)
Changed paths:
M tests/test-thread-pool.c
Log Message:
-----------
test-thread-pool: use generic AioContext infrastructure
Once the thread pool starts using aio_co_wake, it will also need
qemu_get_current_aio_context(). Make test-thread-pool create
an AioContext with qemu_init_main_loop, so that stubs/iothread.c
and tests/iothread.c can provide the rest.
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Commit: bf88c1247f80ac6d62710d5d0d0d9ce3a53e99ec
https://github.com/qemu/qemu/commit/bf88c1247f80ac6d62710d5d0d0d9ce3a53e99ec
Author: Paolo Bonzini <address@hidden>
Date: 2017-02-21 (Tue, 21 Feb 2017)
Changed paths:
M include/io/channel.h
M io/channel-command.c
M io/channel-file.c
M io/channel-socket.c
M io/channel-tls.c
M io/channel-watch.c
M io/channel.c
Log Message:
-----------
io: add methods to set I/O handlers on AioContext
This is in preparation for making qio_channel_yield work on
AioContexts other than the main one.
Reviewed-by: Daniel P. Berrange <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Commit: c4c497d27f0be8552ae244e76ba2bce66bd2443e
https://github.com/qemu/qemu/commit/c4c497d27f0be8552ae244e76ba2bce66bd2443e
Author: Paolo Bonzini <address@hidden>
Date: 2017-02-21 (Tue, 21 Feb 2017)
Changed paths:
M include/io/channel.h
M io/channel.c
Log Message:
-----------
io: make qio_channel_yield aware of AioContexts
Support separate coroutines for reading and writing, and place the
read/write handlers on the AioContext that the QIOChannel is registered
with.
Reviewed-by: Daniel P. Berrange <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Commit: ff82911cd3f69f028f2537825c9720ff78bc3f19
https://github.com/qemu/qemu/commit/ff82911cd3f69f028f2537825c9720ff78bc3f19
Author: Paolo Bonzini <address@hidden>
Date: 2017-02-21 (Tue, 21 Feb 2017)
Changed paths:
M block/nbd-client.c
M block/nbd-client.h
M nbd/client.c
M nbd/common.c
M nbd/server.c
Log Message:
-----------
nbd: convert to use qio_channel_yield
In the client, read the reply headers from a coroutine, switching the
read side between the "read header" coroutine and the I/O coroutine that
reads the body of the reply.
In the server, if the server can read more requests it will create a new
"read request" coroutine as soon as a request has been read. Otherwise,
the new coroutine is created in nbd_request_put.
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Commit: a9d9235567e7637d474fa9a52432c63c9feeed07
https://github.com/qemu/qemu/commit/a9d9235567e7637d474fa9a52432c63c9feeed07
Author: Paolo Bonzini <address@hidden>
Date: 2017-02-21 (Tue, 21 Feb 2017)
Changed paths:
M util/qemu-coroutine-lock.c
M util/trace-events
Log Message:
-----------
coroutine-lock: reschedule coroutine on the AioContext it was running on
As a small step towards the introduction of multiqueue, we want
coroutines to remain on the same AioContext that started them,
unless they are moved explicitly with e.g. aio_co_schedule. This patch
avoids that coroutines switch AioContext when they use a CoMutex.
For now it does not make much of a difference, because the CoMutex
is not thread-safe and the AioContext itself is used to protect the
CoMutex from concurrent access. However, this is going to change.
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Commit: e5c67ab552fb056827b5b40356c0ef235e975e7e
https://github.com/qemu/qemu/commit/e5c67ab552fb056827b5b40356c0ef235e975e7e
Author: Paolo Bonzini <address@hidden>
Date: 2017-02-21 (Tue, 21 Feb 2017)
Changed paths:
M block/blkdebug.c
Log Message:
-----------
blkdebug: reschedule coroutine on the AioContext it is running on
Keep the coroutine on the same AioContext. Without this change,
there would be a race between yielding the coroutine and reentering it.
While the race cannot happen now, because the code only runs from a single
AioContext, this will change with multiqueue support in the block layer.
While doing the change, replace custom bottom half with aio_co_schedule.
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Commit: b20123a28b18568cb6a40680e15821fdb171a8bf
https://github.com/qemu/qemu/commit/b20123a28b18568cb6a40680e15821fdb171a8bf
Author: Paolo Bonzini <address@hidden>
Date: 2017-02-21 (Tue, 21 Feb 2017)
Changed paths:
M block/qed.c
Log Message:
-----------
qed: introduce qed_aio_start_io and qed_aio_next_io_cb
qed_aio_start_io and qed_aio_next_io will not have to acquire/release
the AioContext, while qed_aio_next_io_cb will. Split the functionality
and gain a little type-safety in the process.
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Commit: 0836c72f70143ba7d4277d89efc7643c526dd90a
https://github.com/qemu/qemu/commit/0836c72f70143ba7d4277d89efc7643c526dd90a
Author: Paolo Bonzini <address@hidden>
Date: 2017-02-21 (Tue, 21 Feb 2017)
Changed paths:
M util/aio-posix.c
M util/aio-win32.c
M util/async.c
Log Message:
-----------
aio: push aio_context_acquire/release down to dispatching
The AioContext data structures are now protected by list_lock and/or
they are walked with FOREACH_RCU primitives. There is no need anymore
to acquire the AioContext for the entire duration of aio_dispatch.
Instead, just acquire it before and after invoking the callbacks.
The next step is then to push it further down.
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Commit: 2f47da5f7f88d3966a2cb33cc9de53f134fea367
https://github.com/qemu/qemu/commit/2f47da5f7f88d3966a2cb33cc9de53f134fea367
Author: Paolo Bonzini <address@hidden>
Date: 2017-02-21 (Tue, 21 Feb 2017)
Changed paths:
M block/curl.c
M block/io.c
M block/iscsi.c
M block/null.c
M block/qed.c
M block/qed.h
M block/throttle-groups.c
M util/aio-posix.c
M util/aio-win32.c
M util/qemu-coroutine-sleep.c
Log Message:
-----------
block: explicitly acquire aiocontext in timers that need it
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Commit: 9d456654482a8bd1ff72f0bdbe1f393149a5680a
https://github.com/qemu/qemu/commit/9d456654482a8bd1ff72f0bdbe1f393149a5680a
Author: Paolo Bonzini <address@hidden>
Date: 2017-02-21 (Tue, 21 Feb 2017)
Changed paths:
M block/curl.c
M block/iscsi.c
M block/linux-aio.c
M block/nfs.c
M block/sheepdog.c
M block/ssh.c
M block/win32-aio.c
M hw/block/virtio-blk.c
M hw/scsi/virtio-scsi.c
M util/aio-posix.c
M util/aio-win32.c
Log Message:
-----------
block: explicitly acquire aiocontext in callbacks that need it
This covers both file descriptor callbacks and polling callbacks,
since they execute related code.
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Commit: 1919631e6b5562e474690853eca3c35610201e16
https://github.com/qemu/qemu/commit/1919631e6b5562e474690853eca3c35610201e16
Author: Paolo Bonzini <address@hidden>
Date: 2017-02-21 (Tue, 21 Feb 2017)
Changed paths:
M block/archipelago.c
M block/blkreplay.c
M block/block-backend.c
M block/curl.c
M block/gluster.c
M block/io.c
M block/iscsi.c
M block/linux-aio.c
M block/nfs.c
M block/null.c
M block/qed.c
M block/rbd.c
M dma-helpers.c
M hw/block/virtio-blk.c
M hw/scsi/scsi-bus.c
M util/async.c
M util/thread-pool.c
Log Message:
-----------
block: explicitly acquire aiocontext in bottom halves that need it
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Commit: b9e413dd3756f71abe4e8cafe1d7a459ce74ccf4
https://github.com/qemu/qemu/commit/b9e413dd3756f71abe4e8cafe1d7a459ce74ccf4
Author: Paolo Bonzini <address@hidden>
Date: 2017-02-21 (Tue, 21 Feb 2017)
Changed paths:
M block/archipelago.c
M block/block-backend.c
M block/curl.c
M block/io.c
M block/iscsi.c
M block/linux-aio.c
M block/mirror.c
M block/null.c
M block/qed-cluster.c
M block/qed-table.c
M block/qed.c
M block/rbd.c
M block/win32-aio.c
M hw/block/virtio-blk.c
M hw/scsi/scsi-disk.c
M hw/scsi/scsi-generic.c
M util/thread-pool.c
Log Message:
-----------
block: explicitly acquire aiocontext in aio callbacks that need it
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Commit: a153bf52b37e148f052b0869600877130671a03d
https://github.com/qemu/qemu/commit/a153bf52b37e148f052b0869600877130671a03d
Author: Paolo Bonzini <address@hidden>
Date: 2017-02-21 (Tue, 21 Feb 2017)
Changed paths:
M include/block/aio.h
M util/aio-posix.c
M util/aio-win32.c
M util/async.c
Log Message:
-----------
aio-posix: partially inline aio_dispatch into aio_poll
This patch prepares for the removal of unnecessary lockcnt inc/dec pairs.
Extract the dispatching loop for file descriptor handlers into a new
function aio_dispatch_handlers, and then inline aio_dispatch into
aio_poll.
aio_dispatch can now become void.
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Commit: bd451435c02e10dd07247eae188dcca0446cc57a
https://github.com/qemu/qemu/commit/bd451435c02e10dd07247eae188dcca0446cc57a
Author: Paolo Bonzini <address@hidden>
Date: 2017-02-21 (Tue, 21 Feb 2017)
Changed paths:
M util/aio-posix.c
M util/aio-win32.c
M util/async.c
Log Message:
-----------
async: remove unnecessary inc/dec pairs
Pull the increment/decrement pair out of aio_bh_poll and into the
callers.
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Commit: 91bcea4899017891983b9149bd50cb283e78dfc0
https://github.com/qemu/qemu/commit/91bcea4899017891983b9149bd50cb283e78dfc0
Author: Paolo Bonzini <address@hidden>
Date: 2017-02-21 (Tue, 21 Feb 2017)
Changed paths:
M include/block/block_int.h
M include/sysemu/block-backend.h
Log Message:
-----------
block: document fields protected by AioContext lock
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Daniel P. Berrange <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Commit: fed20a70e39bb9385020bdc4e8839d95326df8e2
https://github.com/qemu/qemu/commit/fed20a70e39bb9385020bdc4e8839d95326df8e2
Author: Paolo Bonzini <address@hidden>
Date: 2017-02-21 (Tue, 21 Feb 2017)
Changed paths:
M include/qemu/coroutine.h
M tests/test-aio-multithread.c
M util/qemu-coroutine-lock.c
M util/trace-events
Log Message:
-----------
coroutine-lock: make CoMutex thread-safe
This uses the lock-free mutex described in the paper '"Blocking without
Locking", or LFTHREADS: A lock-free thread library' by Gidenstam and
Papatriantafilou. The same technique is used in OSv, and in fact
the code is essentially a conversion to C of OSv's code.
[Added missing coroutine_fn in tests/test-aio-multithread.c.
--Stefan]
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Commit: 480cff632221dc4d4889bf72dd0f09cd35096bc1
https://github.com/qemu/qemu/commit/480cff632221dc4d4889bf72dd0f09cd35096bc1
Author: Paolo Bonzini <address@hidden>
Date: 2017-02-21 (Tue, 21 Feb 2017)
Changed paths:
M include/qemu/coroutine.h
M util/qemu-coroutine-lock.c
M util/qemu-coroutine.c
Log Message:
-----------
coroutine-lock: add limited spinning to CoMutex
Running a very small critical section on pthread_mutex_t and CoMutex
shows that pthread_mutex_t is much faster because it doesn't actually
go to sleep. What happens is that the critical section is shorter
than the latency of entering the kernel and thus FUTEX_WAIT always
fails. With CoMutex there is no such latency but you still want to
avoid wait and wakeup. So introduce it artificially.
This only works with one waiters; because CoMutex is fair, it will
always have more waits and wakeups than a pthread_mutex_t.
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Commit: c05df34a874706946a918d320e602bb498550838
https://github.com/qemu/qemu/commit/c05df34a874706946a918d320e602bb498550838
Author: Paolo Bonzini <address@hidden>
Date: 2017-02-21 (Tue, 21 Feb 2017)
Changed paths:
M tests/test-aio-multithread.c
Log Message:
-----------
test-aio-multithread: add performance comparison with thread-based mutexes
Add two implementations of the same benchmark as the previous patch,
but using pthreads. One uses a normal QemuMutex, the other is Linux
only and implements a fair mutex based on MCS locks and futexes.
This shows that the slower performance of the 5-thread case is due to
the fairness of CoMutex, rather than to coroutines. If fairness does
not matter, as is the case with two threads, CoMutex can actually be
faster than pthreads.
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Commit: f8c6e1cbc3d397207bedabdb2932fd6e1d7484df
https://github.com/qemu/qemu/commit/f8c6e1cbc3d397207bedabdb2932fd6e1d7484df
Author: Paolo Bonzini <address@hidden>
Date: 2017-02-21 (Tue, 21 Feb 2017)
Changed paths:
M include/qemu/coroutine.h
Log Message:
-----------
coroutine-lock: place CoMutex before CoQueue in header
This will avoid forward references in the next patch. It is also
more logical because CoQueue is not anymore the basic primitive.
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Commit: 1ace7ceac507d90d50ecb2e13f7222beadb64d92
https://github.com/qemu/qemu/commit/1ace7ceac507d90d50ecb2e13f7222beadb64d92
Author: Paolo Bonzini <address@hidden>
Date: 2017-02-21 (Tue, 21 Feb 2017)
Changed paths:
M block/backup.c
M block/io.c
M block/nbd-client.c
M block/qcow2-cluster.c
M block/sheepdog.c
M block/throttle-groups.c
M hw/9pfs/9p.c
M include/qemu/coroutine.h
M util/qemu-coroutine-lock.c
Log Message:
-----------
coroutine-lock: add mutex argument to CoQueue APIs
All that CoQueue needs in order to become thread-safe is help
from an external mutex. Add this to the API.
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Commit: a7b91d35bab97a2d3e779d0c64c9b837b52a6cf7
https://github.com/qemu/qemu/commit/a7b91d35bab97a2d3e779d0c64c9b837b52a6cf7
Author: Paolo Bonzini <address@hidden>
Date: 2017-02-21 (Tue, 21 Feb 2017)
Changed paths:
M include/qemu/coroutine.h
M util/qemu-coroutine-lock.c
Log Message:
-----------
coroutine-lock: make CoRwlock thread-safe and fair
This adds a CoMutex around the existing CoQueue. Because the write-side
can just take CoMutex, the old "writer" field is not necessary anymore.
Instead of removing it altogether, count the number of pending writers
during a read-side critical section and forbid further readers from
entering.
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Commit: a0775e28cd6cae7eae248f74db7bc4a03da20c6b
https://github.com/qemu/qemu/commit/a0775e28cd6cae7eae248f74db7bc4a03da20c6b
Author: Peter Maydell <address@hidden>
Date: 2017-02-21 (Tue, 21 Feb 2017)
Changed paths:
M Makefile.objs
R aio-posix.c
R aio-win32.c
R async.c
M block/backup.c
M block/blkdebug.c
M block/blkreplay.c
M block/block-backend.c
M block/curl.c
M block/gluster.c
M block/io.c
M block/iscsi.c
M block/linux-aio.c
M block/mirror.c
M block/nbd-client.c
M block/nbd-client.h
M block/nfs.c
M block/qcow2-cluster.c
M block/qed-cluster.c
M block/qed-table.c
M block/qed.c
M block/qed.h
M block/sheepdog.c
M block/ssh.c
M block/throttle-groups.c
M block/win32-aio.c
M dma-helpers.c
M hw/9pfs/9p.c
M hw/block/virtio-blk.c
M hw/scsi/scsi-bus.c
M hw/scsi/scsi-disk.c
M hw/scsi/scsi-generic.c
M hw/scsi/virtio-scsi.c
M include/block/aio.h
M include/block/block_int.h
M include/io/channel.h
M include/qemu/coroutine.h
M include/qemu/coroutine_int.h
M include/sysemu/block-backend.h
M io/channel-command.c
M io/channel-file.c
M io/channel-socket.c
M io/channel-tls.c
M io/channel-watch.c
M io/channel.c
R iohandler.c
R main-loop.c
M nbd/client.c
M nbd/common.c
M nbd/server.c
R qemu-timer.c
M stubs/Makefile.objs
A stubs/linux-aio.c
M stubs/set-fd-handler.c
M tests/Makefile.include
A tests/iothread.c
A tests/iothread.h
A tests/test-aio-multithread.c
M tests/test-thread-pool.c
R thread-pool.c
M trace-events
M util/Makefile.objs
A util/aio-posix.c
A util/aio-win32.c
A util/aiocb.c
A util/async.c
A util/iohandler.c
A util/main-loop.c
M util/qemu-coroutine-lock.c
M util/qemu-coroutine-sleep.c
M util/qemu-coroutine.c
A util/qemu-timer.c
A util/thread-pool.c
M util/trace-events
Log Message:
-----------
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into
staging
Pull request
v2:
* Rebased to resolve scsi conflicts
# gpg: Signature made Tue 21 Feb 2017 11:56:24 GMT
# gpg: using RSA key 0x9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <address@hidden>"
# gpg: aka "Stefan Hajnoczi <address@hidden>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8
* remotes/stefanha/tags/block-pull-request: (24 commits)
coroutine-lock: make CoRwlock thread-safe and fair
coroutine-lock: add mutex argument to CoQueue APIs
coroutine-lock: place CoMutex before CoQueue in header
test-aio-multithread: add performance comparison with thread-based mutexes
coroutine-lock: add limited spinning to CoMutex
coroutine-lock: make CoMutex thread-safe
block: document fields protected by AioContext lock
async: remove unnecessary inc/dec pairs
aio-posix: partially inline aio_dispatch into aio_poll
block: explicitly acquire aiocontext in aio callbacks that need it
block: explicitly acquire aiocontext in bottom halves that need it
block: explicitly acquire aiocontext in callbacks that need it
block: explicitly acquire aiocontext in timers that need it
aio: push aio_context_acquire/release down to dispatching
qed: introduce qed_aio_start_io and qed_aio_next_io_cb
blkdebug: reschedule coroutine on the AioContext it is running on
coroutine-lock: reschedule coroutine on the AioContext it was running on
nbd: convert to use qio_channel_yield
io: make qio_channel_yield aware of AioContexts
io: add methods to set I/O handlers on AioContext
...
Signed-off-by: Peter Maydell <address@hidden>
Compare: https://github.com/qemu/qemu/compare/b856256179f1...a0775e28cd6c
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-commits] [qemu/qemu] c2b38b: block: move AioContext, QEMUTimer, main-loop to li...,
GitHub <=