aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig38
-rw-r--r--init/do_mounts_initrd.c7
-rw-r--r--init/main.c75
3 files changed, 46 insertions, 74 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 5cff9a980c39..2de5b1cbadd9 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -320,13 +320,17 @@ config AUDITSYSCALL
320 help 320 help
321 Enable low-overhead system-call auditing infrastructure that 321 Enable low-overhead system-call auditing infrastructure that
322 can be used independently or with another kernel subsystem, 322 can be used independently or with another kernel subsystem,
323 such as SELinux. To use audit's filesystem watch feature, please 323 such as SELinux.
324 ensure that INOTIFY is configured. 324
325config AUDIT_WATCH
326 def_bool y
327 depends on AUDITSYSCALL
328 select FSNOTIFY
325 329
326config AUDIT_TREE 330config AUDIT_TREE
327 def_bool y 331 def_bool y
328 depends on AUDITSYSCALL 332 depends on AUDITSYSCALL
329 select INOTIFY 333 select FSNOTIFY
330 334
331menu "RCU Subsystem" 335menu "RCU Subsystem"
332 336
@@ -573,8 +577,8 @@ config CGROUP_MEM_RES_CTLR
573 could in turn add some fork/exit overhead. 577 could in turn add some fork/exit overhead.
574 578
575config CGROUP_MEM_RES_CTLR_SWAP 579config CGROUP_MEM_RES_CTLR_SWAP
576 bool "Memory Resource Controller Swap Extension(EXPERIMENTAL)" 580 bool "Memory Resource Controller Swap Extension"
577 depends on CGROUP_MEM_RES_CTLR && SWAP && EXPERIMENTAL 581 depends on CGROUP_MEM_RES_CTLR && SWAP
578 help 582 help
579 Add swap management feature to memory resource controller. When you 583 Add swap management feature to memory resource controller. When you
580 enable this, you can limit mem+swap usage per cgroup. In other words, 584 enable this, you can limit mem+swap usage per cgroup. In other words,
@@ -1143,30 +1147,6 @@ config TRACEPOINTS
1143 1147
1144source "arch/Kconfig" 1148source "arch/Kconfig"
1145 1149
1146config SLOW_WORK
1147 default n
1148 bool
1149 help
1150 The slow work thread pool provides a number of dynamically allocated
1151 threads that can be used by the kernel to perform operations that
1152 take a relatively long time.
1153
1154 An example of this would be CacheFiles doing a path lookup followed
1155 by a series of mkdirs and a create call, all of which have to touch
1156 disk.
1157
1158 See Documentation/slow-work.txt.
1159
1160config SLOW_WORK_DEBUG
1161 bool "Slow work debugging through debugfs"
1162 default n
1163 depends on SLOW_WORK && DEBUG_FS
1164 help
1165 Display the contents of the slow work run queue through debugfs,
1166 including items currently executing.
1167
1168 See Documentation/slow-work.txt.
1169
1170endmenu # General setup 1150endmenu # General setup
1171 1151
1172config HAVE_GENERIC_DMA_COHERENT 1152config HAVE_GENERIC_DMA_COHERENT
diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c
index 2b108538d0d9..3098a38f3ae1 100644
--- a/init/do_mounts_initrd.c
+++ b/init/do_mounts_initrd.c
@@ -24,10 +24,11 @@ static int __init no_initrd(char *str)
24 24
25__setup("noinitrd", no_initrd); 25__setup("noinitrd", no_initrd);
26 26
27static int __init do_linuxrc(void * shell) 27static int __init do_linuxrc(void *_shell)
28{ 28{
29 static char *argv[] = { "linuxrc", NULL, }; 29 static const char *argv[] = { "linuxrc", NULL, };
30 extern char * envp_init[]; 30 extern const char *envp_init[];
31 const char *shell = _shell;
31 32
32 sys_close(old_fd);sys_close(root_fd); 33 sys_close(old_fd);sys_close(root_fd);
33 sys_setsid(); 34 sys_setsid();
diff --git a/init/main.c b/init/main.c
index a42fdf4aeba9..94ab488039aa 100644
--- a/init/main.c
+++ b/init/main.c
@@ -32,7 +32,6 @@
32#include <linux/start_kernel.h> 32#include <linux/start_kernel.h>
33#include <linux/security.h> 33#include <linux/security.h>
34#include <linux/smp.h> 34#include <linux/smp.h>
35#include <linux/workqueue.h>
36#include <linux/profile.h> 35#include <linux/profile.h>
37#include <linux/rcupdate.h> 36#include <linux/rcupdate.h>
38#include <linux/moduleparam.h> 37#include <linux/moduleparam.h>
@@ -66,11 +65,9 @@
66#include <linux/ftrace.h> 65#include <linux/ftrace.h>
67#include <linux/async.h> 66#include <linux/async.h>
68#include <linux/kmemcheck.h> 67#include <linux/kmemcheck.h>
69#include <linux/kmemtrace.h>
70#include <linux/sfi.h> 68#include <linux/sfi.h>
71#include <linux/shmem_fs.h> 69#include <linux/shmem_fs.h>
72#include <linux/slab.h> 70#include <linux/slab.h>
73#include <trace/boot.h>
74 71
75#include <asm/io.h> 72#include <asm/io.h>
76#include <asm/bugs.h> 73#include <asm/bugs.h>
@@ -200,15 +197,15 @@ static int __init set_reset_devices(char *str)
200 197
201__setup("reset_devices", set_reset_devices); 198__setup("reset_devices", set_reset_devices);
202 199
203static char * argv_init[MAX_INIT_ARGS+2] = { "init", NULL, }; 200static const char * argv_init[MAX_INIT_ARGS+2] = { "init", NULL, };
204char * envp_init[MAX_INIT_ENVS+2] = { "HOME=/", "TERM=linux", NULL, }; 201const char * envp_init[MAX_INIT_ENVS+2] = { "HOME=/", "TERM=linux", NULL, };
205static const char *panic_later, *panic_param; 202static const char *panic_later, *panic_param;
206 203
207extern struct obs_kernel_param __setup_start[], __setup_end[]; 204extern const struct obs_kernel_param __setup_start[], __setup_end[];
208 205
209static int __init obsolete_checksetup(char *line) 206static int __init obsolete_checksetup(char *line)
210{ 207{
211 struct obs_kernel_param *p; 208 const struct obs_kernel_param *p;
212 int had_early_param = 0; 209 int had_early_param = 0;
213 210
214 p = __setup_start; 211 p = __setup_start;
@@ -444,7 +441,6 @@ static noinline void __init_refok rest_init(void)
444 kthreadd_task = find_task_by_pid_ns(pid, &init_pid_ns); 441 kthreadd_task = find_task_by_pid_ns(pid, &init_pid_ns);
445 rcu_read_unlock(); 442 rcu_read_unlock();
446 complete(&kthreadd_done); 443 complete(&kthreadd_done);
447 unlock_kernel();
448 444
449 /* 445 /*
450 * The boot idle thread must execute schedule() 446 * The boot idle thread must execute schedule()
@@ -462,7 +458,7 @@ static noinline void __init_refok rest_init(void)
462/* Check for early params. */ 458/* Check for early params. */
463static int __init do_early_param(char *param, char *val) 459static int __init do_early_param(char *param, char *val)
464{ 460{
465 struct obs_kernel_param *p; 461 const struct obs_kernel_param *p;
466 462
467 for (p = __setup_start; p < __setup_end; p++) { 463 for (p = __setup_start; p < __setup_end; p++) {
468 if ((p->early && strcmp(param, p->str) == 0) || 464 if ((p->early && strcmp(param, p->str) == 0) ||
@@ -532,6 +528,7 @@ static void __init mm_init(void)
532 page_cgroup_init_flatmem(); 528 page_cgroup_init_flatmem();
533 mem_init(); 529 mem_init();
534 kmem_cache_init(); 530 kmem_cache_init();
531 percpu_init_late();
535 pgtable_cache_init(); 532 pgtable_cache_init();
536 vmalloc_init(); 533 vmalloc_init();
537} 534}
@@ -539,7 +536,7 @@ static void __init mm_init(void)
539asmlinkage void __init start_kernel(void) 536asmlinkage void __init start_kernel(void)
540{ 537{
541 char * command_line; 538 char * command_line;
542 extern struct kernel_param __start___param[], __stop___param[]; 539 extern const struct kernel_param __start___param[], __stop___param[];
543 540
544 smp_setup_processor_id(); 541 smp_setup_processor_id();
545 542
@@ -565,7 +562,6 @@ asmlinkage void __init start_kernel(void)
565 * Interrupts are still disabled. Do necessary setups, then 562 * Interrupts are still disabled. Do necessary setups, then
566 * enable them 563 * enable them
567 */ 564 */
568 lock_kernel();
569 tick_init(); 565 tick_init();
570 boot_cpu_init(); 566 boot_cpu_init();
571 page_address_init(); 567 page_address_init();
@@ -663,7 +659,6 @@ asmlinkage void __init start_kernel(void)
663#endif 659#endif
664 page_cgroup_init(); 660 page_cgroup_init();
665 enable_debug_pagealloc(); 661 enable_debug_pagealloc();
666 kmemtrace_init();
667 kmemleak_init(); 662 kmemleak_init();
668 debug_objects_mem_init(); 663 debug_objects_mem_init();
669 idr_init_cache(); 664 idr_init_cache();
@@ -725,38 +720,39 @@ int initcall_debug;
725core_param(initcall_debug, initcall_debug, bool, 0644); 720core_param(initcall_debug, initcall_debug, bool, 0644);
726 721
727static char msgbuf[64]; 722static char msgbuf[64];
728static struct boot_trace_call call;
729static struct boot_trace_ret ret;
730 723
731int do_one_initcall(initcall_t fn) 724static int __init_or_module do_one_initcall_debug(initcall_t fn)
732{ 725{
733 int count = preempt_count();
734 ktime_t calltime, delta, rettime; 726 ktime_t calltime, delta, rettime;
727 unsigned long long duration;
728 int ret;
735 729
736 if (initcall_debug) { 730 printk(KERN_DEBUG "calling %pF @ %i\n", fn, task_pid_nr(current));
737 call.caller = task_pid_nr(current); 731 calltime = ktime_get();
738 printk("calling %pF @ %i\n", fn, call.caller); 732 ret = fn();
739 calltime = ktime_get(); 733 rettime = ktime_get();
740 trace_boot_call(&call, fn); 734 delta = ktime_sub(rettime, calltime);
741 enable_boot_trace(); 735 duration = (unsigned long long) ktime_to_ns(delta) >> 10;
742 } 736 printk(KERN_DEBUG "initcall %pF returned %d after %lld usecs\n", fn,
737 ret, duration);
743 738
744 ret.result = fn(); 739 return ret;
740}
745 741
746 if (initcall_debug) { 742int __init_or_module do_one_initcall(initcall_t fn)
747 disable_boot_trace(); 743{
748 rettime = ktime_get(); 744 int count = preempt_count();
749 delta = ktime_sub(rettime, calltime); 745 int ret;
750 ret.duration = (unsigned long long) ktime_to_ns(delta) >> 10; 746
751 trace_boot_ret(&ret, fn); 747 if (initcall_debug)
752 printk("initcall %pF returned %d after %Ld usecs\n", fn, 748 ret = do_one_initcall_debug(fn);
753 ret.result, ret.duration); 749 else
754 } 750 ret = fn();
755 751
756 msgbuf[0] = 0; 752 msgbuf[0] = 0;
757 753
758 if (ret.result && ret.result != -ENODEV && initcall_debug) 754 if (ret && ret != -ENODEV && initcall_debug)
759 sprintf(msgbuf, "error code %d ", ret.result); 755 sprintf(msgbuf, "error code %d ", ret);
760 756
761 if (preempt_count() != count) { 757 if (preempt_count() != count) {
762 strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf)); 758 strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf));
@@ -770,7 +766,7 @@ int do_one_initcall(initcall_t fn)
770 printk("initcall %pF returned with %s\n", fn, msgbuf); 766 printk("initcall %pF returned with %s\n", fn, msgbuf);
771 } 767 }
772 768
773 return ret.result; 769 return ret;
774} 770}
775 771
776 772
@@ -796,7 +792,6 @@ static void __init do_initcalls(void)
796 */ 792 */
797static void __init do_basic_setup(void) 793static void __init do_basic_setup(void)
798{ 794{
799 init_workqueues();
800 cpuset_init_smp(); 795 cpuset_init_smp();
801 usermodehelper_init(); 796 usermodehelper_init();
802 init_tmpfs(); 797 init_tmpfs();
@@ -814,7 +809,7 @@ static void __init do_pre_smp_initcalls(void)
814 do_one_initcall(*fn); 809 do_one_initcall(*fn);
815} 810}
816 811
817static void run_init_process(char *init_filename) 812static void run_init_process(const char *init_filename)
818{ 813{
819 argv_init[0] = init_filename; 814 argv_init[0] = init_filename;
820 kernel_execve(init_filename, argv_init, envp_init); 815 kernel_execve(init_filename, argv_init, envp_init);
@@ -829,7 +824,6 @@ static noinline int init_post(void)
829 /* need to finish all async __init code before freeing the memory */ 824 /* need to finish all async __init code before freeing the memory */
830 async_synchronize_full(); 825 async_synchronize_full();
831 free_initmem(); 826 free_initmem();
832 unlock_kernel();
833 mark_rodata_ro(); 827 mark_rodata_ro();
834 system_state = SYSTEM_RUNNING; 828 system_state = SYSTEM_RUNNING;
835 numa_default_policy(); 829 numa_default_policy();
@@ -869,8 +863,6 @@ static int __init kernel_init(void * unused)
869 * Wait until kthreadd is all set-up. 863 * Wait until kthreadd is all set-up.
870 */ 864 */
871 wait_for_completion(&kthreadd_done); 865 wait_for_completion(&kthreadd_done);
872 lock_kernel();
873
874 /* 866 /*
875 * init can allocate pages on any node 867 * init can allocate pages on any node
876 */ 868 */
@@ -894,7 +886,6 @@ static int __init kernel_init(void * unused)
894 smp_prepare_cpus(setup_max_cpus); 886 smp_prepare_cpus(setup_max_cpus);
895 887
896 do_pre_smp_initcalls(); 888 do_pre_smp_initcalls();
897 start_boot_trace();
898 889
899 smp_init(); 890 smp_init();
900 sched_init_smp(); 891 sched_init_smp();