Skip to content

Commit

Permalink
io_queue: Keep backlinks from io_group to io_queues
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Emelyanov <[email protected]>
  • Loading branch information
xemul committed Jun 7, 2024
1 parent 8f9c857 commit fc266de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/seastar/core/io_queue.hh
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ private:
std::vector<std::unique_ptr<priority_class_data>> _priority_classes;
util::spinlock _lock;
const shard_id _allocated_on;
std::vector<io_queue*> _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);
Expand Down
2 changes: 2 additions & 0 deletions src/core/io_queue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -611,6 +612,7 @@ std::chrono::duration<double> 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);
Expand Down

0 comments on commit fc266de

Please sign in to comment.