summaryrefslogtreecommitdiffstats
path: root/io_uring/tctx.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2022-06-15 17:33:53 +0100
committerJens Axboe <axboe@kernel.dk>2022-07-24 18:39:13 -0600
commit6a02e4be8187588ac476136496af9e3feeeb9a75 (patch)
tree306c269202b6f6c9f529da048387241b6c0d00b9 /io_uring/tctx.c
parent48c13d8980840e489a537e4af4b2503eb9d8a1ec (diff)
downloadlinux-6a02e4be8187588ac476136496af9e3feeeb9a75.tar.gz
linux-6a02e4be8187588ac476136496af9e3feeeb9a75.tar.bz2
linux-6a02e4be8187588ac476136496af9e3feeeb9a75.zip
io_uring: inline ->registered_rings
There can be only 16 registered rings, no need to allocate an array for them separately but store it in tctx. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/495f0b953c87994dd9e13de2134019054fa5830d.1655310733.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/tctx.c')
-rw-r--r--io_uring/tctx.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/io_uring/tctx.c b/io_uring/tctx.c
index 3f7e9feb6ca2..5a5d4f908529 100644
--- a/io_uring/tctx.c
+++ b/io_uring/tctx.c
@@ -53,7 +53,6 @@ void __io_uring_free(struct task_struct *tsk)
WARN_ON_ONCE(tctx->io_wq);
WARN_ON_ONCE(tctx->cached_refs);
- kfree(tctx->registered_rings);
percpu_counter_destroy(&tctx->inflight);
kfree(tctx);
tsk->io_uring = NULL;
@@ -69,16 +68,8 @@ __cold int io_uring_alloc_task_context(struct task_struct *task,
if (unlikely(!tctx))
return -ENOMEM;
- tctx->registered_rings = kcalloc(IO_RINGFD_REG_MAX,
- sizeof(struct file *), GFP_KERNEL);
- if (unlikely(!tctx->registered_rings)) {
- kfree(tctx);
- return -ENOMEM;
- }
-
ret = percpu_counter_init(&tctx->inflight, 0, GFP_KERNEL);
if (unlikely(ret)) {
- kfree(tctx->registered_rings);
kfree(tctx);
return ret;
}
@@ -87,7 +78,6 @@ __cold int io_uring_alloc_task_context(struct task_struct *task,
if (IS_ERR(tctx->io_wq)) {
ret = PTR_ERR(tctx->io_wq);
percpu_counter_destroy(&tctx->inflight);
- kfree(tctx->registered_rings);
kfree(tctx);
return ret;
}