summaryrefslogtreecommitdiffstats
path: root/src/rgw/rgw_ssd_driver.cc
diff options
context:
space:
mode:
authorCasey Bodley <cbodley@redhat.com>2024-02-15 04:53:47 +0100
committerCasey Bodley <cbodley@redhat.com>2024-05-13 18:57:01 +0200
commit9dd892e289b32a90b24d55ab8e1b7d7601af21ca (patch)
tree1a1c0157205bb9d6adf0e3572b01f18f62d40916 /src/rgw/rgw_ssd_driver.cc
parentrgw/aio: YieldingAioThrottle::async_wait() uses async_initiate (diff)
downloadceph-9dd892e289b32a90b24d55ab8e1b7d7601af21ca.tar.xz
ceph-9dd892e289b32a90b24d55ab8e1b7d7601af21ca.zip
rgw: switch back to boost::asio for spawn() and yield_context
a fork of boost::asio::spawn() was introduced in 2020 with spawn::spawn() from #31580. this fork enabled rgw to customize how the coroutine stacks are allocated in order to avoid stack overflows in frontend request coroutines. this customization was based on a StackAllocator concept from the boost::context library in boost 1.80, that same StackAllocator overload was added to boost::asio::spawn(), along with other improvements like per-op cancellation. now that boost has everything we need, switch back and drop the spawn submodule this required switching a lot of async functions from async_completion<> to async_initiate<>. similar changes were necessary to enable the c++20 coroutine token boost::asio::use_awaitable Signed-off-by: Casey Bodley <cbodley@redhat.com>
Diffstat (limited to 'src/rgw/rgw_ssd_driver.cc')
-rw-r--r--src/rgw/rgw_ssd_driver.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/rgw/rgw_ssd_driver.cc b/src/rgw/rgw_ssd_driver.cc
index 24726ebcf62..5d7a5a97119 100644
--- a/src/rgw/rgw_ssd_driver.cc
+++ b/src/rgw/rgw_ssd_driver.cc
@@ -98,9 +98,8 @@ int SSDDriver::put(const DoutPrefixProvider* dpp, const std::string& key, const
boost::system::error_code ec;
if (y) {
using namespace boost::asio;
- spawn::yield_context yield = y.get_yield_context();
- async_completion<spawn::yield_context, void()> init(yield);
- auto ex = get_associated_executor(init.completion_handler);
+ yield_context yield = y.get_yield_context();
+ auto ex = yield.get_executor();
this->put_async(dpp, ex, key, bl, len, attrs, yield[ec]);
} else {
auto ex = boost::asio::system_executor{};
@@ -285,9 +284,8 @@ rgw::Aio::OpFunc SSDDriver::ssd_cache_read_op(const DoutPrefixProvider *dpp, opt
ldpp_dout(dpp, 20) << "SSDCache: cache_read_op(): Read From Cache, oid=" << r.obj.oid << dendl;
using namespace boost::asio;
- spawn::yield_context yield = y.get_yield_context();
- async_completion<spawn::yield_context, void()> init(yield);
- auto ex = get_associated_executor(init.completion_handler);
+ yield_context yield = y.get_yield_context();
+ auto ex = yield.get_executor();
ldpp_dout(dpp, 20) << "SSDCache: " << __func__ << "(): key=" << key << dendl;
this->get_async(dpp, ex, key, read_ofs, read_len, bind_executor(ex, SSDDriver::libaio_read_handler{aio, r}));
@@ -301,9 +299,8 @@ rgw::Aio::OpFunc SSDDriver::ssd_cache_write_op(const DoutPrefixProvider *dpp, op
ldpp_dout(dpp, 20) << "SSDCache: cache_write_op(): Write to Cache, oid=" << r.obj.oid << dendl;
using namespace boost::asio;
- spawn::yield_context yield = y.get_yield_context();
- async_completion<spawn::yield_context, void()> init(yield);
- auto ex = get_associated_executor(init.completion_handler);
+ yield_context yield = y.get_yield_context();
+ auto ex = yield.get_executor();
ldpp_dout(dpp, 20) << "SSDCache: " << __func__ << "(): key=" << key << dendl;
this->put_async(dpp, ex, key, bl, len, attrs, bind_executor(ex, SSDDriver::libaio_write_handler{aio, r}));