aboutsummaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2021-03-14 20:57:12 +0000
committerJens Axboe <axboe@kernel.dk>2021-03-15 09:32:40 -0600
commit9e138a48345427fa42f6076396ea069cebf3c08f (patch)
tree68225f0800698772485a206aac799d7c80259047 /init
parentf6d54255f4235448d4bbe442362d4caa62da97d5 (diff)
io_uring: fix concurrent parking
If io_sq_thread_park() of one task got rescheduled right after set_bit(), before it gets back to mutex_lock() there can happen park()/unpark() by another task with SQPOLL locking again and continuing running never seeing that first set_bit(SHOULD_PARK), so won't even try to put the mutex down for parking. It will get parked eventually when SQPOLL drops the lock for reschedule, but may be problematic and will get in the way of further fixes. Account number of tasks waiting for parking with a new atomic variable park_pending and adjust SHOULD_PARK accordingly. It doesn't entirely replaces SHOULD_PARK bit with this atomic var because it's convenient to have it as a bit in the state and will help to do optimisations later. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'init')
0 files changed, 0 insertions, 0 deletions