@@ -602,8 +602,6 @@ struct io_kiocb {
*/
u16 buf_index;
- atomic_t refs;
-
io_req_flags_t flags;
struct io_ring_ctx *ctx;
@@ -629,8 +627,11 @@ struct io_kiocb {
union {
/* used by request caches, completion batching and iopoll */
struct io_wq_work_node comp_list;
- /* cache ->apoll->events */
- __poll_t apoll_events;
+ struct {
+ /* cache ->apoll->events */
+ __poll_t apoll_events;
+ unsigned nr_tw;
+ };
};
struct io_rsrc_node *rsrc_node;
@@ -639,7 +640,7 @@ struct io_kiocb {
struct io_task_work io_task_work;
atomic_t poll_refs;
- unsigned nr_tw;
+ atomic_t refs;
/* internal polling, see IORING_FEAT_FAST_POLL */
struct async_poll *apoll;
/* opcode allocated if it needs to store data for async defer */
comp_list is only used for completion purposes, which it why it currently shares space with apoll_events (which is only used for poll triggering). nr_rw is also not used with comp_list, the former is just used for local task_list wakeup optimizations. This doesn't save any space in io_kiocb, rather it now leaves a 32-bit hole that can be used for something else, when the need arises. Signed-off-by: Jens Axboe <axboe@kernel.dk> --- include/linux/io_uring_types.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)