From 1071cc38868ceb8c06ebdefa3826411e7658f2d8 Mon Sep 17 00:00:00 2001 From: Nitzan Mordechai Date: Wed, 28 Aug 2024 09:08:26 +0000 Subject: [PATCH] crimson/net/io_handler: ctor add gate ctor with shard id IOHandler::to_new_sid provides a mechanism to switch to a new core from the current one used. This behavior is tricky for making sure that we keep the IOHandler::shard_states_t::gate instance to be used on the same core that it was created. In order to resolve this, we should be able to construct Gated out of specified core_id (and not from this_shard_id). See: https://github.com/ceph/ceph/pull/58986#discussion_r1733782952 Signed-off-by: NitzanMordhai --- src/crimson/common/gated.h | 1 + src/crimson/net/io_handler.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/crimson/common/gated.h b/src/crimson/common/gated.h index d3978f2efdd86..28e3620e65489 100644 --- a/src/crimson/common/gated.h +++ b/src/crimson/common/gated.h @@ -18,6 +18,7 @@ namespace crimson::common { class Gated { public: Gated() : sid(seastar::this_shard_id()) {} + Gated(const seastar::shard_id sid) : sid(sid) {} Gated(const Gated&) = delete; Gated& operator=(const Gated&) = delete; Gated(Gated&&) = default; diff --git a/src/crimson/net/io_handler.h b/src/crimson/net/io_handler.h index 80dd953c65fcb..5986fcb16ac28 100644 --- a/src/crimson/net/io_handler.h +++ b/src/crimson/net/io_handler.h @@ -255,7 +255,7 @@ public: class shard_states_t { public: shard_states_t(seastar::shard_id _sid, io_state_t state) - : sid{_sid}, io_state{state} {} + : sid{_sid}, io_state{state}, gate{_sid} {} seastar::shard_id get_shard_id() const { return sid; -- 2.39.5