mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-16 01:54:00 +00:00
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: 79cfe9e59c2a ("io_uring/register: add IORING_REGISTER_RESIZE_RINGS") Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
12d908116f
commit
c261e4f1dd
@ -414,6 +414,9 @@ static int io_register_resize_rings(struct io_ring_ctx *ctx, void __user *arg)
|
|||||||
if (ctx->flags & IORING_SETUP_SINGLE_ISSUER &&
|
if (ctx->flags & IORING_SETUP_SINGLE_ISSUER &&
|
||||||
current != ctx->submitter_task)
|
current != ctx->submitter_task)
|
||||||
return -EEXIST;
|
return -EEXIST;
|
||||||
|
/* limited to DEFER_TASKRUN for now */
|
||||||
|
if (!(ctx->flags & IORING_SETUP_DEFER_TASKRUN))
|
||||||
|
return -EINVAL;
|
||||||
if (copy_from_user(&p, arg, sizeof(p)))
|
if (copy_from_user(&p, arg, sizeof(p)))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
if (p.flags & ~RESIZE_FLAGS)
|
if (p.flags & ~RESIZE_FLAGS)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user