• Jens Axboe's avatar
    io_uring: reduce/pack size of io_ring_ctx · 206aefde
    Jens Axboe authored
    With the recent flurry of additions and changes to io_uring, the
    layout of io_ring_ctx has become a bit stale. We're right now at
    704 bytes in size on my x86-64 build, or 11 cachelines. This
    patch does two things:
    
    - We have to completion structs embedded, that we only use for
      quiesce of the ctx (or shutdown) and for sqthread init cases.
      That 2x32 bytes right there, let's dynamically allocate them.
    
    - Reorder the struct a bit with an eye on cachelines, use cases,
      and holes.
    
    With this patch, we're down to 512 bytes, or 8 cachelines.
    Reviewed-by: default avatarJackie Liu <liuyun01@kylinos.cn>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    206aefde
io_uring.c 111 KB