OSDN Git Service

io_uring: use hash table for poll command lookups
authorJens Axboe <axboe@kernel.dk>
Thu, 5 Dec 2019 02:56:40 +0000 (19:56 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 5 Dec 2019 03:12:58 +0000 (20:12 -0700)
commit78076bb64aa8ba5b7207c38b2660a9e10ffa8cc7
tree299d7246dedf9f50a791ef526c1d12ac7ab3c329
parent08bdcc35f00c91b325195723cceaba0937a89ddf
io_uring: use hash table for poll command lookups

We recently changed this from a single list to an rbtree, but for some
real life workloads, the rbtree slows down the submission/insertion
case enough so that it's the top cycle consumer on the io_uring side.
In testing, using a hash table is a more well rounded compromise. It
is fast for insertion, and as long as it's sized appropriately, it
works well for the cancellation case as well. Running TAO with a lot
of network sockets, this removes io_poll_req_insert() from spending
2% of the CPU cycles.

Reported-by: Dan Melnic <dmm@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c