summaryrefslogtreecommitdiffstats
path: root/io_uring
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2024-04-15 14:50:12 +0200
committerJens Axboe <axboe@kernel.dk>2024-04-15 16:10:49 +0200
commit2e730d8de45768810df4a6859cd64c5387cf0131 (patch)
treec488df684a07146a8e7d045331f4302a7e97b9bc /io_uring
parentio_uring/notif: refactor io_tx_ubuf_complete() (diff)
downloadlinux-2e730d8de45768810df4a6859cd64c5387cf0131.tar.xz
linux-2e730d8de45768810df4a6859cd64c5387cf0131.zip
io_uring/notif: remove ctx var from io_notif_tw_complete
We don't need ctx in the hottest path, i.e. registered buffers, let's get it only when we need it. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/e7345e268ffaeaf79b4c8f3a5d019d6a87a3d1f1.1713185320.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring')
-rw-r--r--io_uring/notif.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/io_uring/notif.c b/io_uring/notif.c
index 452c255de04a..3485437b207d 100644
--- a/io_uring/notif.c
+++ b/io_uring/notif.c
@@ -12,13 +12,12 @@
void io_notif_tw_complete(struct io_kiocb *notif, struct io_tw_state *ts)
{
struct io_notif_data *nd = io_notif_to_data(notif);
- struct io_ring_ctx *ctx = notif->ctx;
if (unlikely(nd->zc_report) && (nd->zc_copied || !nd->zc_used))
notif->cqe.res |= IORING_NOTIF_USAGE_ZC_COPIED;
- if (nd->account_pages && ctx->user) {
- __io_unaccount_mem(ctx->user, nd->account_pages);
+ if (nd->account_pages && notif->ctx->user) {
+ __io_unaccount_mem(notif->ctx->user, nd->account_pages);
nd->account_pages = 0;
}
io_req_task_complete(notif, ts);