-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ioctl: get_log_page by nvme uring cmd #927
ioctl: get_log_page by nvme uring cmd #927
Conversation
src/nvme/ioctl.c
Outdated
@@ -344,14 +431,30 @@ int nvme_get_log_page(int fd, __u32 xfer_len, struct nvme_get_log_args *args) | |||
args->len = xfer; | |||
args->log = ptr; | |||
args->rae = offset + xfer < data_len || retain; | |||
#ifdef CONFIG_LIBURING | |||
if (n >= NVME_URING_ENTRIES) { | |||
nvme_uring_cmd_wait_complete(&ring, n); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fine with using uring but would it be possible to have it fallback during runtime to the ioctl interface when uring is not available, like on older kernels?
This should be just one commit. I'll squash the changes into one when I am reviewing and testing it. We need also to update our CI build accordingly. |
thanks for your help ! there're 2 failed testcase. it requires mock liburing api
besides, it doesn't work on SPDK NVME CUSE devices. FYI |
Ah, I've missed this. Unfortunately, this is important, I really don't want the tests cases to break when liburing is used.
That is likely due the missing support of the CUSE devices. |
I suppose, for an initial attempt the
static inline int __sys_io_uring_register(unsigned int fd, unsigned int opcode,
const void *arg, unsigned int nr_args)
{
return (int) __do_syscall4(__NR_io_uring_register, fd, opcode, arg,
nr_args);
} I haven't looked into liburing at all, maybe it supports some sort of mocking for testing? |
io_uring_get_probe returning NULL could avoid breaking the cases perfectly. after a quick study, think there are no official mocking support of liburing. |
Workaround avoid breaking ana and discovery testcase Signed-off-by: letli <[email protected]>
Use io_uring for fetching log pages. This showed about a 10% performance improvement for some large log pages. Signed-off-by: letli <[email protected]>
be29f8b
to
ddfbc51
Compare
Just squashed the changes into one patch. Thanks! |
hello libnvme master,
io_uring on linux is pretty mature now, for the system with liburing, do the batch nvme_get_log by nvme uring cmd.
This change could gain about 10% performance improvement for some large log pages on my lab.
i believe the performance can be better if implement producer and consumer in two separated threads, if it's worth and acceptable, i can spend some time on this later.
thanks