aboutsummaryrefslogtreecommitdiff
path: root/migration/qjson.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2017-05-22 14:57:03 +0100
committerKevin Wolf <kwolf@redhat.com>2017-06-26 14:51:13 +0200
commit17e2a4a47d46dc9c33d5946cbdc1ceb15e34b5ac (patch)
tree0cee8694b26584f5a184ac32e49576b57810454a /migration/qjson.c
parentea17c9d20d7396351be5e14317354519ff53721d (diff)
migration: avoid recursive AioContext locking in save_vmstate()
AioContext was designed to allow nested acquire/release calls. It uses a recursive mutex so callers don't need to worry about nesting...or so we thought. BDRV_POLL_WHILE() is used to wait for block I/O requests. It releases the AioContext temporarily around aio_poll(). This gives IOThreads a chance to acquire the AioContext to process I/O completions. It turns out that recursive locking and BDRV_POLL_WHILE() don't mix. BDRV_POLL_WHILE() only releases the AioContext once, so the IOThread will not be able to acquire the AioContext if it was acquired multiple times. Instead of trying to release AioContext n times in BDRV_POLL_WHILE(), this patch simply avoids nested locking in save_vmstate(). It's the simplest fix and we should step back to consider the big picture with all the recent changes to block layer threading. This patch is the final fix to solve 'savevm' hanging with -object iothread. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'migration/qjson.c')
0 files changed, 0 insertions, 0 deletions