From: Jason Dillaman Date: Wed, 8 Apr 2015 21:24:08 +0000 (-0400) Subject: librbd: add work queue for op completions X-Git-Tag: v0.94.4~77^2~28 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6d3db5ffbef71c8927a9ffc68c5955dca0f5612c;p=ceph.git librbd: add work queue for op completions Signed-off-by: Jason Dillaman (cherry picked from commit 21f990efe6c6d710376d5b1a49fc8cd53aa020e6) --- diff --git a/src/librbd/ImageCtx.cc b/src/librbd/ImageCtx.cc index a68a90600303..3d76c75478e2 100644 --- a/src/librbd/ImageCtx.cc +++ b/src/librbd/ImageCtx.cc @@ -81,7 +81,7 @@ public: object_cacher(NULL), writeback_handler(NULL), object_set(NULL), readahead(), total_bytes_read(0), copyup_finisher(NULL), - object_map(*this), aio_work_queue(NULL) + object_map(*this), aio_work_queue(NULL), op_work_queue(NULL) { md_ctx.dup(p); data_ctx.dup(p); @@ -138,6 +138,9 @@ public: aio_work_queue = new ContextWQ("librbd::aio_work_queue", cct->_conf->rbd_op_thread_timeout, thread_pool_singleton); + op_work_queue = new ContextWQ("librbd::op_work_queue", + cct->_conf->rbd_op_thread_timeout, + thread_pool_singleton); } ImageCtx::~ImageCtx() { @@ -160,6 +163,7 @@ public: } delete[] format_string; + delete op_work_queue; delete aio_work_queue; } diff --git a/src/librbd/ImageCtx.h b/src/librbd/ImageCtx.h index 47134e2f1911..f9a88784e18f 100644 --- a/src/librbd/ImageCtx.h +++ b/src/librbd/ImageCtx.h @@ -132,6 +132,7 @@ namespace librbd { xlist async_resize_reqs; ContextWQ *aio_work_queue; + ContextWQ *op_work_queue; /** * Either image_name or image_id must be set. diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index fbec53de27b4..be088bd1a151 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -2472,6 +2472,8 @@ reprotect_and_return_err: flush(ictx); } + ictx->op_work_queue->drain(); + if (ictx->copyup_finisher != NULL) { ictx->copyup_finisher->wait_for_empty(); ictx->copyup_finisher->stop();