]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
os/bluestore: fix deferred_aio deadlock
authorSage Weil <sage@redhat.com>
Sat, 1 Jul 2017 14:56:58 +0000 (10:56 -0400)
committerSage Weil <sage@redhat.com>
Sat, 1 Jul 2017 14:56:58 +0000 (10:56 -0400)
commit7d7f5856bc5b547b461f63f15acd7c27b0fba3a6
tree5523926dcd24b886f4ff83d49791b14e926aae09
parent58f95820e64fb688376de6af9d5bfab84a5d57d0
os/bluestore: fix deferred_aio deadlock

We submit aios while holding deferred_lock, and we take deferred_lock in
the aio completion handler (of which there is only 1).  That means that
if the aio queue fills up, the submitter will block with the lock while
the finisher won't be able to take the lock, progress, and drain completed
aios, leading to a deadlock.

Fix this by submiting aios *without* deferred_lock held.  Instead, demote
to a deferred_submit_lock.  Further, in the finisher, submit aios
via a finisher (this only happens when in deferred_aggressive mode which
is rare and not performance-sensitive).

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h