io_uring: do msg_ring in target task via tw
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 7 Dec 2022 03:53:36 +0000 (03:53 +0000)
committerJens Axboe <axboe@kernel.dk>
Wed, 7 Dec 2022 15:50:57 +0000 (08:50 -0700)
commit6d043ee1164ca3305738131f170e560587070fa9
tree67f4858e877e67894abad983f81c6c7e8a736e79
parent172113101641cf1f9628c528ec790cb809f2b704
io_uring: do msg_ring in target task via tw

While executing in a context of one io_uring instance msg_ring
manipulates another ring. We're trying to keep CQEs posting contained in
the context of the ring-owner task, use task_work to send the request to
the target ring's task when we're modifying its CQ or trying to install
a file. Note, we can't safely use io_uring task_work infra and have to
use task_work directly.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/4d76c7b28ed5d71b520de4482fbb7f660f21cd80.1670384893.git.asml.silence@gmail.com
[axboe: use TWA_SIGNAL_NO_IPI]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/msg_ring.c