File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -627,21 +627,23 @@ static inline void __io_cq_unlock_post(struct io_ring_ctx *ctx)
627
627
io_cqring_wake (ctx );
628
628
}
629
629
630
- static inline void __io_cq_unlock_post_flush (struct io_ring_ctx * ctx )
630
+ static void __io_cq_unlock_post_flush (struct io_ring_ctx * ctx )
631
631
__releases (ctx - > completion_lock )
632
632
{
633
633
io_commit_cqring (ctx );
634
- __io_cq_unlock (ctx );
635
- io_commit_cqring_flush (ctx );
636
634
637
- /*
638
- * As ->task_complete implies that the ring is single tasked, cq_wait
639
- * may only be waited on by the current in io_cqring_wait(), but since
640
- * it will re-check the wakeup conditions once we return we can safely
641
- * skip waking it up.
642
- */
643
- if (!(ctx -> flags & IORING_SETUP_DEFER_TASKRUN ))
635
+ if (ctx -> task_complete ) {
636
+ /*
637
+ * ->task_complete implies that only current might be waiting
638
+ * for CQEs, and obviously, we currently don't. No one is
639
+ * waiting, wakeups are futile, skip them.
640
+ */
641
+ io_commit_cqring_flush (ctx );
642
+ } else {
643
+ __io_cq_unlock (ctx );
644
+ io_commit_cqring_flush (ctx );
644
645
io_cqring_wake (ctx );
646
+ }
645
647
}
646
648
647
649
void io_cq_unlock_post (struct io_ring_ctx * ctx )
You can’t perform that action at this time.
0 commit comments