diff options
author | Roman Penyaev <rpenyaev@suse.de> | 2019-05-27 21:05:10 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-05-27 14:54:15 -0600 |
commit | f6a03bde232e4d0c53c6f3ce3422af37bf34cce7 (patch) | |
tree | 0d9e8a769abeb913a4b2a2d467320aea10b0712f | |
parent | df23d2dec286697dd73568faf142466e8067844a (diff) |
queue: always fill in sq->array on io_uring_submit()
io_uring_submit() is a last commit point when a caller has to be sure
that all prepared sqes eventually lands to the kernel.
If SQ thread is running it is quite possible that khead != ktail, thus
charging of sq->array is skipped, which leads to IO hang.
Nasty hang is well reproduced when submitter and completion harverster
are different threads.
Signed-off-by: Roman Penyaev <rpenyaev@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | src/queue.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/src/queue.c b/src/queue.c index eec26c9..d10fbaf 100644 --- a/src/queue.c +++ b/src/queue.c @@ -85,17 +85,6 @@ int io_uring_submit(struct io_uring *ring) unsigned ktail, ktail_next, submitted, to_submit; int ret; - /* - * If we have pending IO in the kring, submit it first. We need a - * read barrier here to match the kernels store barrier when updating - * the SQ head. - */ - read_barrier(); - if (*sq->khead != *sq->ktail) { - submitted = *sq->kring_entries; - goto submit; - } - if (sq->sqe_head == sq->sqe_tail) return 0; @@ -135,7 +124,6 @@ int io_uring_submit(struct io_uring *ring) write_barrier(); } -submit: if (sq_ring_needs_enter(ring)) { unsigned flags = 0; |