20#include <liburing/io_uring.h>
46 throw std::runtime_error(
"Error initializing io_uring: " + std::string(std::strerror(-
ret)));
51 throw std::runtime_error(
"Failed to allocate memory for the smallest possible "
52 "io_uring instance. 'memlock' memory has been exhausted for this user");
63 throw std::runtime_error(
"Error initializing io_uring: " + std::string(std::strerror(-
ret)));
65 fDepth = params.sq_entries;
98 return std::pair<bool, std::string>(
true,
"");
100 std::string
msg = std::strerror(-
ret);
102 msg +=
": the running kernel does not support io_uring (CONFIG_IO_URING is not set)";
104 msg +=
": the io_uring_setup system call is blocked, e.g. by a seccomp profile";
105 return std::pair<bool, std::string>(
false,
msg);
129 unsigned int batch = 0;
130 unsigned int batchSize =
fDepth;
142 throw std::runtime_error(
"batch " + std::to_string(
batch) +
": "
143 +
"get SQE failed for read request '" + std::to_string(i)
147 throw std::runtime_error(
"batch " + std::to_string(
batch) +
": "
148 +
"bad fd (-1) for read request '" + std::to_string(i) +
"'");
151 throw std::runtime_error(
"batch " + std::to_string(
batch) +
": "
152 +
"null read buffer for read request '" + std::to_string(i) +
"'");
167 throw std::runtime_error(
"batch " + std::to_string(
batch) +
": "
168 "ring submit failed, error: " + std::string(
strerror(
errno)));
170 if (
submitted !=
static_cast<int>(batchSize)) {
171 throw std::runtime_error(
"ring submitted " + std::to_string(
submitted) +
172 " events but requested " + std::to_string(batchSize));
180 throw std::runtime_error(
"wait cqe failed, error: " + std::string(std::strerror(-
ret)));
184 throw std::runtime_error(
"bad cqe user data: " + std::to_string(
index));
187 throw std::runtime_error(
"batch " + std::to_string(
batch) +
": "
188 +
"read failed for ReadEvent[" + std::to_string(
index) +
"], "
189 "error: " + std::string(std::strerror(-
cqe->res)));
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
RIoUring(std::uint32_t entriesHint)
std::uint32_t GetQueueDepth()
RIoUring(const RIoUring &)=delete
RIoUring & operator=(const RIoUring &)=delete
static bool IsAvailable(std::string *errMsg=nullptr)
Probes whether io_uring is actually usable at runtime.
void SubmitReadsAndWait(RReadEvent *readEvents, unsigned int nReads)
Submit a number of read events and wait for completion.
struct io_uring * GetRawRing()
Access the raw io_uring instance.
Basic read event composed of IO data and a target file descriptor.
int fFileDes
The file descriptor.
std::uint64_t fOffset
The file offset.
void * fBuffer
The destination for reading.
std::size_t fOutBytes
The number of actually read bytes, set by the RIoUring instance.
std::size_t fSize
The number of desired bytes.