Message ID | 19cad183acc3a44b17b76c1719ad30c80aeff1ef.1660124059.git.asml.silence@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | improve io_uring's ubuf_info refcounting | expand |
diff --git a/io_uring/notif.c b/io_uring/notif.c index 5661681b3b44..dd346ea67580 100644 --- a/io_uring/notif.c +++ b/io_uring/notif.c @@ -66,7 +66,7 @@ struct io_kiocb *io_alloc_notif(struct io_ring_ctx *ctx, nd = io_notif_to_data(notif); nd->account_pages = 0; nd->uarg.skb_flags = SKBFL_ZEROCOPY_FRAG | SKBFL_DONT_ORPHAN; - nd->uarg.flags = 0; + nd->uarg.flags = UARGFL_CALLER_PINNED; nd->uarg.callback = io_uring_tx_zerocopy_callback; /* master ref owned by io_notif_slot, will be dropped on flush */ refcount_set(&nd->uarg.refcnt, 1);
We always keep references to active notifications and drop them only when we flush, so they're always pinned during sock_sendmsg() and we can add UARGFL_CALLER_PINNED. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> --- io_uring/notif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)