mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mm, slub: print CPU id on slab OOM
@ 2024-08-06 23:26 Axel Rasmussen
  2024-08-09  7:36 ` Vlastimil Babka
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Axel Rasmussen @ 2024-08-06 23:26 UTC (permalink / raw)
  To: Andrew Morton, Christoph Lameter, David Rientjes, Hyeonggon Yoo,
	Joonsoo Kim, Pekka Enberg, Roman Gushchin, Vlastimil Babka
  Cc: linux-kernel, linux-mm, Axel Rasmussen

Depending on how remote_node_defrag_ratio is configured, allocations can
end up in this path as a result of the local node being OOM, despite the
allocation overall being unconstrained (node == -1).

When we print a warning, printing the current CPU makes that situation
more clear (i.e., you can immediately see which node's OOM status
matters for the allocation at hand).

Signed-off-by: Axel Rasmussen <axelrasmussen@google.com>
---
 mm/slub.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/slub.c b/mm/slub.c
index c9d8a2497fd6..7148047998de 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3422,7 +3422,8 @@ slab_out_of_memory(struct kmem_cache *s, gfp_t gfpflags, int nid)
 	if ((gfpflags & __GFP_NOWARN) || !__ratelimit(&slub_oom_rs))
 		return;
 
-	pr_warn("SLUB: Unable to allocate memory on node %d, gfp=%#x(%pGg)\n",
+	pr_warn("SLUB: Unable to allocate memory for CPU %u on node %d, gfp=%#x(%pGg)\n",
+		preemptible() ? raw_smp_processor_id() : smp_processor_id(),
 		nid, gfpflags, &gfpflags);
 	pr_warn("  cache: %s, object size: %u, buffer size: %u, default order: %u, min order: %u\n",
 		s->name, s->object_size, s->size, oo_order(s->oo),
-- 
2.46.0.rc2.264.g509ed76dc8-goog


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

end of thread, other threads:[~2024-08-12 22:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-06 23:26 [PATCH] mm, slub: print CPU id on slab OOM Axel Rasmussen
2024-08-09  7:36 ` Vlastimil Babka
2024-08-10 23:52 ` David Rientjes
2024-08-11 20:16 ` Vlastimil Babka
2024-08-11 20:21   ` David Rientjes
2024-08-12 22:45     ` Axel Rasmussen

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

all inboxes | Powered by JetHome®