mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
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>
This commit is contained in:
parent
6a8afb9fff
commit
6e4098382b
@ -114,11 +114,11 @@
|
|||||||
#define IO_REQ_LINK_FLAGS (REQ_F_LINK | REQ_F_HARDLINK)
|
#define IO_REQ_LINK_FLAGS (REQ_F_LINK | REQ_F_HARDLINK)
|
||||||
|
|
||||||
#define IO_REQ_CLEAN_FLAGS (REQ_F_BUFFER_SELECTED | REQ_F_NEED_CLEANUP | \
|
#define IO_REQ_CLEAN_FLAGS (REQ_F_BUFFER_SELECTED | REQ_F_NEED_CLEANUP | \
|
||||||
REQ_F_POLLED | REQ_F_INFLIGHT | REQ_F_CREDS | \
|
REQ_F_INFLIGHT | REQ_F_CREDS | REQ_F_ASYNC_DATA)
|
||||||
REQ_F_ASYNC_DATA)
|
|
||||||
|
|
||||||
#define IO_REQ_CLEAN_SLOW_FLAGS (REQ_F_REFCOUNT | IO_REQ_LINK_FLAGS | \
|
#define IO_REQ_CLEAN_SLOW_FLAGS (REQ_F_REFCOUNT | IO_REQ_LINK_FLAGS | \
|
||||||
REQ_F_REISSUE | IO_REQ_CLEAN_FLAGS)
|
REQ_F_REISSUE | REQ_F_POLLED | \
|
||||||
|
IO_REQ_CLEAN_FLAGS)
|
||||||
|
|
||||||
#define IO_TCTX_REFS_CACHE_NR (1U << 10)
|
#define IO_TCTX_REFS_CACHE_NR (1U << 10)
|
||||||
|
|
||||||
@ -392,11 +392,6 @@ static void io_clean_op(struct io_kiocb *req)
|
|||||||
if (def->cleanup)
|
if (def->cleanup)
|
||||||
def->cleanup(req);
|
def->cleanup(req);
|
||||||
}
|
}
|
||||||
if ((req->flags & REQ_F_POLLED) && req->apoll) {
|
|
||||||
kfree(req->apoll->double_poll);
|
|
||||||
kfree(req->apoll);
|
|
||||||
req->apoll = NULL;
|
|
||||||
}
|
|
||||||
if (req->flags & REQ_F_INFLIGHT)
|
if (req->flags & REQ_F_INFLIGHT)
|
||||||
atomic_dec(&req->tctx->inflight_tracked);
|
atomic_dec(&req->tctx->inflight_tracked);
|
||||||
if (req->flags & REQ_F_CREDS)
|
if (req->flags & REQ_F_CREDS)
|
||||||
|
Loading…
Reference in New Issue
Block a user