Skip to content

Commit 2e730d8

Browse files
isilenceaxboe
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/e7345e268ffaeaf79b4c8f3a5d019d6a87a3d1f1.1713185320.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent 7e58d0a commit 2e730d8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

io_uring/notif.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@
1212
void io_notif_tw_complete(struct io_kiocb *notif, struct io_tw_state *ts)
1313
{
1414
struct io_notif_data *nd = io_notif_to_data(notif);
15-
struct io_ring_ctx *ctx = notif->ctx;
1615

1716
if (unlikely(nd->zc_report) && (nd->zc_copied || !nd->zc_used))
1817
notif->cqe.res |= IORING_NOTIF_USAGE_ZC_COPIED;
1918

20-
if (nd->account_pages && ctx->user) {
21-
__io_unaccount_mem(ctx->user, nd->account_pages);
19+
if (nd->account_pages && notif->ctx->user) {
20+
__io_unaccount_mem(notif->ctx->user, nd->account_pages);
2221
nd->account_pages = 0;
2322
}
2423
io_req_task_complete(notif, ts);

0 commit comments

Comments
 (0)