]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: remove indirect ctx into sqo injection
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 10 Mar 2021 13:13:54 +0000 (13:13 +0000)
committerJens Axboe <axboe@kernel.dk>
Wed, 10 Mar 2021 14:30:32 +0000 (07:30 -0700)
commit00b48ef11e0bf1e46a9b105a2c2b4f4a2af6ff00
tree30b28545ccfb289df8e67c1734cba1bd00d023e7
parentebd97befe48973be3fc40937f68fda404df769a1
io_uring: remove indirect ctx into sqo injection

We use ->ctx_new_list to notify sqo about new ctx pending, then sqo
should stop and splice it to its sqd->ctx_list, paired with
->sq_thread_comp.

The last one is broken because nobody reinitialises it, and trying to
fix it would only add more complexity and bugs. And the first isn't
really needed as is done under park(), that protects from races well.
Add ctx into sqd->ctx_list directly (under park()), it's much simpler
and allows to kill both, ctx_new_list and sq_thread_comp.

note: apparently there is no real problem at the moment, because
sq_thread_comp is used only by io_sq_thread_finish() followed by
parking, where list_del(&ctx->sqd_list) removes it well regardless
whether it's in the new or the active list.

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