Commit f80b0c90 authored by Vineet Gupta's avatar Vineet Gupta Committed by Al Viro

Ensure that kernel_init_freeable() is not inlined into non __init code

Commit d6b21238 "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: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent a49f0d1e
...@@ -802,7 +802,7 @@ static int run_init_process(const char *init_filename) ...@@ -802,7 +802,7 @@ static int run_init_process(const char *init_filename)
(const char __user *const __user *)envp_init); (const char __user *const __user *)envp_init);
} }
static void __init kernel_init_freeable(void); static noinline void __init kernel_init_freeable(void);
static int __ref kernel_init(void *unused) static int __ref kernel_init(void *unused)
{ {
...@@ -845,7 +845,7 @@ static int __ref kernel_init(void *unused) ...@@ -845,7 +845,7 @@ static int __ref kernel_init(void *unused)
"See Linux Documentation/init.txt for guidance."); "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. * Wait until kthreadd is all set-up.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment