[Bug 1177403] New: Impact of DEBUG_SECTION_MISMATCH
![](https://seccdn.libravatar.org/avatar/a895f78a81a109471893519443e4d933.jpg?s=120&d=mm&r=g)
https://bugzilla.suse.com/show_bug.cgi?id=1177403 Bug ID: 1177403 Summary: Impact of DEBUG_SECTION_MISMATCH Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Kernel Assignee: kernel-performance-bugs@suse.de Reporter: jslaby@suse.com QA Contact: qa-bugs@suse.de CC: jslaby@suse.com, lpechacek@suse.com, mbenes@suse.com, nstange@suse.com, petr.vorel@suse.com, pmladek@suse.com Found By: --- Blocker: --- +++ This bug was initially created as a clone of Bug #1176907 +++ We enable DEBUG_SECTION_MISMATCH in our kernels to find potential problems with section mismatches: $ git grep CONFIG_DEBUG_SECTION_MISMATCH `git branch -rl 'origin/[So][Lp][Ee]*[0-9]' 'origin/[ms][at][sa]*'` -- config/x86_64/default|sort origin/master:config/x86_64/default:CONFIG_DEBUG_SECTION_MISMATCH=y origin/openSUSE-15.1:config/x86_64/default:CONFIG_DEBUG_SECTION_MISMATCH=y origin/openSUSE-15.2:config/x86_64/default:CONFIG_DEBUG_SECTION_MISMATCH=y origin/SLE12-SP4:config/x86_64/default:CONFIG_DEBUG_SECTION_MISMATCH=y origin/SLE12-SP5:config/x86_64/default:CONFIG_DEBUG_SECTION_MISMATCH=y origin/SLE15-SP1:config/x86_64/default:CONFIG_DEBUG_SECTION_MISMATCH=y origin/SLE15-SP2:config/x86_64/default:CONFIG_DEBUG_SECTION_MISMATCH=y origin/SLE15-SP3:config/x86_64/default:CONFIG_DEBUG_SECTION_MISMATCH=y origin/stable:config/x86_64/default:CONFIG_DEBUG_SECTION_MISMATCH=y It turned out that DEBUG_SECTION_MISMATCH disables inlining of some functions by -fno-inline-functions-called-once. Makefile says: # We trigger additional mismatches with less inlining ifdef CONFIG_DEBUG_SECTION_MISMATCH KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once) endif There are only few defconfigs to enable the option in the (upstream) tree: $ git grep DEBUG_SECTION_MISMATCH arch/ arch/arc/configs/tb10x_defconfig:CONFIG_DEBUG_SECTION_MISMATCH=y arch/arm/configs/prima2_defconfig:CONFIG_DEBUG_SECTION_MISMATCH=y arch/nds32/configs/defconfig:CONFIG_DEBUG_SECTION_MISMATCH=y arch/s390/configs/debug_defconfig:CONFIG_DEBUG_SECTION_MISMATCH=y arch/s390/configs/defconfig:CONFIG_DEBUG_SECTION_MISMATCH=y defconfig vmlinux is by 2M larger with DEBUG_SECTION_MISMATCH=y: -rwxr-xr-x 1 jslaby users 57M Oct 7 08:10 ../def-dis/vmlinux -rwxr-xr-x 1 jslaby users 59M Oct 7 08:10 ../def-en/vmlinux The question is what's the performance impact of the option? Performance team, could you do some quick measurements? Thanks. -- You are receiving this mail because: You are on the CC list for the bug.
![](https://seccdn.libravatar.org/avatar/a895f78a81a109471893519443e4d933.jpg?s=120&d=mm&r=g)
https://bugzilla.suse.com/show_bug.cgi?id=1177403
https://bugzilla.suse.com/show_bug.cgi?id=1177403#c1
--- Comment #1 from Jiri Slaby
![](https://seccdn.libravatar.org/avatar/a895f78a81a109471893519443e4d933.jpg?s=120&d=mm&r=g)
https://bugzilla.suse.com/show_bug.cgi?id=1177403
https://bugzilla.suse.com/show_bug.cgi?id=1177403#c2
Mel Gorman
![](https://seccdn.libravatar.org/avatar/a895f78a81a109471893519443e4d933.jpg?s=120&d=mm&r=g)
https://bugzilla.suse.com/show_bug.cgi?id=1177403
https://bugzilla.suse.com/show_bug.cgi?id=1177403#c3
Jiri Slaby
One more note: I would personally disable the option in all flavours except -debug.
(In reply to Mel Gorman from comment #2)
The real qusetion is -- why enable this at all for a production build? It would make more sense to build with this option when considering whether a branch should be merged or not and mail when new warnings are added due to section mismatches.
Or this, sure. Michal, could DEBUG_SECTION_MISMATCH be set to y during build tests, please? Then I would disable it in all our maintained non-ltss configs. -- You are receiving this mail because: You are on the CC list for the bug.
![](https://seccdn.libravatar.org/avatar/a895f78a81a109471893519443e4d933.jpg?s=120&d=mm&r=g)
https://bugzilla.suse.com/show_bug.cgi?id=1177403
https://bugzilla.suse.com/show_bug.cgi?id=1177403#c4
--- Comment #4 from Michal Suchanek
![](https://seccdn.libravatar.org/avatar/a895f78a81a109471893519443e4d933.jpg?s=120&d=mm&r=g)
https://bugzilla.suse.com/show_bug.cgi?id=1177403
https://bugzilla.suse.com/show_bug.cgi?id=1177403#c7
--- Comment #7 from Mel Gorman
It produces only warnings and these go to /dev/null on the test builds
So what was the final outcome here? I see it's still enabled but if the warnings are going to /dev/null, is there any point having it enabled at all? -- You are receiving this mail because: You are on the CC list for the bug.
![](https://seccdn.libravatar.org/avatar/a895f78a81a109471893519443e4d933.jpg?s=120&d=mm&r=g)
https://bugzilla.suse.com/show_bug.cgi?id=1177403
https://bugzilla.suse.com/show_bug.cgi?id=1177403#c8
--- Comment #8 from Mel Gorman
(In reply to Michal Suchanek from comment #4)
It produces only warnings and these go to /dev/null on the test builds
So what was the final outcome here? I see it's still enabled but if the warnings are going to /dev/null, is there any point having it enabled at all?
Ok, no answer. In that case, is there an objection to disabling this option in master and SLE 15 SP3 configs? -- You are receiving this mail because: You are on the CC list for the bug.
![](https://seccdn.libravatar.org/avatar/a895f78a81a109471893519443e4d933.jpg?s=120&d=mm&r=g)
https://bugzilla.suse.com/show_bug.cgi?id=1177403
https://bugzilla.suse.com/show_bug.cgi?id=1177403#c9
Michal Suchanek
![](https://seccdn.libravatar.org/avatar/a895f78a81a109471893519443e4d933.jpg?s=120&d=mm&r=g)
https://bugzilla.suse.com/show_bug.cgi?id=1177403
https://bugzilla.suse.com/show_bug.cgi?id=1177403#c10
--- Comment #10 from Mel Gorman
It is non-trivial to make use of the warnings. There are others that we can make use of but don't currently.
I'm reading that as the "information is not used"
It would help to know what they look like, too.
Random example WARNING: vmlinux.o(.text+0x8c68): Section mismatch in reference from the variable start_here_common to the function .init.text:start_kernel() The function start_here_common() references the function __init start_kernel(). This is often because start_here_common lacks a __init annotation or the annotation of start_kernel is wrong. Mostly these are useful during development time only when adding code that uses __init annotation. This can come up during development when adding code related to hotplug which accidentally calls __init functions at runtime when the __init code has already been freed in the latter parts of boot.
However, I see enabling them in kbuild as low priority.
So are you ok if I disable them? It's an option that should be set only during development time, in production, it's useless and as the original summaries states, it affects what functions get inlined. -- You are receiving this mail because: You are on the CC list for the bug.
![](https://seccdn.libravatar.org/avatar/a895f78a81a109471893519443e4d933.jpg?s=120&d=mm&r=g)
https://bugzilla.suse.com/show_bug.cgi?id=1177403
https://bugzilla.suse.com/show_bug.cgi?id=1177403#c11
--- Comment #11 from Michal Suchanek
![](https://seccdn.libravatar.org/avatar/a895f78a81a109471893519443e4d933.jpg?s=120&d=mm&r=g)
https://bugzilla.suse.com/show_bug.cgi?id=1177403
https://bugzilla.suse.com/show_bug.cgi?id=1177403#c12
--- Comment #12 from Mel Gorman
So it's these warnings. I check them in the OBS logs from time to time.
On POWER the hotplug functions change all the time :/
I could adjust the script to pick them out from OBS logs. Getting them from the kbuild test results is not trivial ATM.
So given that this has a runtime impact due to functions not being inlined that *should* be inlined, is it worth enabling it in production? The ideal really would be that this is checked as a debugging step and warned on merging to a for-next branch if new section warnings shows up instead of having a runtime impact. -- You are receiving this mail because: You are on the CC list for the bug.
![](https://seccdn.libravatar.org/avatar/a895f78a81a109471893519443e4d933.jpg?s=120&d=mm&r=g)
https://bugzilla.suse.com/show_bug.cgi?id=1177403
https://bugzilla.suse.com/show_bug.cgi?id=1177403#c13
--- Comment #13 from Michal Suchanek
![](https://seccdn.libravatar.org/avatar/a895f78a81a109471893519443e4d933.jpg?s=120&d=mm&r=g)
https://bugzilla.suse.com/show_bug.cgi?id=1177403
https://bugzilla.suse.com/show_bug.cgi?id=1177403#c14
Mel Gorman
Ok, let's drop it, and add the config in kbuild tests once they can extract the warnings.
Thanks. I pushed the change to master and SLE 15 SP3. master has already been updated and SLE 15 SP3 will get updated eventually so I think we can close this now! -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@suse.com