Skip to content

Commit 354ad60

Browse files
uarif1tehcaster
authored andcommitted
mm: slub: only warn once when allocating slab obj extensions fails
In memory bound systems, a large number of warnings for failing this allocation repeatedly may mask any real issues in the system during memory pressure being reported in dmesg. Change this to warning only once. Signed-off-by: Usama Arif <[email protected]> Reported-by: Vlad Poenaru <[email protected]> Closes: https://lore.kernel.org/all/[email protected]/ Reviewed-by: Shakeel Butt <[email protected]> Reviewed-by: SeongJae Park <[email protected]> Acked-by: Harry Yoo <[email protected]> Signed-off-by: Vlastimil Babka <[email protected]>
1 parent 4645915 commit 354ad60

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mm/slub.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2102,10 +2102,11 @@ prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p)
21022102

21032103
slab = virt_to_slab(p);
21042104
if (!slab_obj_exts(slab) &&
2105-
WARN(alloc_slab_obj_exts(slab, s, flags, false),
2106-
"%s, %s: Failed to create slab extension vector!\n",
2107-
__func__, s->name))
2105+
alloc_slab_obj_exts(slab, s, flags, false)) {
2106+
pr_warn_once("%s, %s: Failed to create slab extension vector!\n",
2107+
__func__, s->name);
21082108
return NULL;
2109+
}
21092110

21102111
return slab_obj_exts(slab) + obj_to_index(s, slab, p);
21112112
}

0 commit comments

Comments
 (0)