linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] mm: slub: only warn once when allocating slab obj extensions fails
@ 2025-05-23 16:52 Usama Arif
  2025-05-23 17:08 ` Shakeel Butt
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Usama Arif @ 2025-05-23 16:52 UTC (permalink / raw)
  To: Andrew Morton, surenb
  Cc: hannes, shakeel.butt, vlad.wing, linux-mm, kent.overstreet, cl,
	rientjes, vbabka, roman.gushchin, harry.yoo, linux-kernel,
	kernel-team, 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 <usamaarif642@gmail.com>
Reported-by: Vlad Poenaru <vlad.wing@gmail.com>
Closes: https://lore.kernel.org/all/17fab2d6-5a74-4573-bcc3-b75951508f0a@gmail.com/
---
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(-)

diff --git a/mm/slub.c b/mm/slub.c
index dc9e729e1d26..36d7c43a6f2a 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -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);
 }
-- 
2.47.1



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

* Re: [PATCH v3] mm: slub: only warn once when allocating slab obj extensions fails
  2025-05-23 16:52 [PATCH v3] mm: slub: only warn once when allocating slab obj extensions fails Usama Arif
@ 2025-05-23 17:08 ` Shakeel Butt
  2025-05-23 17:15 ` SeongJae Park
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Shakeel Butt @ 2025-05-23 17:08 UTC (permalink / raw)
  To: Usama Arif
  Cc: Andrew Morton, surenb, hannes, vlad.wing, linux-mm,
	kent.overstreet, cl, rientjes, vbabka, roman.gushchin, harry.yoo,
	linux-kernel, kernel-team

On Fri, May 23, 2025 at 05:52:40PM +0100, Usama Arif 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 <usamaarif642@gmail.com>
> Reported-by: Vlad Poenaru <vlad.wing@gmail.com>
> Closes: https://lore.kernel.org/all/17fab2d6-5a74-4573-bcc3-b75951508f0a@gmail.com/

Reviewed-by: Shakeel Butt <shakeel.butt@linux.dev>


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

* Re: [PATCH v3] mm: slub: only warn once when allocating slab obj extensions fails
  2025-05-23 16:52 [PATCH v3] mm: slub: only warn once when allocating slab obj extensions fails Usama Arif
  2025-05-23 17:08 ` Shakeel Butt
@ 2025-05-23 17:15 ` SeongJae Park
  2025-05-26  9:33 ` Vlastimil Babka
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: SeongJae Park @ 2025-05-23 17:15 UTC (permalink / raw)
  To: Usama Arif
  Cc: SeongJae Park, Andrew Morton, surenb, hannes, shakeel.butt,
	vlad.wing, linux-mm, kent.overstreet, cl, rientjes, vbabka,
	roman.gushchin, harry.yoo, linux-kernel, kernel-team

On Fri, 23 May 2025 17:52:40 +0100 Usama Arif <usamaarif642@gmail.com> 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 <usamaarif642@gmail.com>
> Reported-by: Vlad Poenaru <vlad.wing@gmail.com>
> Closes: https://lore.kernel.org/all/17fab2d6-5a74-4573-bcc3-b75951508f0a@gmail.com/

Reviewed-by: SeongJae Park <sj@kernel.org>


Thanks,
SJ

[...]


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

* Re: [PATCH v3] mm: slub: only warn once when allocating slab obj extensions fails
  2025-05-23 16:52 [PATCH v3] mm: slub: only warn once when allocating slab obj extensions fails Usama Arif
  2025-05-23 17:08 ` Shakeel Butt
  2025-05-23 17:15 ` SeongJae Park
@ 2025-05-26  9:33 ` Vlastimil Babka
  2025-05-26 10:05 ` Harry Yoo
  2025-06-02 21:57 ` Roman Gushchin
  4 siblings, 0 replies; 7+ messages in thread
From: Vlastimil Babka @ 2025-05-26  9:33 UTC (permalink / raw)
  To: Usama Arif, Andrew Morton, surenb
  Cc: hannes, shakeel.butt, vlad.wing, linux-mm, kent.overstreet, cl,
	rientjes, roman.gushchin, harry.yoo, linux-kernel, kernel-team

On 5/23/25 18:52, Usama Arif 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 <usamaarif642@gmail.com>
> Reported-by: Vlad Poenaru <vlad.wing@gmail.com>
> Closes: https://lore.kernel.org/all/17fab2d6-5a74-4573-bcc3-b75951508f0a@gmail.com/
> ---
> 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(-)
> 
> diff --git a/mm/slub.c b/mm/slub.c
> index dc9e729e1d26..36d7c43a6f2a 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -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;
> +	}
> +

I've removed the extra line locally.

Added to slab/for-next, thanks.

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



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

* Re: [PATCH v3] mm: slub: only warn once when allocating slab obj extensions fails
  2025-05-23 16:52 [PATCH v3] mm: slub: only warn once when allocating slab obj extensions fails Usama Arif
                   ` (2 preceding siblings ...)
  2025-05-26  9:33 ` Vlastimil Babka
@ 2025-05-26 10:05 ` Harry Yoo
  2025-06-02 20:14   ` Suren Baghdasaryan
  2025-06-02 21:57 ` Roman Gushchin
  4 siblings, 1 reply; 7+ messages in thread
