summaryrefslogtreecommitdiff
path: root/io_uring/notif.h
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2024-04-19 12:08:42 +0100
committerJens Axboe <axboe@kernel.dk>2024-04-22 19:31:18 -0600
commit6fe4220912d19152a26ce19713ab232f4263018d (patch)
treeb49a3fb5a3fd41961cb9d2549230a06dd73602f6 /io_uring/notif.h
parent5a569469b973cb7a6c58192a37dfb8418686e518 (diff)
io_uring/notif: implement notification stacking
The network stack allows only one ubuf_info per skb, and unlike MSG_ZEROCOPY, each io_uring zerocopy send will carry a separate ubuf_info. That means that send requests can't reuse a previosly allocated skb and need to get one more or more of new ones. That's fine for large sends, but otherwise it would spam the stack with lots of skbs carrying just a little data each. To help with that implement linking notification (i.e. an io_uring wrapper around ubuf_info) into a list. Each is refcounted by skbs and the stack as usual. additionally all non head entries keep a reference to the head, which they put down when their refcount hits 0. When the head have no more users, it'll efficiently put all notifications in a batch. As mentioned previously about ->io_link_skb, the callback implementation always allows to bind to an skb without a ubuf_info. Reviewed-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/bf1e7f9b72f9ecc99999fdc0d2cded5eea87fd0b.1713369317.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/notif.h')
-rw-r--r--io_uring/notif.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/io_uring/notif.h b/io_uring/notif.h
index 2cf9ff6abd7a..f3589cfef4a9 100644
--- a/io_uring/notif.h
+++ b/io_uring/notif.h
@@ -14,6 +14,9 @@ struct io_notif_data {
struct file *file;
struct ubuf_info uarg;
+ struct io_notif_data *next;
+ struct io_notif_data *head;
+
unsigned account_pages;
bool zc_report;
bool zc_used;