]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: acquire 'mm' for task_work for SQPOLL
authorJens Axboe <axboe@kernel.dk>
Wed, 17 Jun 2020 00:42:49 +0000 (18:42 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 17 Jun 2020 18:49:16 +0000 (12:49 -0600)
commite849c9384027aca5bf7e49f454f28a6628f16e69
tree869fea84308ffa827fcd92a85d6fbe55686213a9
parentbc7e8924d4a5357987c7f0dd608e7e22841c9ea5
io_uring: acquire 'mm' for task_work for SQPOLL

If we're unlucky with timing, we could be running task_work after
having dropped the memory context in the sq thread. Since dropping
the context requires a runnable task state, we cannot reliably drop
it as part of our check-for-work loop in io_sq_thread(). Instead,
abstract out the mm acquire for the sq thread into a helper, and call
it from the async task work handler.

Cc: stable@vger.kernel.org # v5.7
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c