]> 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)
commit052835daa3112a7f31135bc2a118ad8770b46d08
tree30b28545ccfb289df8e67c1734cba1bd00d023e7
parent69220c7a0e10257cd77c3a40ed08195f47291d47
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