Skip to contentSkip to conversation

mm: slub: do not warn when allocating slab obj extensions fails

PATCH Superseded Usama Arif 2 participants 5 messages May 21, 2025

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Usama Arif

author
#0 lore raw

PATCH 1/1 mm: slub: do not warn 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. Failing this allocation is not indicative of a bug, so remove the warning.

---
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 | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
mm/slub.c +1 -3
index dc9e729e1d26..06ab9a558b73 100644
@@ -2102,9 +2102,7 @@ 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))
 		return NULL;
 
 	return slab_obj_exts(slab) + obj_to_index(s, slab, p);
Signature · 1 line
2.47.1
#1 lore raw
Quoted 22 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. Failing this allocation is not indicative of a bug, so remove the warning.

---
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 | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
mm/slub.c +0 -0
index dc9e729e1d26..06ab9a558b73 100644

mm/slub.c prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p) · line 2105

Quoted 7 lines
mm/slub.c +1 -3
@@ -2102,9 +2102,7 @@ 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))

I thought we agreed to having pr_warn_once() here. Did I miss something?

Quoted 6 lines
mm/slub.c +0 -1
                return NULL;
 
        return slab_obj_exts(slab) + obj_to_index(s, slab, p);
--

2.47.1

author
#2 lore raw
Quoted 24 lines · Suren Baghdasaryan
Quoted 23 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. Failing this allocation is not indicative of a bug, so remove the warning.

---
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 | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
mm/slub.c +0 -0
index dc9e729e1d26..06ab9a558b73 100644
@@ -2102,9 +2102,7 @@ prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p)
 
Quoted 9 lines

mm/slub.c prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p) · line 2105

Quoted 6 lines
mm/slub.c +1 -3
        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))

I thought we agreed to having pr_warn_once() here. Did I miss something?

I had [1] yesterday but I saw Johannes's mail [2] in and Harry mentioned in [3] that failing to allocate the extension vector can happen during normal operations. So I thought maybe there are more votes for removing it.

I am ok with either pr_warn_once or removing it completely.

I guess the question is, is it considered OK to fail here?

[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/
[3] https://lore.kernel.org/all/[email protected]/

#3 lore raw
Quoted 38 lines · Usama Arif
Quoted 24 lines · Suren Baghdasaryan
Quoted 23 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. Failing this allocation is not indicative of a bug, so remove the warning.

---
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 | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
mm/slub.c +0 -0
index dc9e729e1d26..06ab9a558b73 100644
@@ -2102,9 +2102,7 @@ prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p)
 
Quoted 9 lines

mm/slub.c prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p) · line 2105

Quoted 6 lines
mm/slub.c +1 -3
        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))

I thought we agreed to having pr_warn_once() here. Did I miss something?

Quoted 5 lines

I had [1] yesterday but I saw Johannes's mail [2] in and Harry mentioned in [3] that failing to allocate the extension vector can happen during normal operations. So I thought maybe there are more votes for removing it.

I am ok with either pr_warn_once or removing it completely.

I feel like we should have at least some indication that something went wrong here.

Quoted 2 lines

I guess the question is, is it considered OK to fail here?

Well, it's not ok but not catastrophic either, so warning seems appropriate to me.

Quoted 4 lines

[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/
[3] https://lore.kernel.org/all/[email protected]/

author
#4 lore raw
Quoted 45 lines · Suren Baghdasaryan
Quoted 38 lines · Usama Arif
Quoted 24 lines · Suren Baghdasaryan
Quoted 23 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. Failing this allocation is not indicative of a bug, so remove the warning.

---
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 | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
mm/slub.c +0 -0
index dc9e729e1d26..06ab9a558b73 100644
@@ -2102,9 +2102,7 @@ prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p)
 
Quoted 9 lines

mm/slub.c prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p) · line 2105

Quoted 6 lines
mm/slub.c +1 -3
        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))

I thought we agreed to having pr_warn_once() here. Did I miss something?

Quoted 5 lines

I had [1] yesterday but I saw Johannes's mail [2] in and Harry mentioned in [3] that failing to allocate the extension vector can happen during normal operations. So I thought maybe there are more votes for removing it.

I am ok with either pr_warn_once or removing it completely.

Quoted 9 lines

I feel like we should have at least some indication that something went wrong here.

Quoted 2 lines

I guess the question is, is it considered OK to fail here?

Well, it's not ok but not catastrophic either, so warning seems appropriate to me.

Ok, I will wait a couple of days incase someone has any objections and send
https://lore.kernel.org/all/[email protected]/
as v3.

Thanks!

Quoted 4 lines
Quoted 4 lines

[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/
[3] https://lore.kernel.org/all/[email protected]/