engines/io_uring: don't attempt to set RLIMITs
authorJens Axboe <axboe@kernel.dk>
Fri, 21 Aug 2020 22:22:43 +0000 (16:22 -0600)
committerJens Axboe <axboe@kernel.dk>
Fri, 21 Aug 2020 22:22:43 +0000 (16:22 -0600)
This was meant to be helpful, but it's actively harmful if we're not
running as root. Just get rid of it, it's really no different than
needing appropriate memlock limits for just the ring itself.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/io_uring.c

index 5792559486b411fb4a244256f14f49e3df112355..2b1b13570d91972e7f3a30d8e4782132afffbfcf 100644 (file)
@@ -574,14 +574,6 @@ 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_io_uring_register, ld->ring_fd,
                                IORING_REGISTER_BUFFERS, ld->iovecs, depth);
                if (ret < 0)