]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: use normal Context for async deferred_try_submit 18127/head
authorSage Weil <sage@redhat.com>
Tue, 3 Oct 2017 21:48:37 +0000 (16:48 -0500)
committerSage Weil <sage@redhat.com>
Thu, 5 Oct 2017 11:58:33 +0000 (06:58 -0500)
I'm not quite sure why the FunctionContext did not ever execute on the
finisher thread (perhaps the [&] captured some state on the stack that it
shouldn't have?).  In any case, using a traditional Context here appears
to resolve the problem (of the async deferred_try_submit() never executing,
leading to a bluestore stall/deadlock).

Fixes: http://tracker.ceph.com/issues/21470
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 67ec75805787ed63b35f8d70478a7a2cd785df06)

src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index b46b06ae410a32c51df2b8eab9536b1d0bbab175..a28efdcd90c4228abc17f17f1f0db310365cd076 100644 (file)
@@ -8707,6 +8707,14 @@ void BlueStore::_deferred_submit_unlock(OpSequencer *osr)
   bdev->aio_submit(&b->ioc);
 }
 
+struct C_DeferredTrySubmit : public Context {
+  BlueStore *store;
+  C_DeferredTrySubmit(BlueStore *s) : store(s) {}
+  void finish(int r) {
+    store->deferred_try_submit();
+  }
+};
+
 void BlueStore::_deferred_aio_finish(OpSequencer *osr)
 {
   dout(10) << __func__ << " osr " << osr << dendl;
@@ -8723,9 +8731,7 @@ void BlueStore::_deferred_aio_finish(OpSequencer *osr)
       deferred_queue.erase(q);
     } else if (deferred_aggressive) {
       dout(20) << __func__ << " queuing async deferred_try_submit" << dendl;
-      deferred_finisher.queue(new FunctionContext([&](int) {
-           deferred_try_submit();
-         }));
+      deferred_finisher.queue(new C_DeferredTrySubmit(this));
     } else {
       dout(20) << __func__ << " leaving queued, more pending" << dendl;
     }
index 102c1e21555715e38fd1e0336128887a570bc7c3..311107c18b40d8413da90e8304ff1cd8df08e72c 100644 (file)
@@ -2036,7 +2036,9 @@ private:
 
   bluestore_deferred_op_t *_get_deferred_op(TransContext *txc, OnodeRef o);
   void _deferred_queue(TransContext *txc);
+public:
   void deferred_try_submit();
+private:
   void _deferred_submit_unlock(OpSequencer *osr);
   void _deferred_aio_finish(OpSequencer *osr);
   int _deferred_replay();