Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring/poll: cleanup apoll freeing

No point having REQ_F_POLLED in both IO_REQ_CLEAN_FLAGS and in
IO_REQ_CLEAN_SLOW_FLAGS, and having both io_free_batch_list() and then
io_clean_op() check for it and clean it.

Move REQ_F_POLLED to IO_REQ_CLEAN_SLOW_FLAGS and drop it from
IO_REQ_CLEAN_FLAGS, and have only io_free_batch_list() do the check and
freeing.

Link: https://lore.kernel.org/io-uring/20250712000344.1579663-2-axboe@kernel.dk
Signed-off-by: Jens Axboe <axboe@kernel.dk>

Jens Axboe 6e409838 6a8afb9f

+3 -8
+3 -8
io_uring/io_uring.c
··· 114 114 #define IO_REQ_LINK_FLAGS (REQ_F_LINK | REQ_F_HARDLINK) 115 115 116 116 #define IO_REQ_CLEAN_FLAGS (REQ_F_BUFFER_SELECTED | REQ_F_NEED_CLEANUP | \ 117 - REQ_F_POLLED | REQ_F_INFLIGHT | REQ_F_CREDS | \ 118 - REQ_F_ASYNC_DATA) 117 + REQ_F_INFLIGHT | REQ_F_CREDS | REQ_F_ASYNC_DATA) 119 118 120 119 #define IO_REQ_CLEAN_SLOW_FLAGS (REQ_F_REFCOUNT | IO_REQ_LINK_FLAGS | \ 121 - REQ_F_REISSUE | IO_REQ_CLEAN_FLAGS) 120 + REQ_F_REISSUE | REQ_F_POLLED | \ 121 + IO_REQ_CLEAN_FLAGS) 122 122 123 123 #define IO_TCTX_REFS_CACHE_NR (1U << 10) 124 124 ··· 391 391 392 392 if (def->cleanup) 393 393 def->cleanup(req); 394 - } 395 - if ((req->flags & REQ_F_POLLED) && req->apoll) { 396 - kfree(req->apoll->double_poll); 397 - kfree(req->apoll); 398 - req->apoll = NULL; 399 394 } 400 395 if (req->flags & REQ_F_INFLIGHT) 401 396 atomic_dec(&req->tctx->inflight_tracked);