io_uring: flush offloaded and delayed task_work on exit
authorJens Axboe <axboe@kernel.dk>
Wed, 28 Jun 2023 17:06:05 +0000 (11:06 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 28 Jun 2023 17:06:05 +0000 (11:06 -0600)
commitdfbe5561ae9339516a3742a3fbd678609ad59fd0
treeb8b9c27149c8a424da8220b081a2e5d5a70d9fe9
parent10e1c0d59006c6492d380602aa0a6c4eb9441426
io_uring: flush offloaded and delayed task_work on exit

io_uring offloads task_work for cancelation purposes when the task is
exiting. This is conceptually fine, but we should be nicer and actually
wait for that work to complete before returning.

Add an argument to io_fallback_tw() telling it to flush the deferred
work when it's all queued up, and have it flush a ctx behind whenever
the ctx changes.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io_uring.c