]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit91c3e41b5e969791e77bead854cfd70bd3b9be1a
tree299d7246dedf9f50a791ef526c1d12ac7ab3c329
parent307646ba3fa1b30b9bab60ee91f0fa4750dde861
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