io_uring: drop overflowing CQE instead of exceeding memory limits
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.
Signed-off-by Alexandre Negrel <[email protected]>
--- io_uring/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
io_uring/io_uring.c +1 -1
@@ -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
Quoted 6 lines · Alexandre Negrel
Allocate the overflowing CQE with
GFP_NOWAITinstead ofGFP_ATOMIC. This changes causes allocations to fail in out-of-memory situations, resulting in CQE being dropped. UsingGFP_ATOMICallows 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