]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: harder fdinfo sq/cq ring iterating
authorJens Axboe <axboe@kernel.dk>
Fri, 29 Oct 2021 12:36:45 +0000 (06:36 -0600)
committerJens Axboe <axboe@kernel.dk>
Fri, 29 Oct 2021 15:49:33 +0000 (09:49 -0600)
commit28fb5a623a688c18e240202b2f6d610dec17dded
treea215817815a3f606191b6a73327df1f516bf9b0c
parent9939d992acf95a92fe0bc3f3d6f5be129e1909c2
io_uring: harder fdinfo sq/cq ring iterating

The ring iteration is racy, which isn't necessarily a problem except it
can cause us to iterate the whole thing. That isn't desired or ideal,
and it can lead to excessive runtimes of reading fdinfo.

Cap the iteration at tail - head OR the ring size. While in there, clean
up the ring masking and just dump the raw values along with the masks.
That provides more useful debug info.

Fixes: ed37ac8a8283 ("io_uring: add more uring info to fdinfo for debug")
Reported-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c