public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] r8169: avoid OOM when allocating RX buffers
@ 2026-02-16 18:52 Fabian Druschke
  2026-02-16 19:35 ` Eric Dumazet
  2026-02-16 20:13 ` Andrew Lunn
  0 siblings, 2 replies; 5+ messages in thread
From: Fabian Druschke @ 2026-02-16 18:52 UTC (permalink / raw)
  To: Heiner Kallweit, nic_swsd
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev, linux-kernel, stable, Fabian Druschke

From: Fabian Druschke <fdruschke@outlook.com>

r8169 allocates order-2 pages for RX buffers during rtl_open(). Under heavy
memory fragmentation this allocation may trigger the global OOM killer,
causing unrelated user processes to be killed.

Use a GFP mask that avoids OOM killer invocation so the allocation can fail
gracefully and rtl_open() returns -ENOMEM instead.

Cc: stable@vger.kernel.org
Signed-off-by: Fabian Druschke <fdruschke@outlook.com>
---
 drivers/net/ethernet/realtek/r8169_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 3507c2e28110..3525e889ec1c 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -3952,7 +3952,8 @@ static struct page *rtl8169_alloc_rx_data(struct rtl8169_private *tp,
 	dma_addr_t mapping;
 	struct page *data;
 
-	data = alloc_pages_node(node, GFP_KERNEL, get_order(R8169_RX_BUF_SIZE));
+	gfp_t gfp = GFP_KERNEL | __GFP_RETRY_MAYFAIL | __GFP_NOWARN;
+	data = alloc_pages_node(node, gfp, get_order(R8169_RX_BUF_SIZE));
 	if (!data)
 		return NULL;
 
-- 
2.52.0


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

end of thread, other threads:[~2026-02-17 22:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-16 18:52 [PATCH] r8169: avoid OOM when allocating RX buffers Fabian Druschke
2026-02-16 19:35 ` Eric Dumazet
2026-02-16 20:13 ` Andrew Lunn
2026-02-17 21:50   ` Fabian Druschke
2026-02-17 22:33     ` Jakub Kicinski

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