Skip to content

Commit 6e40983

Browse files
committed
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/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 6a8afb9 commit 6e40983

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

io_uring/io_uring.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,11 @@
114114
#define IO_REQ_LINK_FLAGS (REQ_F_LINK | REQ_F_HARDLINK)
115115

116116
#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)
119118

120119
#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)
122122

123123
#define IO_TCTX_REFS_CACHE_NR (1U << 10)
124124

@@ -392,11 +392,6 @@ static void io_clean_op(struct io_kiocb *req)
392392
if (def->cleanup)
393393
def->cleanup(req);
394394
}
395-
if ((req->flags & REQ_F_POLLED) && req->apoll) {
396-
kfree(req->apoll->double_poll);
397-
kfree(req->apoll);
398-
req->apoll = NULL;
399-
}
400395
if (req->flags & REQ_F_INFLIGHT)
401396
atomic_dec(&req->tctx->inflight_tracked);
402397
if (req->flags & REQ_F_CREDS)

0 commit comments

Comments
 (0)