Skip to content

Commit

Permalink
Merge pull request eBay#71 from raakella1/uring_qdepth
Browse files Browse the repository at this point in the history
make uring qdepth config variable
  • Loading branch information
raakella1 authored Jan 4, 2024
2 parents 51e735b + f78a582 commit 7c2774a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class IOMgrConan(ConanFile):
name = "iomgr"
version = "11.0.1"
version = "11.0.2"

homepage = "https://github.com/eBay/IOManager"
description = "Asynchronous event manager"
Expand Down
4 changes: 2 additions & 2 deletions src/lib/interfaces/uring_drive_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace iomgr {
thread_local uring_drive_channel* UringDriveInterface::t_uring_ch{nullptr};

uring_drive_channel::uring_drive_channel(UringDriveInterface* iface) {
int ret = io_uring_queue_init(UringDriveInterface::per_thread_qdepth, &m_ring, 0);
int ret = io_uring_queue_init(IM_DYNAMIC_CONFIG(drive.uring_per_thread_qdepth), &m_ring, 0);
if (ret) { folly::throwSystemError(fmt::format("Unable to create uring queue created ret={}", ret)); }

int ev_fd = eventfd(0, EFD_NONBLOCK);
Expand Down Expand Up @@ -128,7 +128,7 @@ static void prep_sqe_from_iocb(drive_iocb* iocb, struct io_uring_sqe* sqe) {
}

bool uring_drive_channel::can_submit() const {
return (m_in_flight_ios + m_prepared_ios) <= UringDriveInterface::per_thread_qdepth;
return (m_in_flight_ios + m_prepared_ios) <= IM_DYNAMIC_CONFIG(drive.uring_per_thread_qdepth);
}

void uring_drive_channel::drain_waitq() {
Expand Down
2 changes: 0 additions & 2 deletions src/lib/interfaces/uring_drive_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ struct uring_drive_channel {

class UringDriveInterface : public KernelDriveInterface {
public:
static constexpr uint32_t per_thread_qdepth = 256;

UringDriveInterface(const bool new_interface_supported, const io_interface_comp_cb_t& cb = nullptr);
virtual ~UringDriveInterface() = default;
drive_interface_type interface_type() const override { return drive_interface_type::uring; }
Expand Down
2 changes: 2 additions & 0 deletions src/lib/iomgr_config.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ table DriveInterface {
max_resubmit_cnt: uint32 = 3 (hotswap); // max resubmit cnt of io in case of error

disable_io_uring: bool = false; // flag to not use io uring even if the env supports it

uring_per_thread_qdepth: uint32 = 256; // IMPORTANT: do not make this hotswap
}

table PoolEntry {
Expand Down

0 comments on commit 7c2774a

Please sign in to comment.