From: Nitzan Mordechai Date: Wed, 28 Aug 2024 09:08:26 +0000 (+0000) Subject: crimson/net/io_handler: ctor add gate ctor with shard id X-Git-Tag: v20.0.0~1098^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1071cc38868ceb8c06ebdefa3826411e7658f2d8;p=ceph.git 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 --- diff --git a/src/crimson/common/gated.h b/src/crimson/common/gated.h index d3978f2efdd..28e3620e654 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 80dd953c65f..5986fcb16ac 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;