Skip to content

Commit bf6b9e9

Browse files
CmdrMoozytehcaster
authored andcommitted
mm, slub: print CPU id (and its node) on slab OOM
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). Acked-by: David Rientjes <[email protected]> Signed-off-by: Axel Rasmussen <[email protected]> Signed-off-by: Vlastimil Babka <[email protected]>
1 parent 4c39529 commit bf6b9e9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mm/slub.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3416,14 +3416,15 @@ slab_out_of_memory(struct kmem_cache *s, gfp_t gfpflags, int nid)
34163416
{
34173417
static DEFINE_RATELIMIT_STATE(slub_oom_rs, DEFAULT_RATELIMIT_INTERVAL,
34183418
DEFAULT_RATELIMIT_BURST);
3419+
int cpu = raw_smp_processor_id();
34193420
int node;
34203421
struct kmem_cache_node *n;
34213422

34223423
if ((gfpflags & __GFP_NOWARN) || !__ratelimit(&slub_oom_rs))
34233424
return;
34243425

3425-
pr_warn("SLUB: Unable to allocate memory on node %d, gfp=%#x(%pGg)\n",
3426-
nid, gfpflags, &gfpflags);
3426+
pr_warn("SLUB: Unable to allocate memory on CPU %u (of node %d) on node %d, gfp=%#x(%pGg)\n",
3427+
cpu, cpu_to_node(cpu), nid, gfpflags, &gfpflags);
34273428
pr_warn(" cache: %s, object size: %u, buffer size: %u, default order: %u, min order: %u\n",
34283429
s->name, s->object_size, s->size, oo_order(s->oo),
34293430
oo_order(s->min));

0 commit comments

Comments
 (0)