• Pavel Begunkov's avatar
    io_uring: Use submit info inlined into req · 50585b9a
    Pavel Begunkov authored
    Stack allocated struct sqe_submit is passed down to the submission path
    along with a request (a.k.a. struct io_kiocb), and will be copied into
    req->submit for async requests.
    
    As space for it is already allocated, fill req->submit in the first
    place instead of using on-stack one. As a result:
    
    1. sqe->submit is the only place for sqe_submit and is always valid,
    so we don't need to track which one to use.
    2. don't need to copy in case of async
    3. allows to simplify the code by not carrying it as an argument all
    the way down
    4. allows to reduce number of function arguments / potentially improve
    spilling
    
    The downside is that stack is most probably be cached, that's not true
    for just allocated memory for a request. Another concern is cache
    pollution. Though, a request would be touched and fetched along with
    req->submit at some point anyway, so shouldn't be a problem.
    Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    50585b9a
io_uring.c 105 KB