Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os/bluestore: fix deferred write deadlock, aio short return handling #17601

Merged
merged 3 commits into from Sep 10, 2017

Conversation

liewegas
Copy link
Member

@liewegas liewegas commented Sep 8, 2017

This lock serves no purpose.  It only protects the call to the aio_submit
on the OpSequencer running batch, but we are the only caller who will do
that submission, and a new batch won't be moved into place until ours is
completed and retired (by the completion for the aio we are queueing).

More importantly, this fixes a deadlock:

- thread A submits aio, but the queue is full, and blocks
- thread B blocks taking deferred_submit_lock while holding deferred_lock
- aio completion thread blocks trying to take deferred_lock, and thus
no further aios are drained.

Fixes: http://tracker.ceph.com/issues/21171
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 7a5ef62)
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 11ac691)
io_submit may return a value less than nr, indicating that only some of
the provided iocbs were queued.  If that happens we should loop, not
return and silently drop those aios on the floor.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit dc17dfd)
@liewegas liewegas added this to the luminous milestone Sep 8, 2017
@smithfarm
Copy link
Contributor

jenkins test docs

@liewegas liewegas merged commit 462fc90 into ceph:luminous Sep 10, 2017
@liewegas liewegas deleted the wip-21171-luminous branch September 10, 2017 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants