diff --git a/include/seastar/core/io_queue.hh b/include/seastar/core/io_queue.hh index 9a24d78353f..cddbe84b123 100644 --- a/include/seastar/core/io_queue.hh +++ b/include/seastar/core/io_queue.hh @@ -232,6 +232,7 @@ private: std::vector> _priority_classes; util::spinlock _lock; const shard_id _allocated_on; + std::vector _io_queues; static fair_group::config make_fair_group_config(const io_queue::config& qcfg) noexcept; priority_class_data& find_or_create_class(internal::priority_class pc); diff --git a/src/core/io_queue.cc b/src/core/io_queue.cc index 4851a5fe83a..cd4b838df94 100644 --- a/src/core/io_queue.cc +++ b/src/core/io_queue.cc @@ -569,6 +569,7 @@ io_queue::io_queue(io_group_ptr group, internal::io_sink& sink) , _sink(sink) , _flow_ratio_update([this] { update_flow_ratio(); }) { + _group->_io_queues[this_shard_id()] = this; auto& cfg = get_config(); if (cfg.duplex) { static_assert(internal::io_direction_and_length::write_idx == 0); @@ -611,6 +612,7 @@ std::chrono::duration io_group::io_latency_goal() const noexcept { io_group::io_group(io_queue::config io_cfg, unsigned nr_queues) : _config(std::move(io_cfg)) , _allocated_on(this_shard_id()) + , _io_queues(smp::count, nullptr) { auto fg_cfg = make_fair_group_config(_config); _fgs.emplace_back(fg_cfg, nr_queues);