mm: slub: only warn once when allocating slab obj extensions fails
Subsystems (2)
PATCH v3 1/1 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.
---
v2 -> v3:
- Put warning back, but only warn once with pr_warn_once. v1 -> v2:
- remove the warning completely. We will have a way in the future to indicate that the mem alloc profile is inaccurate.
--- mm/slub.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
mm/slub.c +5 -3
@@ -2102,10 +2102,12 @@ prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p) slab =virt_to_slab (p);if (!slab_obj_exts (slab) && -WARN (alloc_slab_obj_exts (slab, s, flags, false), -"%s, %s: Failed to create slab extension vector!\n" , - __func__, s->name)) +alloc_slab_obj_exts (slab, s, flags, false)) { +pr_warn_once ("%s, %s: Failed to create slab extension vector!\n" , + __func__, s->name);return NULL ; + } +return slab_obj_exts (slab) +obj_to_index (s, slab, p); }
Signature · 1 line
2.47.1
Quoted 8 lines · Usama Arif
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]>
Quoted 8 lines · On Fri, 23 May 2025 17:52:40 +0100 Usama Arif <[email protected]> wrote:
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]>
Thanks,
SJ
[...]
Quoted 25 lines · Usama Arif
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]>---
v2 -> v3:
- Put warning back, but only warn once withpr_warn_once. v1 -> v2:
- remove the warning completely. We will have a way in the future to indicate that the mem alloc profile is inaccurate.--- mm/slub.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)mm/slub.c +0
-0@@ -2102,10 +2102,12 @@ prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p) slab =virt_to_slab (p);
mm/slub.c prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p) · line 2110
Quoted 10 lines
mm/slub.c +5
-3if (!slab_obj_exts (slab) && -WARN (alloc_slab_obj_exts (slab, s, flags, false), -"%s, %s: Failed to create slab extension vector!\n" , - __func__, s->name)) +alloc_slab_obj_exts (slab, s, flags, false)) { +pr_warn_once ("%s, %s: Failed to create slab extension vector!\n" , + __func__, s->name);return NULL ; + } +
I've removed the extra line locally.
Added to slab/for-next, thanks.
Quoted 3 lines
mm/slub.c +0
-0return slab_obj_exts (slab) +obj_to_index (s, slab, p); }
Quoted 9 lines · Usama Arif
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]>---
Quoted 32 lines
v2 -> v3:
- Put warning back, but only warn once withpr_warn_once. v1 -> v2:
- remove the warning completely. We will have a way in the future to indicate that the mem alloc profile is inaccurate.--- mm/slub.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)mm/slub.c +5
-3@@ -2102,10 +2102,12 @@ prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p) slab =virt_to_slab (p);if (!slab_obj_exts (slab) && -WARN (alloc_slab_obj_exts (slab, s, flags, false), -"%s, %s: Failed to create slab extension vector!\n" , - __func__, s->name)) +alloc_slab_obj_exts (slab, s, flags, false)) { +pr_warn_once ("%s, %s: Failed to create slab extension vector!\n" , + __func__, s->name);return NULL ; + } +return slab_obj_exts (slab) +obj_to_index (s, slab, p); }Signature · 1 line
2.47.1
Signature · 2 lines
Cheers, Harry / Hyeonggon
Suren Baghdasaryan
Acked-byQuoted 7 lines · Harry Yoo
Quoted 5 lines · Usama Arif
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.
Quoted 6 lines
Quoted 4 lines
Signed-off-by Usama Arif <[email protected]>Reported-by Vlad Poenaru <[email protected]>---
Acked-by Harry Yoo <[email protected]>
Quoted 37 lines
Quoted 31 lines
v2 -> v3:
- Put warning back, but only warn once withpr_warn_once. v1 -> v2:
- remove the warning completely. We will have a way in the future to indicate that the mem alloc profile is inaccurate.--- mm/slub.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)mm/slub.c +5
-4@@ -2102,10 +2102,12 @@ prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p) slab =virt_to_slab (p);if (!slab_obj_exts (slab) && -WARN (alloc_slab_obj_exts (slab, s, flags, false), -"%s, %s: Failed to create slab extension vector!\n" , - __func__, s->name)) +alloc_slab_obj_exts (slab, s, flags, false)) { +pr_warn_once ("%s, %s: Failed to create slab extension vector!\n" , + __func__, s->name);return NULL ; + } +return slab_obj_exts (slab) +obj_to_index (s, slab, p); } --Quoted 2 lines
2.47.1
--
Cheers,
Harry / Hyeonggon
Quoted 8 lines · Usama Arif
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]>
Thanks!