io_uring: sync with kernel
[fio.git] / engines / io_uring.c
index 5fda2fc96fea8f88914083f5cb9e5d9ff962d580..5279b1d0ffb7d38ba9ceb144b99ba26dd690574d 100644 (file)
@@ -340,7 +340,8 @@ static int fio_ioring_commit(struct thread_data *td)
 
                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;
        }
@@ -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;
@@ -478,6 +470,14 @@ static int fio_ioring_queue_init(struct thread_data *td)
        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)