Skip to content

Commit 489809e

Browse files
isilenceaxboe
authored andcommitted
io_uring: increase max number of reg buffers
Since recent changes instead of storing a large array of struct io_mapped_ubuf, we store pointers to them, that is 4 times slimmer and we should not to so worry about restricting max number of registererd buffer slots, increase the limit 4 times. Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/d3dee1da37f46da416aa96a16bf9e5094e10584d.1620990371.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent 2d74d04 commit 489809e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/io_uring.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@
100100
#define IORING_MAX_RESTRICTIONS (IORING_RESTRICTION_LAST + \
101101
IORING_REGISTER_LAST + IORING_OP_LAST)
102102

103+
#define IORING_MAX_REG_BUFFERS (1U << 14)
104+
103105
#define SQE_VALID_FLAGS (IOSQE_FIXED_FILE|IOSQE_IO_DRAIN|IOSQE_IO_LINK| \
104106
IOSQE_IO_HARDLINK | IOSQE_ASYNC | \
105107
IOSQE_BUFFER_SELECT)
@@ -8389,7 +8391,7 @@ static int io_sqe_buffers_register(struct io_ring_ctx *ctx, void __user *arg,
83898391

83908392
if (ctx->user_bufs)
83918393
return -EBUSY;
8392-
if (!nr_args || nr_args > UIO_MAXIOV)
8394+
if (!nr_args || nr_args > IORING_MAX_REG_BUFFERS)
83938395
return -EINVAL;
83948396
ret = io_rsrc_node_switch_start(ctx);
83958397
if (ret)

0 commit comments

Comments
 (0)