From 46961748140e291f0f1e966bac9aad1a3b9ad1c7 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 4 Dec 2018 11:27:02 -0700 Subject: [PATCH] engines/libaio: increase RLIMIT_MEMLOCK for user buffers Signed-off-by: Jens Axboe --- engines/libaio.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/engines/libaio.c b/engines/libaio.c index acd10c99..03335094 100644 --- a/engines/libaio.c +++ b/engines/libaio.c @@ -8,6 +8,8 @@ #include #include #include +#include +#include #include "../fio.h" #include "../lib/pow2.h" @@ -450,8 +452,15 @@ static int fio_libaio_queue_init(struct libaio_data *ld, unsigned int depth, flags |= IOCTX_FLAG_IOPOLL; if (useriocb) flags |= IOCTX_FLAG_USERIOCB; - if (fixedbufs) + if (fixedbufs) { + struct rlimit rlim = { + .rlim_cur = RLIM_INFINITY, + .rlim_max = RLIM_INFINITY, + }; + + setrlimit(RLIMIT_MEMLOCK, &rlim); flags |= IOCTX_FLAG_FIXEDBUFS; + } ret = syscall(__NR_sys_io_setup2, depth, flags, ld->user_iocbs, NULL, NULL, &ld->aio_ctx); -- 2.25.1