Skip to content

Commit d27d19b

Browse files
author
Ming Lei
committed
io_uring/register: limit ring resizing to DEFER_TASKRUN
JIRA: https://issues.redhat.com/browse/RHEL-106845 commit c261e4f Author: Jens Axboe <[email protected]> Date: Thu Dec 19 09:32:26 2024 -0700 io_uring/register: limit ring resizing to DEFER_TASKRUN With DEFER_TASKRUN, we know the ring can't be both waited upon and resized at the same time. This is important for CQ resizing. Allowing SQ ring resizing is more trivial, but isn't the interesting use case. Hence limit ring resizing in general to DEFER_TASKRUN only for now. This isn't a huge problem as CQ ring resizing is generally the most useful on networking type of workloads where it can be hard to size the ring appropriately upfront, and those should be using DEFER_TASKRUN for better performance. Fixes: 79cfe9e ("io_uring/register: add IORING_REGISTER_RESIZE_RINGS") Signed-off-by: Jens Axboe <[email protected]> Signed-off-by: Ming Lei <[email protected]>
1 parent 85022d8 commit d27d19b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

io_uring/register.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,9 @@ static int io_register_resize_rings(struct io_ring_ctx *ctx, void __user *arg)
414414
if (ctx->flags & IORING_SETUP_SINGLE_ISSUER &&
415415
current != ctx->submitter_task)
416416
return -EEXIST;
417+
/* limited to DEFER_TASKRUN for now */
418+
if (!(ctx->flags & IORING_SETUP_DEFER_TASKRUN))
419+
return -EINVAL;
417420
if (copy_from_user(&p, arg, sizeof(p)))
418421
return -EFAULT;
419422
if (p.flags & ~RESIZE_FLAGS)

0 commit comments

Comments
 (0)