Skip to content

Commit

Permalink
reactor: Add .no_poll_aio to reactor_config
Browse files Browse the repository at this point in the history
This boolean is not used directly, but rather tell reactor constructor
wheter or not to create _aio_eventfd.

Signed-off-by: Pavel Emelyanov <[email protected]>
  • Loading branch information
xemul committed Jul 6, 2024
1 parent 570053c commit aa4dd10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions include/seastar/core/reactor_config.hh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ struct reactor_config {
unsigned max_task_backlog = 1000;
bool strict_o_direct = true;
bool bypass_fsync = false;
bool no_poll_aio = false;
};
/// \endcond

Expand Down
5 changes: 2 additions & 3 deletions src/core/reactor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,7 @@ reactor::reactor(std::shared_ptr<smp> smp, alien::instance& alien, unsigned id,
#endif
, _cpu_started(0)
, _cpu_stall_detector(internal::make_cpu_stall_detector())
, _aio_eventfd(_cfg.no_poll_aio ? std::optional(pollable_fd(file_desc::eventfd(0, 0))) : std::nullopt)
, _reuseport(posix_reuseport_detect())
, _thread_pool(std::make_unique<thread_pool>(*this, seastar::format("syscall-{}", id))) {
/*
Expand Down Expand Up @@ -1578,9 +1579,6 @@ void reactor::configure(const reactor_options& opts) {
csdc.oneline = opts.blocked_reactor_report_format_oneline.get_value();
_cpu_stall_detector->update_config(csdc);

if (!opts.poll_aio.get_value() || (opts.poll_aio.defaulted() && opts.overprovisioned)) {
_aio_eventfd = pollable_fd(file_desc::eventfd(0, 0));
}
aio_nowait_supported = opts.linux_aio_nowait.get_value();
}

Expand Down Expand Up @@ -4400,6 +4398,7 @@ void smp::configure(const smp_options& smp_opts, const reactor_options& reactor_
.max_task_backlog = reactor_opts.max_task_backlog.get_value(),
.strict_o_direct = !reactor_opts.relaxed_dma,
.bypass_fsync = reactor_opts.unsafe_bypass_fsync.get_value(),
.no_poll_aio = !reactor_opts.poll_aio.get_value() || (reactor_opts.poll_aio.defaulted() && reactor_opts.overprovisioned),
};

std::mutex mtx;
Expand Down

0 comments on commit aa4dd10

Please sign in to comment.