[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aDQ85_EeqibtbUR-@hyeyoo>
Date: Mon, 26 May 2025 19:05:27 +0900
From: Harry Yoo <harry.yoo@...cle.com>
To: Usama Arif <usamaarif642@...il.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>, surenb@...gle.com,
hannes@...xchg.org, shakeel.butt@...ux.dev, vlad.wing@...il.com,
linux-mm@...ck.org, kent.overstreet@...ux.dev, cl@...two.org,
rientjes@...gle.com, vbabka@...e.cz, roman.gushchin@...ux.dev,
linux-kernel@...r.kernel.org, kernel-team@...a.com
Subject: Re: [PATCH v3] mm: slub: only warn once when allocating slab obj
extensions fails
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@...il.com>
> Reported-by: Vlad Poenaru <vlad.wing@...il.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@...cle.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
Powered by blists - more mailing lists