int cq_ring_off;
unsigned iodepth;
- uint64_t cachehit;
- uint64_t cachemiss;
-
struct ioring_mmap mmap[3];
};
unsigned int min_complete, unsigned int flags)
{
return syscall(__NR_sys_io_uring_enter, ld->ring_fd, to_submit,
- min_complete, flags);
+ min_complete, flags, NULL, 0);
}
static int fio_ioring_prep(struct thread_data *td, struct io_u *io_u)
} else
io_u->error = 0;
- if (io_u->ddir == DDIR_READ) {
- if (cqe->flags & IOCQE_FLAG_CACHEHIT)
- ld->cachehit++;
- else
- ld->cachemiss++;
- }
-
return io_u;
}
r = fio_ioring_cqring_reap(td, events, max);
if (r) {
events += r;
+ if (actual_min != 0)
+ actual_min -= r;
continue;
}
read_barrier();
if (*ring->flags & IORING_SQ_NEED_WAKEUP)
- io_uring_enter(ld, ld->queued, 0, 0);
+ io_uring_enter(ld, ld->queued, 0,
+ IORING_ENTER_SQ_WAKEUP);
ld->queued = 0;
return 0;
}
struct ioring_data *ld = td->io_ops_data;
if (ld) {
- td->ts.cachehit += ld->cachehit;
- td->ts.cachemiss += ld->cachemiss;
-
if (!(td->flags & TD_F_CHILD))
fio_ioring_unmap(ld);
}
}
- if (o->fixedbufs) {
- struct rlimit rlim = {
- .rlim_cur = RLIM_INFINITY,
- .rlim_max = RLIM_INFINITY,
- };
-
- setrlimit(RLIMIT_MEMLOCK, &rlim);
- }
-
ret = syscall(__NR_sys_io_uring_setup, depth, &p);
if (ret < 0)
return ret;
ld->ring_fd = ret;
if (o->fixedbufs) {
+ struct rlimit rlim = {
+ .rlim_cur = RLIM_INFINITY,
+ .rlim_max = RLIM_INFINITY,
+ };
+
+ if (setrlimit(RLIMIT_MEMLOCK, &rlim) < 0)
+ return -1;
+
ret = syscall(__NR_sys_io_uring_register, ld->ring_fd,
IORING_REGISTER_BUFFERS, ld->iovecs, depth);
if (ret < 0)
static struct ioengine_ops ioengine = {
.name = "io_uring",
.version = FIO_IOOPS_VERSION,
+ .flags = FIO_ASYNCIO_SYNC_TRIM,
.init = fio_ioring_init,
.post_init = fio_ioring_post_init,
.io_u_init = fio_ioring_io_u_init,