Skip to content

Commit 19352a1

Browse files
isilenceaxboe
authored andcommitted
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: 6fe4220 ("io_uring/notif: implement notification stacking") Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/0a5accdb7d2d0d27ebec14f8106e14e0192fae17.1714488419.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent ef42b85 commit 19352a1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

io_uring/notif.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ void io_tx_ubuf_complete(struct sk_buff *skb, struct ubuf_info *uarg,
3838
{
3939
struct io_notif_data *nd = container_of(uarg, struct io_notif_data, uarg);
4040
struct io_kiocb *notif = cmd_to_io_kiocb(nd);
41+
unsigned tw_flags;
4142

4243
if (nd->zc_report) {
4344
if (success && !nd->zc_used && skb)
@@ -53,8 +54,10 @@ void io_tx_ubuf_complete(struct sk_buff *skb, struct ubuf_info *uarg,
5354
io_tx_ubuf_complete(skb, &nd->head->uarg, success);
5455
return;
5556
}
57+
58+
tw_flags = nd->next ? 0 : IOU_F_TWQ_LAZY_WAKE;
5659
notif->io_task_work.func = io_notif_tw_complete;
57-
__io_req_task_work_add(notif, IOU_F_TWQ_LAZY_WAKE);
60+
__io_req_task_work_add(notif, tw_flags);
5861
}
5962

6063
static int io_link_skb(struct sk_buff *skb, struct ubuf_info *uarg)

0 commit comments

Comments
 (0)