]> Git Repo - linux.git/commitdiff
smpboot: Mark idle_init() as __always_inlined to work around aggressive compiler...
authorIngo Molnar <[email protected]>
Sun, 11 Jul 2021 06:26:45 +0000 (08:26 +0200)
committerIngo Molnar <[email protected]>
Tue, 13 Jul 2021 04:32:59 +0000 (06:32 +0200)
While this function is a static inline, and is only used once in
local scope, certain Kconfig variations may cause it to be compiled
as a standalone function:

  89231bf0 <idle_init>:
  89231bf0:       83 05 60 d9 45 89 01    addl   $0x1,0x8945d960
  89231bf7:       55                      push   %ebp

Resulting in this build failure:

  WARNING: modpost: vmlinux.o(.text.unlikely+0x7fd5): Section mismatch in reference from the function idle_init() to the function .init.text:fork_idle()
  The function idle_init() references
  the function __init fork_idle().
  This is often because idle_init lacks a __init
  annotation or the annotation of fork_idle is wrong.
  ERROR: modpost: Section mismatches detected.

Certain USBSAN options x86-32 builds with CONFIG_CC_OPTIMIZE_FOR_SIZE=y
seem to be causing this.

So mark idle_init() as __always_inline to work around this compiler
bug/feature.

Signed-off-by: Ingo Molnar <[email protected]>
kernel/smpboot.c

index e4163042c4d6658d4fcf192bfcac04e8c2ddb5cf..21b7953f824215608bd786fd8fadff92e6c057c2 100644 (file)
@@ -47,7 +47,7 @@ void __init idle_thread_set_boot_cpu(void)
  *
  * Creates the thread if it does not exist.
  */
-static inline void idle_init(unsigned int cpu)
+static inline void __always_inline idle_init(unsigned int cpu)
 {
        struct task_struct *tsk = per_cpu(idle_threads, cpu);
 
This page took 0.054783 seconds and 4 git commands to generate.