• Pavel Begunkov's avatar
    io_uring: remove indirect ctx into sqo injection · 7d41e854
    Pavel Begunkov authored
    We use ->ctx_new_list to notify sqo about new ctx pending, then sqo
    should stop and splice it to its sqd->ctx_list, paired with
    ->sq_thread_comp.
    
    The last one is broken because nobody reinitialises it, and trying to
    fix it would only add more complexity and bugs. And the first isn't
    really needed as is done under park(), that protects from races well.
    Add ctx into sqd->ctx_list directly (under park()), it's much simpler
    and allows to kill both, ctx_new_list and sq_thread_comp.
    
    note: apparently there is no real problem at the moment, because
    sq_thread_comp is used only by io_sq_thread_finish() followed by
    parking, where list_del(&ctx->sqd_list) removes it well regardless
    whether it's in the new or the active list.
    Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    7d41e854
io_uring.c 239 KB