From: Harry Yoo @ 2025-05-26 10:05 UTC (permalink / raw)
  To: Usama Arif
  Cc: Andrew Morton, surenb, hannes, shakeel.butt, vlad.wing, linux-mm,
	kent.overstreet, cl, rientjes, vbabka, roman.gushchin,
	linux-kernel, kernel-team

On Fri, May 23, 2025 at 05:52:40PM +0100, Usama Arif 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 <usamaarif642@gmail.com>
> Reported-by: Vlad Poenaru <vlad.wing@gmail.com>
> Closes: https://urldefense.com/v3/__https://lore.kernel.org/all/17fab2d6-5a74-4573-bcc3-b75951508f0a@gmail.com/__;!!ACWV5N9M2RV99hQ!Nv5xX_X4cBQR_HUDO6qfamxI0GEW1eFRCpPj29lANRashIUJDrEWAjU7vlys76FH0voShW07CjpDkzSST46Irg$ 
> ---

Acked-by: Harry Yoo <harry.yoo@oracle.com>

> 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(-)
> 
> diff --git a/mm/slub.c b/mm/slub.c
> index dc9e729e1d26..36d7c43a6f2a 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -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);
>  }
> -- 
> 2.47.1
> 

-- 
Cheers,
Harry / Hyeonggon


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

* Re: [PATCH v3] mm: slub: only warn once when allocating slab obj extensions fails
  2025-05-26 10:05 ` Harry Yoo
@ 2025-06-02 20:14   ` Suren Baghdasaryan
  0 siblings, 0 replies; 7+ messages in thread
From: Suren Baghdasaryan @ 2025-06-02 20:14 UTC (permalink / raw)
  To: Harry Yoo
  Cc: Usama Arif, Andrew Morton, hannes, shakeel.butt, vlad.wing,
	linux-mm, kent.overstreet, cl, rientjes, vbabka, roman.gushchin,
	linux-kernel, kernel-team

On Mon, May 26, 2025 at 3:05 AM Harry Yoo <harry.yoo@oracle.com> wrote:
>
> On Fri, May 23, 2025 at 05:52:40PM +0100, Usama Arif 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 <usamaarif642@gmail.com>
> > Reported-by: Vlad Poenaru <vlad.wing@gmail.com>
> > Closes: https://urldefense.com/v3/__https://lore.kernel.org/all/17fab2d6-5a74-4573-bcc3-b75951508f0a@gmail.com/__;!!ACWV5N9M2RV99hQ!Nv5xX_X4cBQR_HUDO6qfamxI0GEW1eFRCpPj29lANRashIUJDrEWAjU7vlys76FH0voShW07CjpDkzSST46Irg$
> > ---
>
> Acked-by: Harry Yoo <harry.yoo@oracle.com>

Acked-by: Suren Baghdasaryan <surenb@google.com>

>
> > 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(-)
> >
> > diff --git a/mm/slub.c b/mm/slub.c
> > index dc9e729e1d26..36d7c43a6f2a 100644
> > --- a/mm/slub.c
> > +++ b/mm/slub.c
> > @@ -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);
> >  }
> > --
> > 2.47.1
> >
>
> --
> Cheers,
> Harry / Hyeonggon


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

* Re: [PATCH v3] mm: slub: only warn once when allocating slab obj extensions fails
  2025-05-23 16:52 [PATCH v3] mm: slub: only warn once when allocating slab obj extensions fails Usama Arif
                   ` (3 preceding siblings ...)
  2025-05-26 10:05 ` Harry Yoo
@ 2025-06-02 21:57 ` Roman Gushchin
  4 siblings, 0 replies; 7+ messages in thread
From: Roman Gushchin @ 2025-06-02 21:57 UTC (permalink / raw)
  To: Usama Arif
  Cc: Andrew Morton, surenb, hannes, shakeel.butt, vlad.wing, linux-mm,
	kent.overstreet, cl, rientjes, vbabka, harry.yoo, linux-kernel,
	kernel-team

Usama Arif <usamaarif642@gmail.com> writes:

> 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 <usamaarif642@gmail.com>
> Reported-by: Vlad Poenaru <vlad.wing@gmail.com>
> Closes: https://lore.kernel.org/all/17fab2d6-5a74-4573-bcc3-b75951508f0a@gmail.com/

Acked-by: Roman Gushchin <roman.gushchin@linux.dev>

Thanks!


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

end of thread, other threads:[~2025-06-02 21:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-23 16:52 [PATCH v3] mm: slub: only warn once when allocating slab obj extensions fails Usama Arif
2025-05-23 17:08 ` Shakeel Butt
2025-05-23 17:15 ` SeongJae Park
2025-05-26  9:33 ` Vlastimil Babka
2025-05-26 10:05 ` Harry Yoo
2025-06-02 20:14   ` Suren Baghdasaryan
2025-06-02 21:57 ` Roman Gushchin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).