summaryrefslogtreecommitdiffstats
path: root/io_uring
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2024-04-30 17:42:31 +0200
committerJens Axboe <axboe@kernel.dk>2024-04-30 21:06:27 +0200
commit19352a1d395424b5f8c03289a85fbd6622d6601a (patch)
treea7ffa54ef375e0f7fc595069150ef71e0fbb65ca /io_uring
parentio_uring/net: fix sendzc lazy wake polling (diff)
downloadlinux-19352a1d395424b5f8c03289a85fbd6622d6601a.tar.xz
linux-19352a1d395424b5f8c03289a85fbd6622d6601a.zip
io_uring/notif: disable LAZY_WAKE for linked notifs
Notifications may now be linked and thus a single tw can post multiple CQEs, it's not safe to use LAZY_WAKE with them. Disable LAZY_WAKE for now, if that'd prove to be a problem we can count them and pass the expected number of CQEs into __io_req_task_work_add(). Fixes: 6fe4220912d19 ("io_uring/notif: implement notification stacking") Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/0a5accdb7d2d0d27ebec14f8106e14e0192fae17.1714488419.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, 4 insertions, 1 deletions
diff --git a/io_uring/notif.c b/io_uring/notif.c
index d58cdc01e691..28859ae3ee6e 100644
--- a/io_uring/notif.c
+++ b/io_uring/notif.c
@@ -38,6 +38,7 @@ void io_tx_ubuf_complete(struct sk_buff *skb, struct ubuf_info *uarg,
{
struct io_notif_data *nd = container_of(uarg, struct io_notif_data, uarg);
struct io_kiocb *notif = cmd_to_io_kiocb(nd);
+ unsigned tw_flags;
if (nd->zc_report) {
if (success && !nd->zc_used && skb)
@@ -53,8 +54,10 @@ void io_tx_ubuf_complete(struct sk_buff *skb, struct ubuf_info *uarg,
io_tx_ubuf_complete(skb, &nd->head->uarg, success);
return;
}
+
+ tw_flags = nd->next ? 0 : IOU_F_TWQ_LAZY_WAKE;
notif->io_task_work.func = io_notif_tw_complete;
- __io_req_task_work_add(notif, IOU_F_TWQ_LAZY_WAKE);
+ __io_req_task_work_add(notif, tw_flags);
}
static int io_link_skb(struct sk_buff *skb, struct ubuf_info *uarg)