aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig135
-rw-r--r--init/do_mounts_initrd.c4
-rw-r--r--init/initramfs.c12
-rw-r--r--init/main.c36
4 files changed, 99 insertions, 88 deletions
diff --git a/init/Kconfig b/init/Kconfig
index a23da9f01803..eb77e8ccde1c 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -115,10 +115,13 @@ config HAVE_KERNEL_BZIP2
115config HAVE_KERNEL_LZMA 115config HAVE_KERNEL_LZMA
116 bool 116 bool
117 117
118config HAVE_KERNEL_LZO
119 bool
120
118choice 121choice
119 prompt "Kernel compression mode" 122 prompt "Kernel compression mode"
120 default KERNEL_GZIP 123 default KERNEL_GZIP
121 depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_BZIP2 || HAVE_KERNEL_LZMA 124 depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_BZIP2 || HAVE_KERNEL_LZMA || HAVE_KERNEL_LZO
122 help 125 help
123 The linux kernel is a kind of self-extracting executable. 126 The linux kernel is a kind of self-extracting executable.
124 Several compression algorithms are available, which differ 127 Several compression algorithms are available, which differ
@@ -141,9 +144,8 @@ config KERNEL_GZIP
141 bool "Gzip" 144 bool "Gzip"
142 depends on HAVE_KERNEL_GZIP 145 depends on HAVE_KERNEL_GZIP
143 help 146 help
144 The old and tried gzip compression. Its compression ratio is 147 The old and tried gzip compression. It provides a good balance
145 the poorest among the 3 choices; however its speed (both 148 between compression ratio and decompression speed.
146 compression and decompression) is the fastest.
147 149
148config KERNEL_BZIP2 150config KERNEL_BZIP2
149 bool "Bzip2" 151 bool "Bzip2"
@@ -164,6 +166,14 @@ config KERNEL_LZMA
164 two. Compression is slowest. The kernel size is about 33% 166 two. Compression is slowest. The kernel size is about 33%
165 smaller with LZMA in comparison to gzip. 167 smaller with LZMA in comparison to gzip.
166 168
169config KERNEL_LZO
170 bool "LZO"
171 depends on HAVE_KERNEL_LZO
172 help
173 Its compression ratio is the poorest among the 4. The kernel
174 size is about about 10% bigger than gzip; however its speed
175 (both compression and decompression) is the fastest.
176
167endchoice 177endchoice
168 178
169config SWAP 179config SWAP
@@ -386,6 +396,22 @@ config RCU_FANOUT_EXACT
386 396
387 Say N if unsure. 397 Say N if unsure.
388 398
399config RCU_FAST_NO_HZ
400 bool "Accelerate last non-dyntick-idle CPU's grace periods"
401 depends on TREE_RCU && NO_HZ && SMP
402 default n
403 help
404 This option causes RCU to attempt to accelerate grace periods
405 in order to allow the final CPU to enter dynticks-idle state
406 more quickly. On the other hand, this option increases the
407 overhead of the dynticks-idle checking, particularly on systems
408 with large numbers of CPUs.
409
410 Say Y if energy efficiency is critically important, particularly
411 if you have relatively few CPUs.
412
413 Say N if you are unsure.
414
389config TREE_RCU_TRACE 415config TREE_RCU_TRACE
390 def_bool RCU_TRACE && ( TREE_RCU || TREE_PREEMPT_RCU ) 416 def_bool RCU_TRACE && ( TREE_RCU || TREE_PREEMPT_RCU )
391 select DEBUG_FS 417 select DEBUG_FS
@@ -435,59 +461,9 @@ config LOG_BUF_SHIFT
435config HAVE_UNSTABLE_SCHED_CLOCK 461config HAVE_UNSTABLE_SCHED_CLOCK
436 bool 462 bool
437 463
438config GROUP_SCHED
439 bool "Group CPU scheduler"
440 depends on EXPERIMENTAL
441 default n
442 help
443 This feature lets CPU scheduler recognize task groups and control CPU
444 bandwidth allocation to such task groups.
445 In order to create a group from arbitrary set of processes, use
446 CONFIG_CGROUPS. (See Control Group support.)
447
448config FAIR_GROUP_SCHED
449 bool "Group scheduling for SCHED_OTHER"
450 depends on GROUP_SCHED
451 default GROUP_SCHED
452
453config RT_GROUP_SCHED
454 bool "Group scheduling for SCHED_RR/FIFO"
455 depends on EXPERIMENTAL
456 depends on GROUP_SCHED
457 default n
458 help
459 This feature lets you explicitly allocate real CPU bandwidth
460 to users or control groups (depending on the "Basis for grouping tasks"
461 setting below. If enabled, it will also make it impossible to
462 schedule realtime tasks for non-root users until you allocate
463 realtime bandwidth for them.
464 See Documentation/scheduler/sched-rt-group.txt for more information.
465
466choice
467 depends on GROUP_SCHED
468 prompt "Basis for grouping tasks"
469 default USER_SCHED
470
471config USER_SCHED
472 bool "user id"
473 help
474 This option will choose userid as the basis for grouping
475 tasks, thus providing equal CPU bandwidth to each user.
476
477config CGROUP_SCHED
478 bool "Control groups"
479 depends on CGROUPS
480 help
481 This option allows you to create arbitrary task groups
482 using the "cgroup" pseudo filesystem and control
483 the cpu bandwidth allocated to each such task group.
484 Refer to Documentation/cgroups/cgroups.txt for more
485 information on "cgroup" pseudo filesystem.
486
487endchoice
488
489menuconfig CGROUPS 464menuconfig CGROUPS
490 boolean "Control Group support" 465 boolean "Control Group support"
466 depends on EVENTFD
491 help 467 help
492 This option adds support for grouping sets of processes together, for 468 This option adds support for grouping sets of processes together, for
493 use with process control subsystems such as Cpusets, CFS, memory 469 use with process control subsystems such as Cpusets, CFS, memory
@@ -606,6 +582,36 @@ config CGROUP_MEM_RES_CTLR_SWAP
606 Now, memory usage of swap_cgroup is 2 bytes per entry. If swap page 582 Now, memory usage of swap_cgroup is 2 bytes per entry. If swap page
607 size is 4096bytes, 512k per 1Gbytes of swap. 583 size is 4096bytes, 512k per 1Gbytes of swap.
608 584
585menuconfig CGROUP_SCHED
586 bool "Group CPU scheduler"
587 depends on EXPERIMENTAL && CGROUPS
588 default n
589 help
590 This feature lets CPU scheduler recognize task groups and control CPU
591 bandwidth allocation to such task groups. It uses cgroups to group
592 tasks.
593
594if CGROUP_SCHED
595config FAIR_GROUP_SCHED
596 bool "Group scheduling for SCHED_OTHER"
597 depends on CGROUP_SCHED
598 default CGROUP_SCHED
599
600config RT_GROUP_SCHED
601 bool "Group scheduling for SCHED_RR/FIFO"
602 depends on EXPERIMENTAL
603 depends on CGROUP_SCHED
604 default n
605 help
606 This feature lets you explicitly allocate real CPU bandwidth
607 to users or control groups (depending on the "Basis for grouping tasks"
608 setting below. If enabled, it will also make it impossible to
609 schedule realtime tasks for non-root users until you allocate
610 realtime bandwidth for them.
611 See Documentation/scheduler/sched-rt-group.txt for more information.
612
613endif #CGROUP_SCHED
614
609endif # CGROUPS 615endif # CGROUPS
610 616
611config MM_OWNER 617config MM_OWNER
@@ -966,19 +972,6 @@ config PERF_EVENTS
966 972
967 Say Y if unsure. 973 Say Y if unsure.
968 974
969config EVENT_PROFILE
970 bool "Tracepoint profiling sources"
971 depends on PERF_EVENTS && EVENT_TRACING
972 default y
973 help
974 Allow the use of tracepoints as software performance events.
975
976 When this is enabled, you can create perf events based on
977 tracepoints using PERF_TYPE_TRACEPOINT and the tracepoint ID
978 found in debugfs://tracing/events/*/*/id. (The -e/--events
979 option to the perf tool can parse and interpret symbolic
980 tracepoints, in the subsystem:tracepoint_name format.)
981
982config PERF_COUNTERS 975config PERF_COUNTERS
983 bool "Kernel performance counters (old config option)" 976 bool "Kernel performance counters (old config option)"
984 depends on HAVE_PERF_EVENTS 977 depends on HAVE_PERF_EVENTS
@@ -1102,7 +1095,7 @@ config MMAP_ALLOW_UNINITIALIZED
1102 See Documentation/nommu-mmap.txt for more information. 1095 See Documentation/nommu-mmap.txt for more information.
1103 1096
1104config PROFILING 1097config PROFILING
1105 bool "Profiling support (EXPERIMENTAL)" 1098 bool "Profiling support"
1106 help 1099 help
1107 Say Y here to enable the extended profiling support mechanisms used 1100 Say Y here to enable the extended profiling support mechanisms used
1108 by profilers such as OProfile. 1101 by profilers such as OProfile.
@@ -1252,4 +1245,8 @@ source "block/Kconfig"
1252config PREEMPT_NOTIFIERS 1245config PREEMPT_NOTIFIERS
1253 bool 1246 bool
1254 1247
1248config PADATA
1249 depends on SMP
1250 bool
1251
1255source "kernel/Kconfig.locks" 1252source "kernel/Kconfig.locks"
diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c
index 614241b5200c..2b108538d0d9 100644
--- a/init/do_mounts_initrd.c
+++ b/init/do_mounts_initrd.c
@@ -30,11 +30,7 @@ static int __init do_linuxrc(void * shell)
30 extern char * envp_init[]; 30 extern char * envp_init[];
31 31
32 sys_close(old_fd);sys_close(root_fd); 32 sys_close(old_fd);sys_close(root_fd);
33 sys_close(0);sys_close(1);sys_close(2);
34 sys_setsid(); 33 sys_setsid();
35 (void) sys_open("/dev/console",O_RDWR,0);
36 (void) sys_dup(0);
37 (void) sys_dup(0);
38 return kernel_execve(shell, argv, envp_init); 34 return kernel_execve(shell, argv, envp_init);
39} 35}
40 36
diff --git a/init/initramfs.c b/init/initramfs.c
index b37d34beb90b..37d3859b1b32 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -525,7 +525,7 @@ static void __init clean_rootfs(void)
525 int fd; 525 int fd;
526 void *buf; 526 void *buf;
527 struct linux_dirent64 *dirp; 527 struct linux_dirent64 *dirp;
528 int count; 528 int num;
529 529
530 fd = sys_open("/", O_RDONLY, 0); 530 fd = sys_open("/", O_RDONLY, 0);
531 WARN_ON(fd < 0); 531 WARN_ON(fd < 0);
@@ -539,9 +539,9 @@ static void __init clean_rootfs(void)
539 } 539 }
540 540
541 dirp = buf; 541 dirp = buf;
542 count = sys_getdents64(fd, dirp, BUF_SIZE); 542 num = sys_getdents64(fd, dirp, BUF_SIZE);
543 while (count > 0) { 543 while (num > 0) {
544 while (count > 0) { 544 while (num > 0) {
545 struct stat st; 545 struct stat st;
546 int ret; 546 int ret;
547 547
@@ -554,12 +554,12 @@ static void __init clean_rootfs(void)
554 sys_unlink(dirp->d_name); 554 sys_unlink(dirp->d_name);
555 } 555 }
556 556
557 count -= dirp->d_reclen; 557 num -= dirp->d_reclen;
558 dirp = (void *)dirp + dirp->d_reclen; 558 dirp = (void *)dirp + dirp->d_reclen;
559 } 559 }
560 dirp = buf; 560 dirp = buf;
561 memset(buf, 0, BUF_SIZE); 561 memset(buf, 0, BUF_SIZE);
562 count = sys_getdents64(fd, dirp, BUF_SIZE); 562 num = sys_getdents64(fd, dirp, BUF_SIZE);
563 } 563 }
564 564
565 sys_close(fd); 565 sys_close(fd);
diff --git a/init/main.c b/init/main.c
index dac44a9356a5..a1ab78ceb4b6 100644
--- a/init/main.c
+++ b/init/main.c
@@ -149,6 +149,20 @@ static int __init nosmp(char *str)
149 149
150early_param("nosmp", nosmp); 150early_param("nosmp", nosmp);
151 151
152/* this is hard limit */
153static int __init nrcpus(char *str)
154{
155 int nr_cpus;
156
157 get_option(&str, &nr_cpus);
158 if (nr_cpus > 0 && nr_cpus < nr_cpu_ids)
159 nr_cpu_ids = nr_cpus;
160
161 return 0;
162}
163
164early_param("nr_cpus", nrcpus);
165
152static int __init maxcpus(char *str) 166static int __init maxcpus(char *str)
153{ 167{
154 get_option(&str, &setup_max_cpus); 168 get_option(&str, &setup_max_cpus);
@@ -160,7 +174,7 @@ static int __init maxcpus(char *str)
160 174
161early_param("maxcpus", maxcpus); 175early_param("maxcpus", maxcpus);
162#else 176#else
163const unsigned int setup_max_cpus = NR_CPUS; 177static const unsigned int setup_max_cpus = NR_CPUS;
164#endif 178#endif
165 179
166/* 180/*
@@ -416,7 +430,9 @@ static noinline void __init_refok rest_init(void)
416 kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND); 430 kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND);
417 numa_default_policy(); 431 numa_default_policy();
418 pid = kernel_thread(kthreadd, NULL, CLONE_FS | CLONE_FILES); 432 pid = kernel_thread(kthreadd, NULL, CLONE_FS | CLONE_FILES);
433 rcu_read_lock();
419 kthreadd_task = find_task_by_pid_ns(pid, &init_pid_ns); 434 kthreadd_task = find_task_by_pid_ns(pid, &init_pid_ns);
435 rcu_read_unlock();
420 unlock_kernel(); 436 unlock_kernel();
421 437
422 /* 438 /*
@@ -584,6 +600,7 @@ asmlinkage void __init start_kernel(void)
584 local_irq_disable(); 600 local_irq_disable();
585 } 601 }
586 rcu_init(); 602 rcu_init();
603 radix_tree_init();
587 /* init some links before init_ISA_irqs() */ 604 /* init some links before init_ISA_irqs() */
588 early_irq_init(); 605 early_irq_init();
589 init_IRQ(); 606 init_IRQ();
@@ -601,7 +618,7 @@ asmlinkage void __init start_kernel(void)
601 local_irq_enable(); 618 local_irq_enable();
602 619
603 /* Interrupts are enabled now so all GFP allocations are safe. */ 620 /* Interrupts are enabled now so all GFP allocations are safe. */
604 set_gfp_allowed_mask(__GFP_BITS_MASK); 621 gfp_allowed_mask = __GFP_BITS_MASK;
605 622
606 kmem_cache_init_late(); 623 kmem_cache_init_late();
607 624
@@ -659,7 +676,6 @@ asmlinkage void __init start_kernel(void)
659 key_init(); 676 key_init();
660 security_init(); 677 security_init();
661 vfs_caches_init(totalram_pages); 678 vfs_caches_init(totalram_pages);
662 radix_tree_init();
663 signals_init(); 679 signals_init();
664 /* rootfs populating might need page-writeback */ 680 /* rootfs populating might need page-writeback */
665 page_writeback_init(); 681 page_writeback_init();
@@ -806,11 +822,6 @@ static noinline int init_post(void)
806 system_state = SYSTEM_RUNNING; 822 system_state = SYSTEM_RUNNING;
807 numa_default_policy(); 823 numa_default_policy();
808 824
809 if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
810 printk(KERN_WARNING "Warning: unable to open an initial console.\n");
811
812 (void) sys_dup(0);
813 (void) sys_dup(0);
814 825
815 current->signal->flags |= SIGNAL_UNKILLABLE; 826 current->signal->flags |= SIGNAL_UNKILLABLE;
816 827
@@ -836,7 +847,8 @@ static noinline int init_post(void)
836 run_init_process("/bin/init"); 847 run_init_process("/bin/init");
837 run_init_process("/bin/sh"); 848 run_init_process("/bin/sh");
838 849
839 panic("No init found. Try passing init= option to kernel."); 850 panic("No init found. Try passing init= option to kernel. "
851 "See Linux Documentation/init.txt for guidance.");
840} 852}
841 853
842static int __init kernel_init(void * unused) 854static int __init kernel_init(void * unused)
@@ -873,6 +885,12 @@ static int __init kernel_init(void * unused)
873 885
874 do_basic_setup(); 886 do_basic_setup();
875 887
888 /* Open the /dev/console on the rootfs, this should never fail */
889 if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
890 printk(KERN_WARNING "Warning: unable to open an initial console.\n");
891
892 (void) sys_dup(0);
893 (void) sys_dup(0);
876 /* 894 /*
877 * check if there is an early userspace init. If yes, let it do all 895 * check if there is an early userspace init. If yes, let it do all
878 * the work 896 * the work