]> 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)
commitb08a74f3ce8b254f574f735fb4450b611dd45508
treea215817815a3f606191b6a73327df1f516bf9b0c
parentec1f77b3f49967021d6eec89f82f89f9bb78db2c
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: d404de5c4e00 ("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