From: Jason Dillaman Date: Fri, 10 Jul 2020 16:50:54 +0000 (-0400) Subject: librbd: directly post completions to the asio strand X-Git-Tag: wip-pdonnell-testing-20200918.022351~622^2~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=cfbd18864602ecad1a34c904bfcb03b025fc3d37;p=ceph-ci.git librbd: directly post completions to the asio strand Avoid the unnecessary wrapping of the strand completion in a bind_executor by just directly posting the completion to the strand. Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/io/AioCompletion.cc b/src/librbd/io/AioCompletion.cc index a5067721581..9e1d1e18fe7 100644 --- a/src/librbd/io/AioCompletion.cc +++ b/src/librbd/io/AioCompletion.cc @@ -157,10 +157,9 @@ void AioCompletion::queue_complete() { add_request(); // ensure completion fires in clean lock context - boost::asio::post(*ictx->asio_engine, boost::asio::bind_executor( - ictx->asio_engine->get_api_strand(), [this]() { + boost::asio::post(ictx->asio_engine->get_api_strand(), [this]() { complete_request(0); - })); + }); } void AioCompletion::block(CephContext* cct) { @@ -261,12 +260,11 @@ void AioCompletion::complete_external_callback() { // ensure librbd external users never experience concurrent callbacks // from multiple librbd-internal threads. - boost::asio::dispatch(*ictx->asio_engine, boost::asio::bind_executor( - ictx->asio_engine->get_api_strand(), [this]() { + boost::asio::dispatch(ictx->asio_engine->get_api_strand(), [this]() { complete_cb(rbd_comp, complete_arg); complete_event_socket(); put(); - })); + }); } void AioCompletion::complete_event_socket() {