io_uring: cache struct io_notif
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 12 Jul 2022 20:52:39 +0000 (21:52 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 25 Jul 2022 00:41:06 +0000 (18:41 -0600)
commiteb4a299b2f95437af6183946c2a2e850621cefdb
tree16bd25d7e2ca9aab186eae6e517425c4da8e9b96
parenteb42cebb2cf24c48f60c32856a4bba93d42659c8
io_uring: cache struct io_notif

kmalloc'ing struct io_notif is too expensive when done frequently, cache
them as many other resources in io_uring. Keep two list, the first one
is from where we're getting notifiers, it's protected by ->uring_lock.
The second is protected by ->completion_lock, to which we queue released
notifiers. Then we splice one list into another when needed.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/9dec18f7fcbab9f4bd40b96e5ae158b119945230.1657643355.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/io_uring_types.h
io_uring/io_uring.c
io_uring/notif.c
io_uring/notif.h