OSDN Git Service

io_uring: optimise SQPOLL mm/files grabbing
authorPavel Begunkov <asml.silence@gmail.com>
Fri, 12 Feb 2021 03:23:52 +0000 (03:23 +0000)
committerJens Axboe <axboe@kernel.dk>
Fri, 12 Feb 2021 12:30:25 +0000 (05:30 -0700)
commit4e32635834a30b8aa9583d3899a8ecc6416023fb
tree6f0b0ab7d9b18523981c1fa7dd35a3d04357edbc
parentd3d7298d05cb026305b0f5033acc9c9c4f281e14
io_uring: optimise SQPOLL mm/files grabbing

There are two reasons for this. First is to optimise
io_sq_thread_acquire_mm_files() for non-SQPOLL case, which currently do
too many checks and function calls in the hot path, e.g. in
io_init_req().

The second is to not grab mm/files when there are not needed. As
__io_queue_sqe() issues only one request now, we can reuse
io_sq_thread_acquire_mm_files() instead of unconditional acquire
mm/files.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c