From: Hao Xu <howeyxu@xxxxxxxxxxx> A uringlet worker doesn't need any io-wq pool. Signed-off-by: Hao Xu <howeyxu@xxxxxxxxxxx> --- io_uring/tctx.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/io_uring/tctx.c b/io_uring/tctx.c index 0c15fb8b9a2e..b04d361bcf34 100644 --- a/io_uring/tctx.c +++ b/io_uring/tctx.c @@ -81,12 +81,17 @@ __cold int io_uring_alloc_task_context(struct task_struct *task, return ret; } - tctx->io_wq = io_init_wq_offload(ctx, task); - if (IS_ERR(tctx->io_wq)) { - ret = PTR_ERR(tctx->io_wq); - percpu_counter_destroy(&tctx->inflight); - kfree(tctx); - return ret; + /* + * don't allocate io-wq in uringlet mode + */ + if (!(ctx->flags & IORING_SETUP_URINGLET)) { + tctx->io_wq = io_init_wq_offload(ctx, task); + if (IS_ERR(tctx->io_wq)) { + ret = PTR_ERR(tctx->io_wq); + percpu_counter_destroy(&tctx->inflight); + kfree(tctx); + return ret; + } } xa_init(&tctx->xa); -- 2.25.1