]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Ensure that kernel_init_freeable() is not inlined into non __init code
authorVineet Gupta <Vineet.Gupta1@synopsys.com>
Fri, 21 Dec 2012 06:55:44 +0000 (12:25 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Jan 2013 04:48:59 +0000 (20:48 -0800)
commit f80b0c904da93b9ad7db2fd9823dd701932df779 upstream.

Commit d6b2123802d "make sure that we always have a return path from
kernel_execve()" reshuffled kernel_init()/init_post() to ensure that
kernel_execve() has a caller to return to.

It removed __init annotation for kernel_init() and introduced/calls a
new routine kernel_init_freeable(). Latter however is inlined by any
reasonable compiler (ARC gcc 4.4 in this case), causing slight code
bloat.

This patch forces kernel_init_freeable() as noinline reducing the .text

bloat-o-meter vmlinux vmlinux_new
add/remove: 1/0 grow/shrink: 0/1 up/down: 374/-334 (40)
function                        old     new   delta
kernel_init_freeable              -     374    +374 (.init.text)
kernel_init                     628     294    -334 (.text)

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
init/main.c

index e33e09df3cbc61ad11736776ef4138010df1de8e..cd147a9187863b135e59a2d876a2080b62b7d3f1 100644 (file)
@@ -800,7 +800,7 @@ static int run_init_process(const char *init_filename)
        return kernel_execve(init_filename, argv_init, envp_init);
 }
 
-static void __init kernel_init_freeable(void);
+static noinline void __init kernel_init_freeable(void);
 
 static int __ref kernel_init(void *unused)
 {
@@ -844,7 +844,7 @@ static int __ref kernel_init(void *unused)
              "See Linux Documentation/init.txt for guidance.");
 }
 
-static void __init kernel_init_freeable(void)
+static noinline void __init kernel_init_freeable(void)
 {
        /*
         * Wait until kthreadd is all set-up.