public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] io_uring: drop overflowing CQE instead of exceeding memory limits
@ 2025-12-30 18:57 Alexandre Negrel
  2025-12-31  1:50 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandre Negrel @ 2025-12-30 18:57 UTC (permalink / raw)
  To: axboe, io-uring, linux-kernel; +Cc: 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.

Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220794
Signed-off-by: Alexandre Negrel <alexandre@negrel.dev>
---
 io_uring/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 6cb24cdf8e68..709943fedaf4 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -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);
 }
 
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] io_uring: drop overflowing CQE instead of exceeding memory limits
  2025-12-30 18:57 [PATCH v2] io_uring: drop overflowing CQE instead of exceeding memory limits Alexandre Negrel
@ 2025-12-31  1:50 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2025-12-31  1:50 UTC (permalink / raw)
  To: io-uring, linux-kernel, Alexandre Negrel


On Tue, 30 Dec 2025 19:57:28 +0100, Alexandre Negrel wrote:
> 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,
-- 
Jens Axboe




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-12-31  1:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-30 18:57 [PATCH v2] io_uring: drop overflowing CQE instead of exceeding memory limits Alexandre Negrel
2025-12-31  1:50 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox