• Jens Axboe's avatar
    io_uring/net: always setup an io_async_msghdr · 790b68b3
    Jens Axboe authored
    Rather than use an on-stack one and then need to allocate and copy if
    async execution is required, always grab one upfront. This should be
    very cheap, and potentially even have cache hotness benefits for
    back-to-back send/recv requests.
    
    For any recv type of request, this is probably a good choice in general,
    as it's expected that no data is available initially. For send this is
    not necessarily the case, as space in the socket buffer is expected to
    be available. However, getting a cached io_async_msghdr is very cheap,
    and as it should be cache hot, probably the difference here is neglible,
    if any.
    
    A nice side benefit is that io_setup_async_msg can get killed
    completely, which has some nasty iovec manipulation code.
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    790b68b3
net.c 39 KB