diff options
Diffstat (limited to 'init')
| -rw-r--r-- | init/main.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/init/main.c b/init/main.c index b28673087ac0..a490ffecb7b9 100644 --- a/init/main.c +++ b/init/main.c | |||
| @@ -794,11 +794,11 @@ static void run_init_process(const char *init_filename) | |||
| 794 | kernel_execve(init_filename, argv_init, envp_init); | 794 | kernel_execve(init_filename, argv_init, envp_init); |
| 795 | } | 795 | } |
| 796 | 796 | ||
| 797 | /* This is a non __init function. Force it to be noinline otherwise gcc | 797 | static void __init kernel_init_freeable(void); |
| 798 | * makes it inline to init() and it becomes part of init.text section | 798 | |
| 799 | */ | 799 | static int __ref kernel_init(void *unused) |
| 800 | static noinline int init_post(void) | ||
| 801 | { | 800 | { |
| 801 | kernel_init_freeable(); | ||
| 802 | /* need to finish all async __init code before freeing the memory */ | 802 | /* need to finish all async __init code before freeing the memory */ |
| 803 | async_synchronize_full(); | 803 | async_synchronize_full(); |
| 804 | free_initmem(); | 804 | free_initmem(); |
| @@ -835,7 +835,7 @@ static noinline int init_post(void) | |||
| 835 | "See Linux Documentation/init.txt for guidance."); | 835 | "See Linux Documentation/init.txt for guidance."); |
| 836 | } | 836 | } |
| 837 | 837 | ||
| 838 | static int __init kernel_init(void * unused) | 838 | static void __init kernel_init_freeable(void) |
| 839 | { | 839 | { |
| 840 | /* | 840 | /* |
| 841 | * Wait until kthreadd is all set-up. | 841 | * Wait until kthreadd is all set-up. |
| @@ -890,7 +890,4 @@ static int __init kernel_init(void * unused) | |||
| 890 | * we're essentially up and running. Get rid of the | 890 | * we're essentially up and running. Get rid of the |
| 891 | * initmem segments and start the user-mode stuff.. | 891 | * initmem segments and start the user-mode stuff.. |
| 892 | */ | 892 | */ |
| 893 | |||
| 894 | init_post(); | ||
| 895 | return 0; | ||
| 896 | } | 893 | } |
