]> 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)
commit7594289a2761498fbabea1f315c738086b9b950a
tree869fea84308ffa827fcd92a85d6fbe55686213a9
parent433f0be153d5cffa18a87f6f9104e55155ef4c43
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