2022-11-25 02:34:11

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build failure after merge of the slab tree

Hi all,

After merging the slab tree, today's linux-next build (x86_64
allmodconfig) failed like this:

mm/slub.c:965:13: error: 'freelist_corrupted' defined but not used [-Werror=unused-function]
965 | static bool freelist_corrupted(struct kmem_cache *s, struct slab *slab,
| ^~~~~~~~~~~~~~~~~~

Caused by commit

f6e94ad44e77 ("mm, slub: remove percpu slabs with CONFIG_SLUB_TINY")

I have used the slab tree from next-20221123 again.

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2022-11-25 08:53:49

by Vlastimil Babka

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the slab tree

On 11/25/22 02:49, Stephen Rothwell wrote:
> Hi all,
>
> After merging the slab tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
>
> mm/slub.c:965:13: error: 'freelist_corrupted' defined but not used [-Werror=unused-function]
> 965 | static bool freelist_corrupted(struct kmem_cache *s, struct slab *slab,
> | ^~~~~~~~~~~~~~~~~~
>
> Caused by commit
>
> f6e94ad44e77 ("mm, slub: remove percpu slabs with CONFIG_SLUB_TINY")
>
> I have used the slab tree from next-20221123 again.

I tried the allmodconfig and:

WARNING: unmet direct dependencies detected for SLUB_DEBUG
Depends on [n]: SLUB [=y] && SYSFS [=y] && !SLUB_TINY [=y]
Selected by [y]:
- KASAN_GENERIC [=y] && <choice> && HAVE_ARCH_KASAN [=y] && CC_HAS_KASAN_GENERIC [=y] && CC_HAS_WORKING_NOSANITIZE_ADDRESS [=y] && SLUB [=y]

Wasn't aware it's possible that it will leave a combination of configs
that's not allowed and just warn about it. Oh well.

I'll solve it by:
--- a/lib/Kconfig.kasan
+++ b/lib/Kconfig.kasan
@@ -37,7 +37,7 @@ menuconfig KASAN
(HAVE_ARCH_KASAN_SW_TAGS && CC_HAS_KASAN_SW_TAGS)) && \
CC_HAS_WORKING_NOSANITIZE_ADDRESS) || \
HAVE_ARCH_KASAN_HW_TAGS
- depends on (SLUB && SYSFS) || (SLAB && !DEBUG_SLAB)
+ depends on (SLUB && SYSFS && !SLUB_TINY) || (SLAB && !DEBUG_SLAB)
select STACKDEPOT_ALWAYS_INIT
help
Enables KASAN (Kernel Address Sanitizer) - a dynamic memory safety