• Pavel Begunkov's avatar
    io-wq: optimise locking in io_worker_handle_work() · 58e39319
    Pavel Begunkov authored
    There are 2 optimisations:
    - Now, io_worker_handler_work() do io_assign_current_work() twice per
    request, and each one adds lock/unlock(worker->lock) pair. The first is
    to reset worker->cur_work to NULL, and the second to set a real work
    shortly after. If there is a dependant work, set it immediately, that
    effectively removes the extra NULL'ing.
    
    - And there is no use in taking wqe->lock for linked works, as they are
    not hashed now. Optimise it out.
    Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    58e39319
io-wq.c 27.5 KB