Skip to contentSkip to conversation

linux-next: build warning in Linus' tree

DISCUSSION Stephen Rothwell 5 participants 8 messages Oct 27, 2016 – Oct 30, 2016 Linux-next tree

lore
Share & tools
lore
#0 lore raw

Hi Linus,

Building your tree, today's linux-next build (powerpc ppc64_defconfig) produced this warning:

mm/memory_hotplug.c: In function 'try_offline_node':
mm/memory_hotplug.c:2120:6: warning: unused variable 'i' [-Wunused-variable]

 int i;
     ^

Introduced by commit

9dcb8b685fc3 ("mm: remove per-zone hashtable of bitlock waitqueues")

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw
Quoted 4 lines · Stephen Rothwell

Building your tree, today's linux-next build (powerpc ppc64_defconfig) produced this warning:

Quoted 8 lines

mm/memory_hotplug.c: In function 'try_offline_node':
mm/memory_hotplug.c:2120:6: warning: unused variable 'i' [-Wunused-variable]

 int i;
     ^

Introduced by commit

9dcb8b685fc3 ("mm: remove per-zone hashtable of bitlock waitqueues")

Strange. I wonder why I didn't see that warning. Not with allmodconfig, and not with my normal build.

[ Looks around ]

Hmm. Apparently "allmodconfig" doesn't actually enable memory hotplug. And the reason is that allmodconfig enables KASAN, which then disables MEMORY_HOTPLUG.

I wonder if we should make KASAN depend on !COMPILE_TEST, because it does seem to disable a lot of build-time testing.

Oh well. I'll remove the stupid unused variable, thanks for the heads-up.

Linus

#2 lore raw
Quoted 3 lines · Linus Torvalds

I wonder if we should make KASAN depend on !COMPILE_TEST, because it does seem to disable a lot of build-time testing.

Actually, we should probably just make the MEMORY_HOTPLUG dependency be

        depends on COMPILE_TEST || !KASAN

since the memory-hotplug code should still *build* with KASAN, it just doesn't work. That's exactly what the COMPILE_TEST config option is there for - to get build coverage even for things that aren't necessarily sane to run.

I'll do that, to get my build coverage up. I really expected my allmodconfig builds to verify that I had removed the per-zone waitqueue code completely, and I'm happy that the breakage was apparently limited to that unused variable..

In the meantime, thanks for noticing and letting me know.

Linus

#3 lore raw
Quoted 9 lines · Linus Torvalds
Quoted 3 lines · Linus Torvalds

I wonder if we should make KASAN depend on !COMPILE_TEST, because it does seem to disable a lot of build-time testing.

Actually, we should probably just make the MEMORY_HOTPLUG dependency be

        depends on COMPILE_TEST || !KASAN

Maybe we could just reverse the MEMORY_HOTPLUG->!KASAN dependency to make it KASAN->!MEMORY_HOTPLUG?

Is it at all correct that allmodconfig enables KASAN? If/when we have other compiler-based tools, which of them will allmodconfig pick?

Quoted 13 lines

since the memory-hotplug code should still *build* with KASAN, it just doesn't work. That's exactly what the COMPILE_TEST config option is there for - to get build coverage even for things that aren't necessarily sane to run.

I'll do that, to get my build coverage up. I really expected my allmodconfig builds to verify that I had removed the per-zone waitqueue code completely, and I'm happy that the breakage was apparently limited to that unused variable..

In the meantime, thanks for noticing and letting me know.

Linus

Signature · 10 lines
Alexander Potapenko
Software Engineer

Google Germany GmbH
Erika-Mann-Straße, 33
80636 München

Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
#4 lore raw
Quoted 3 lines · Alexander Potapenko

Maybe we could just reverse the MEMORY_HOTPLUG->!KASAN dependency to make it KASAN->!MEMORY_HOTPLUG?

Yes, that was my initial approach too, but then I decided that I'd rather build-test both together anyway. Since I can. So that just gets me the best of both worlds.

We've had issues like this before, and "make allmodconfig" will never enable _everything_ (ie you always have to make some choices that will disable other cases, if only for reasons like SLUB-vs-SLAB etc).

But in general the more coverage I get from build testing (without having to do lots and lots of builds - that's what the build farms are for after I have pushed things out), the better.

Linus

#5 lore raw
In reply to Linus Torvalds

Hi Linus,

Quoted 2 lines · On Thu, 27 Oct 2016 16:01:22 -0700 Linus Torvalds…

In the meantime, thanks for noticing and letting me know.

It was pointed out by the extra checking you asked me to add in order to easier detect new warnings for code added to linux-next :-)

Signature · 2 lines
Cheers,
Stephen Rothwell
#6 lore raw
In reply to Linus Torvalds

Hi Linus,

Quoted 6 lines · Linus Torvalds
Quoted 3 lines · Linus Torvalds

I wonder if we should make KASAN depend on !COMPILE_TEST, because it does seem to disable a lot of build-time testing.

Quoted 8 lines

Actually, we should probably just make the MEMORY_HOTPLUG dependency be

        depends on COMPILE_TEST || !KASAN

since the memory-hotplug code should still *build* with KASAN, it just doesn't work. That's exactly what the COMPILE_TEST config option is there for - to get build coverage even for things that aren't necessarily sane to run.

In what way does it not work? Does it crash? People do run COMPILE_TEST=y/allmodconfig kernels.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#7 lore raw
Quoted 12 lines · Geert Uytterhoeven

Hi Linus,

Quoted 8 lines · Linus Torvalds
Quoted 3 lines · Linus Torvalds

I wonder if we should make KASAN depend on !COMPILE_TEST, because it does seem to disable a lot of build-time testing.

Actually, we should probably just make the MEMORY_HOTPLUG dependency be

Quoted 8 lines
Quoted 6 lines
        depends on COMPILE_TEST || !KASAN

since the memory-hotplug code should still *build* with KASAN, it just doesn't work. That's exactly what the COMPILE_TEST config option is there for - to get build coverage even for things that aren't necessarily sane to run.

In what way does it not work? Does it crash?

It doesn't crash, it will fail to online hotpluged memory.
Originally, we didn't have build-time dependency at all.
It appeared quite recently in 1e185736d214("mm: disable CONFIG_MEMORY_HOTPLUG when KASAN is enabled")

Quoted 13 lines

People do run COMPILE_TEST=y/allmodconfig kernels.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds