From: Koichiro Den <koichiro.den@gmail.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Vlastimil Babka <vbabka@suse.cz>,
Matthew Wilcox <willy@infradead.org>,
Peter Collingbourne <pcc@google.com>,
cl@linux.com, penberg@kernel.org, rientjes@google.com,
iamjoonsoo.kim@lge.com, akpm@linux-foundation.org,
roman.gushchin@linux.dev, 42.hyeyoo@gmail.com, kees@kernel.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] mm/slab: fix warning caused by duplicate kmem_cache creation in kmem_buckets_create
Date: Tue, 5 Nov 2024 11:30:51 +0900 [thread overview]
Message-ID: <f6suzwxd6euy5drff5ur7xykmmimyd4g6s7bfu4j5zhimvndra@bjzvy2jmeq3h> (raw)
In-Reply-To: <ZylKlUqHkzLNwEHA@arm.com>
On Mon, Nov 04, 2024 at 10:28:37PM +0000, Catalin Marinas wrote:
> On Mon, Nov 04, 2024 at 10:22:37PM +0000, Catalin Marinas wrote:
> > On Mon, Nov 04, 2024 at 07:16:20PM +0100, Vlastimil Babka wrote:
> > > On 11/4/24 19:00, Matthew Wilcox wrote:
> > > > On Tue, Nov 05, 2024 at 12:08:37AM +0900, Koichiro Den wrote:
> > > >> Commit b035f5a6d852 ("mm: slab: reduce the kmalloc() minimum alignment
> > > >> if DMA bouncing possible") reduced ARCH_KMALLOC_MINALIGN to 8 on arm64.
> > > >> However, with KASAN_HW_TAGS enabled, arch_slab_minalign() becomes 16.
> > > >> This causes kmalloc_caches[*][8] to be aliased to kmalloc_caches[*][16],
> > > >> resulting in kmem_buckets_create() attempting to create a kmem_cache for
> > > >> size 16 twice. This duplication triggers warnings on boot:
> > > >
> > > > Wouldn't this be easier?
> > >
> > > They wanted it to depend on actual HW capability / kernel parameter, see
> > > d949a8155d13 ("mm: make minimum slab alignment a runtime property")
> > >
> > > Also Catalin's commit referenced above was part of the series that made the
> > > alignment more dynamic for other cases IIRC. So I doubt we can simply reduce
> > > it back to a build-time constant.
> >
> > I principle, I wouldn't reduce it back to constant though the 8 vs 16
> > difference is not significant. It matter if one enables KASAN_HW_TAGS
> > and wants to run it on hardware without MTE, getting the *-8 caches
> > back.
> >
> > That said, I haven't managed to trigger this warning yet. Do I need
> > other config options than KASAN_HW_TAGS and DEBUG_VM?
>
> Ah, I was missing SLAB_BUCKETS. I'll have a look tomorrow.
>
> --
> Catalin
Thank you for reviewing. I just sent v2 so please take a look at that
instead.
v2: https://lore.kernel.org/linux-mm/20241105022747.2819151-1-koichiro.den@gmail.com/
prev parent reply other threads:[~2024-11-05 2:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-04 15:08 Koichiro Den
2024-11-04 15:40 ` Vlastimil Babka
2024-11-04 21:32 ` Kees Cook
2024-11-05 2:13 ` Koichiro Den
2024-11-04 18:00 ` Matthew Wilcox
2024-11-04 18:16 ` Vlastimil Babka
2024-11-04 22:22 ` Catalin Marinas
2024-11-04 22:28 ` Catalin Marinas
2024-11-05 2:30 ` Koichiro Den [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f6suzwxd6euy5drff5ur7xykmmimyd4g6s7bfu4j5zhimvndra@bjzvy2jmeq3h \
--to=koichiro.den@gmail.com \
--cc=42.hyeyoo@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=catalin.marinas@arm.com \
--cc=cl@linux.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=pcc@google.com \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=stable@vger.kernel.org \
--cc=vbabka@suse.cz \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox