io_uring: limit the number of cancellation buckets
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 16 Jun 2022 09:22:05 +0000 (10:22 +0100)
committerJens Axboe <axboe@kernel.dk>
Fri, 17 Jun 2022 14:25:39 +0000 (08:25 -0600)
commitcbfe583f2d720e3452e605a5b60216851e02f2d3
treee91403bc25656aa8e85ee00b56673b65174b5e99
parent24e4a38c1df3a3cd98589b8f21321bfc30597640
io_uring: limit the number of cancellation buckets

Don't allocate to many hash/cancellation buckets, there might be too
many, clamp it to 8 bits, or 256 * 64B = 16KB. We don't usually have too
many requests, and 256 buckets should be enough, especially since we
do hash search only in the cancellation path.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/b9620c8072ba61a2d50eba894b89bd93a94a9abd.1655371007.git.asml.silence@gmail.com
Reviewed-by: Hao Xu <howeyxu@tencent.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io_uring.c