projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
stat: fix accumulation of latency buckets
[fio.git]
/
engines
/
io_uring.c
diff --git
a/engines/io_uring.c
b/engines/io_uring.c
index 8c5d9deb65ab327392e2c0e948d32a9b785a09b4..014f954ee96fdfd409e57f4455bbd7d0828d6c85 100644
(file)
--- a/
engines/io_uring.c
+++ b/
engines/io_uring.c
@@
-132,7
+132,7
@@
static int io_uring_enter(struct ioring_data *ld, unsigned int to_submit,
unsigned int min_complete, unsigned int flags)
{
return syscall(__NR_sys_io_uring_enter, ld->ring_fd, to_submit,
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)
}
static int fio_ioring_prep(struct thread_data *td, struct io_u *io_u)
@@
-154,7
+154,7
@@
static int fio_ioring_prep(struct thread_data *td, struct io_u *io_u)
sqe->opcode = IORING_OP_READ_FIXED;
else
sqe->opcode = IORING_OP_WRITE_FIXED;
sqe->opcode = IORING_OP_READ_FIXED;
else
sqe->opcode = IORING_OP_WRITE_FIXED;
- sqe->addr = io_u->xfer_buf;
+ sqe->addr =
(unsigned long)
io_u->xfer_buf;
sqe->len = io_u->xfer_buflen;
sqe->buf_index = io_u->index;
} else {
sqe->len = io_u->xfer_buflen;
sqe->buf_index = io_u->index;
} else {
@@
-162,7
+162,7
@@
static int fio_ioring_prep(struct thread_data *td, struct io_u *io_u)
sqe->opcode = IORING_OP_READV;
else
sqe->opcode = IORING_OP_WRITEV;
sqe->opcode = IORING_OP_READV;
else
sqe->opcode = IORING_OP_WRITEV;
- sqe->addr = &ld->iovecs[io_u->index];
+ sqe->addr =
(unsigned long)
&ld->iovecs[io_u->index];
sqe->len = 1;
}
sqe->off = io_u->offset;
sqe->len = 1;
}
sqe->off = io_u->offset;
@@
-340,7
+340,8
@@
static int fio_ioring_commit(struct thread_data *td)
read_barrier();
if (*ring->flags & IORING_SQ_NEED_WAKEUP)
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;
}
ld->queued = 0;
return 0;
}
@@
-462,15
+463,6
@@
static int fio_ioring_queue_init(struct thread_data *td)
}
}
}
}
- 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;
ret = syscall(__NR_sys_io_uring_setup, depth, &p);
if (ret < 0)
return ret;
@@
-478,13
+470,16
@@
static int fio_ioring_queue_init(struct thread_data *td)
ld->ring_fd = ret;
if (o->fixedbufs) {
ld->ring_fd = ret;
if (o->fixedbufs) {
- struct
io_uring_register_buffers reg
= {
- .
iovecs = ld->iovecs
,
- .
nr_iovecs = depth
+ 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,
ret = syscall(__NR_sys_io_uring_register, ld->ring_fd,
- IORING_REGISTER_BUFFERS,
®
);
+ IORING_REGISTER_BUFFERS,
ld->iovecs, depth
);
if (ret < 0)
return ret;
}
if (ret < 0)
return ret;
}