Skip to contentSkip to conversation

io_uring: drop overflowing CQE instead of exceeding memory limits

PATCH Applied Alexandre Negrel 2 participants 2 messages Dec 30, 2025 – Dec 31, 2025 io_uring

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 io_uring: drop overflowing CQE instead of exceeding memory limits

Allocate the overflowing CQE with GFP_NOWAIT instead of GFP_ATOMIC. This changes causes allocations to fail in out-of-memory situations, resulting in CQE being dropped. Using GFP_ATOMIC allows a process to exceed memory limits.

---
 io_uring/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
io_uring/io_uring.c +1 -1
index 6cb24cdf8e68..709943fedaf4 100644
@@ -864,7 +864,7 @@ static __cold bool io_cqe_overflow_locked(struct io_ring_ctx *ctx,
 {
 	struct io_overflow_cqe *ocqe;
 
-	ocqe = io_alloc_ocqe(ctx, cqe, big_cqe, GFP_ATOMIC);
+	ocqe = io_alloc_ocqe(ctx, cqe, big_cqe, GFP_NOWAIT);
 	return io_cqring_add_overflow(ctx, ocqe);
 }
 
Signature · 1 line
2.51.0
maintainer Applied
#1 lore raw
Quoted 6 lines · Alexandre Negrel

Allocate the overflowing CQE with GFP_NOWAIT instead of GFP_ATOMIC. This changes causes allocations to fail in out-of-memory situations, resulting in CQE being dropped. Using GFP_ATOMIC allows a process to exceed memory limits.

Applied, thanks!

[1/1] io_uring: drop overflowing CQE instead of exceeding memory limits
(no commit info)

Best regards,

Signature · 1 line
Jens Axboe