aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig143
-rw-r--r--init/do_mounts.c1
-rw-r--r--init/do_mounts_initrd.c4
-rw-r--r--init/do_mounts_rd.c1
-rw-r--r--init/initramfs.c15
-rw-r--r--init/main.c44
6 files changed, 120 insertions, 88 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 313506d8be6e..5cff9a980c39 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -404,6 +404,22 @@ config RCU_FANOUT_EXACT
404 404
405 Say N if unsure. 405 Say N if unsure.
406 406
407config RCU_FAST_NO_HZ
408 bool "Accelerate last non-dyntick-idle CPU's grace periods"
409 depends on TREE_RCU && NO_HZ && SMP
410 default n
411 help
412 This option causes RCU to attempt to accelerate grace periods
413 in order to allow the final CPU to enter dynticks-idle state
414 more quickly. On the other hand, this option increases the
415 overhead of the dynticks-idle checking, particularly on systems
416 with large numbers of CPUs.
417
418 Say Y if energy efficiency is critically important, particularly
419 if you have relatively few CPUs.
420
421 Say N if you are unsure.
422
407config TREE_RCU_TRACE 423config TREE_RCU_TRACE
408 def_bool RCU_TRACE && ( TREE_RCU || TREE_PREEMPT_RCU ) 424 def_bool RCU_TRACE && ( TREE_RCU || TREE_PREEMPT_RCU )
409 select DEBUG_FS 425 select DEBUG_FS
@@ -453,59 +469,9 @@ config LOG_BUF_SHIFT
453config HAVE_UNSTABLE_SCHED_CLOCK 469config HAVE_UNSTABLE_SCHED_CLOCK
454 bool 470 bool
455 471
456config GROUP_SCHED
457 bool "Group CPU scheduler"
458 depends on EXPERIMENTAL
459 default n
460 help
461 This feature lets CPU scheduler recognize task groups and control CPU
462 bandwidth allocation to such task groups.
463 In order to create a group from arbitrary set of processes, use
464 CONFIG_CGROUPS. (See Control Group support.)
465
466config FAIR_GROUP_SCHED
467 bool "Group scheduling for SCHED_OTHER"
468 depends on GROUP_SCHED
469 default GROUP_SCHED
470
471config RT_GROUP_SCHED
472 bool "Group scheduling for SCHED_RR/FIFO"
473 depends on EXPERIMENTAL
474 depends on GROUP_SCHED
475 default n
476 help
477 This feature lets you explicitly allocate real CPU bandwidth
478 to users or control groups (depending on the "Basis for grouping tasks"
479 setting below. If enabled, it will also make it impossible to
480 schedule realtime tasks for non-root users until you allocate
481 realtime bandwidth for them.
482 See Documentation/scheduler/sched-rt-group.txt for more information.
483
484choice
485 depends on GROUP_SCHED
486 prompt "Basis for grouping tasks"
487 default USER_SCHED
488
489config USER_SCHED
490 bool "user id"
491 help
492 This option will choose userid as the basis for grouping
493 tasks, thus providing equal CPU bandwidth to each user.
494
495config CGROUP_SCHED
496 bool "Control groups"
497 depends on CGROUPS
498 help
499 This option allows you to create arbitrary task groups
500 using the "cgroup" pseudo filesystem and control
501 the cpu bandwidth allocated to each such task group.
502 Refer to Documentation/cgroups/cgroups.txt for more
503 information on "cgroup" pseudo filesystem.
504
505endchoice
506
507menuconfig CGROUPS 472menuconfig CGROUPS
508 boolean "Control Group support" 473 boolean "Control Group support"
474 depends on EVENTFD
509 help 475 help
510 This option adds support for grouping sets of processes together, for 476 This option adds support for grouping sets of processes together, for
511 use with process control subsystems such as Cpusets, CFS, memory 477 use with process control subsystems such as Cpusets, CFS, memory
@@ -624,6 +590,62 @@ config CGROUP_MEM_RES_CTLR_SWAP
624 Now, memory usage of swap_cgroup is 2 bytes per entry. If swap page 590 Now, memory usage of swap_cgroup is 2 bytes per entry. If swap page
625 size is 4096bytes, 512k per 1Gbytes of swap. 591 size is 4096bytes, 512k per 1Gbytes of swap.
626 592
593menuconfig CGROUP_SCHED
594 bool "Group CPU scheduler"
595 depends on EXPERIMENTAL && CGROUPS
596 default n
597 help
598 This feature lets CPU scheduler recognize task groups and control CPU
599 bandwidth allocation to such task groups. It uses cgroups to group
600 tasks.
601
602if CGROUP_SCHED
603config FAIR_GROUP_SCHED
604 bool "Group scheduling for SCHED_OTHER"
605 depends on CGROUP_SCHED
606 default CGROUP_SCHED
607
608config RT_GROUP_SCHED
609 bool "Group scheduling for SCHED_RR/FIFO"
610 depends on EXPERIMENTAL
611 depends on CGROUP_SCHED
612 default n
613 help
614 This feature lets you explicitly allocate real CPU bandwidth
615 to task groups. If enabled, it will also make it impossible to
616 schedule realtime tasks for non-root users until you allocate
617 realtime bandwidth for them.
618 See Documentation/scheduler/sched-rt-group.txt for more information.
619
620endif #CGROUP_SCHED
621
622config BLK_CGROUP
623 tristate "Block IO controller"
624 depends on CGROUPS && BLOCK
625 default n
626 ---help---
627 Generic block IO controller cgroup interface. This is the common
628 cgroup interface which should be used by various IO controlling
629 policies.
630
631 Currently, CFQ IO scheduler uses it to recognize task groups and
632 control disk bandwidth allocation (proportional time slice allocation)
633 to such task groups.
634
635 This option only enables generic Block IO controller infrastructure.
636 One needs to also enable actual IO controlling logic in CFQ for it
637 to take effect. (CONFIG_CFQ_GROUP_IOSCHED=y).
638
639 See Documentation/cgroups/blkio-controller.txt for more information.
640
641config DEBUG_BLK_CGROUP
642 bool "Enable Block IO controller debugging"
643 depends on BLK_CGROUP
644 default n
645 ---help---
646 Enable some debugging help. Currently it exports additional stat
647 files in a cgroup which can be useful for debugging.
648
627endif # CGROUPS 649endif # CGROUPS
628 650
629config MM_OWNER 651config MM_OWNER
@@ -984,19 +1006,6 @@ config PERF_EVENTS
984 1006
985 Say Y if unsure. 1007 Say Y if unsure.
986 1008
987config EVENT_PROFILE
988 bool "Tracepoint profiling sources"
989 depends on PERF_EVENTS && EVENT_TRACING
990 default y
991 help
992 Allow the use of tracepoints as software performance events.
993
994 When this is enabled, you can create perf events based on
995 tracepoints using PERF_TYPE_TRACEPOINT and the tracepoint ID
996 found in debugfs://tracing/events/*/*/id. (The -e/--events
997 option to the perf tool can parse and interpret symbolic
998 tracepoints, in the subsystem:tracepoint_name format.)
999
1000config PERF_COUNTERS 1009config PERF_COUNTERS
1001 bool "Kernel performance counters (old config option)" 1010 bool "Kernel performance counters (old config option)"
1002 depends on HAVE_PERF_EVENTS 1011 depends on HAVE_PERF_EVENTS
@@ -1120,7 +1129,7 @@ config MMAP_ALLOW_UNINITIALIZED
1120 See Documentation/nommu-mmap.txt for more information. 1129 See Documentation/nommu-mmap.txt for more information.
1121 1130
1122config PROFILING 1131config PROFILING
1123 bool "Profiling support (EXPERIMENTAL)" 1132 bool "Profiling support"
1124 help 1133 help
1125 Say Y here to enable the extended profiling support mechanisms used 1134 Say Y here to enable the extended profiling support mechanisms used
1126 by profilers such as OProfile. 1135 by profilers such as OProfile.
@@ -1270,4 +1279,8 @@ source "block/Kconfig"
1270config PREEMPT_NOTIFIERS 1279config PREEMPT_NOTIFIERS
1271 bool 1280 bool
1272 1281
1282config PADATA
1283 depends on SMP
1284 bool
1285
1273source "kernel/Kconfig.locks" 1286source "kernel/Kconfig.locks"
diff --git a/init/do_mounts.c b/init/do_mounts.c
index bb008d064c1a..02e3ca4fc527 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -15,6 +15,7 @@
15#include <linux/initrd.h> 15#include <linux/initrd.h>
16#include <linux/async.h> 16#include <linux/async.h>
17#include <linux/fs_struct.h> 17#include <linux/fs_struct.h>
18#include <linux/slab.h>
18 19
19#include <linux/nfs_fs.h> 20#include <linux/nfs_fs.h>
20#include <linux/nfs_fs_sb.h> 21#include <linux/nfs_fs_sb.h>
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/do_mounts_rd.c b/init/do_mounts_rd.c
index 027a402708de..bf3ef667bf36 100644
--- a/init/do_mounts_rd.c
+++ b/init/do_mounts_rd.c
@@ -7,6 +7,7 @@
7#include <linux/cramfs_fs.h> 7#include <linux/cramfs_fs.h>
8#include <linux/initrd.h> 8#include <linux/initrd.h>
9#include <linux/string.h> 9#include <linux/string.h>
10#include <linux/slab.h>
10 11
11#include "do_mounts.h" 12#include "do_mounts.h"
12#include "../fs/squashfs/squashfs_fs.h" 13#include "../fs/squashfs/squashfs_fs.h"
diff --git a/init/initramfs.c b/init/initramfs.c
index b37d34beb90b..4b9c20205092 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -457,7 +457,8 @@ static char * __init unpack_to_rootfs(char *buf, unsigned len)
457 compress_name); 457 compress_name);
458 message = msg_buf; 458 message = msg_buf;
459 } 459 }
460 } 460 } else
461 error("junk in compressed archive");
461 if (state != Reset) 462 if (state != Reset)
462 error("junk in compressed archive"); 463 error("junk in compressed archive");
463 this_header = saved_offset + my_inptr; 464 this_header = saved_offset + my_inptr;
@@ -525,7 +526,7 @@ static void __init clean_rootfs(void)
525 int fd; 526 int fd;
526 void *buf; 527 void *buf;
527 struct linux_dirent64 *dirp; 528 struct linux_dirent64 *dirp;
528 int count; 529 int num;
529 530
530 fd = sys_open("/", O_RDONLY, 0); 531 fd = sys_open("/", O_RDONLY, 0);
531 WARN_ON(fd < 0); 532 WARN_ON(fd < 0);
@@ -539,9 +540,9 @@ static void __init clean_rootfs(void)
539 } 540 }
540 541
541 dirp = buf; 542 dirp = buf;
542 count = sys_getdents64(fd, dirp, BUF_SIZE); 543 num = sys_getdents64(fd, dirp, BUF_SIZE);
543 while (count > 0) { 544 while (num > 0) {
544 while (count > 0) { 545 while (num > 0) {
545 struct stat st; 546 struct stat st;
546 int ret; 547 int ret;
547 548
@@ -554,12 +555,12 @@ static void __init clean_rootfs(void)
554 sys_unlink(dirp->d_name); 555 sys_unlink(dirp->d_name);
555 } 556 }
556 557
557 count -= dirp->d_reclen; 558 num -= dirp->d_reclen;
558 dirp = (void *)dirp + dirp->d_reclen; 559 dirp = (void *)dirp + dirp->d_reclen;
559 } 560 }
560 dirp = buf; 561 dirp = buf;
561 memset(buf, 0, BUF_SIZE); 562 memset(buf, 0, BUF_SIZE);
562 count = sys_getdents64(fd, dirp, BUF_SIZE); 563 num = sys_getdents64(fd, dirp, BUF_SIZE);
563 } 564 }
564 565
565 sys_close(fd); 566 sys_close(fd);
diff --git a/init/main.c b/init/main.c
index dac44a9356a5..3bdb152f412f 100644
--- a/init/main.c
+++ b/init/main.c
@@ -25,7 +25,6 @@
25#include <linux/bootmem.h> 25#include <linux/bootmem.h>
26#include <linux/acpi.h> 26#include <linux/acpi.h>
27#include <linux/tty.h> 27#include <linux/tty.h>
28#include <linux/gfp.h>
29#include <linux/percpu.h> 28#include <linux/percpu.h>
30#include <linux/kmod.h> 29#include <linux/kmod.h>
31#include <linux/vmalloc.h> 30#include <linux/vmalloc.h>
@@ -63,12 +62,14 @@
63#include <linux/sched.h> 62#include <linux/sched.h>
64#include <linux/signal.h> 63#include <linux/signal.h>
65#include <linux/idr.h> 64#include <linux/idr.h>
65#include <linux/kgdb.h>
66#include <linux/ftrace.h> 66#include <linux/ftrace.h>
67#include <linux/async.h> 67#include <linux/async.h>
68#include <linux/kmemcheck.h> 68#include <linux/kmemcheck.h>
69#include <linux/kmemtrace.h> 69#include <linux/kmemtrace.h>
70#include <linux/sfi.h> 70#include <linux/sfi.h>
71#include <linux/shmem_fs.h> 71#include <linux/shmem_fs.h>
72#include <linux/slab.h>
72#include <trace/boot.h> 73#include <trace/boot.h>
73 74
74#include <asm/io.h> 75#include <asm/io.h>
@@ -149,6 +150,20 @@ static int __init nosmp(char *str)
149 150
150early_param("nosmp", nosmp); 151early_param("nosmp", nosmp);
151 152
153/* this is hard limit */
154static int __init nrcpus(char *str)
155{
156 int nr_cpus;
157
158 get_option(&str, &nr_cpus);
159 if (nr_cpus > 0 && nr_cpus < nr_cpu_ids)
160 nr_cpu_ids = nr_cpus;
161
162 return 0;
163}
164
165early_param("nr_cpus", nrcpus);
166
152static int __init maxcpus(char *str) 167static int __init maxcpus(char *str)
153{ 168{
154 get_option(&str, &setup_max_cpus); 169 get_option(&str, &setup_max_cpus);
@@ -160,7 +175,7 @@ static int __init maxcpus(char *str)
160 175
161early_param("maxcpus", maxcpus); 176early_param("maxcpus", maxcpus);
162#else 177#else
163const unsigned int setup_max_cpus = NR_CPUS; 178static const unsigned int setup_max_cpus = NR_CPUS;
164#endif 179#endif
165 180
166/* 181/*
@@ -416,7 +431,9 @@ static noinline void __init_refok rest_init(void)
416 kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND); 431 kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND);
417 numa_default_policy(); 432 numa_default_policy();
418 pid = kernel_thread(kthreadd, NULL, CLONE_FS | CLONE_FILES); 433 pid = kernel_thread(kthreadd, NULL, CLONE_FS | CLONE_FILES);
434 rcu_read_lock();
419 kthreadd_task = find_task_by_pid_ns(pid, &init_pid_ns); 435 kthreadd_task = find_task_by_pid_ns(pid, &init_pid_ns);
436 rcu_read_unlock();
420 unlock_kernel(); 437 unlock_kernel();
421 438
422 /* 439 /*
@@ -550,7 +567,7 @@ asmlinkage void __init start_kernel(void)
550 setup_per_cpu_areas(); 567 setup_per_cpu_areas();
551 smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */ 568 smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */
552 569
553 build_all_zonelists(); 570 build_all_zonelists(NULL);
554 page_alloc_init(); 571 page_alloc_init();
555 572
556 printk(KERN_NOTICE "Kernel command line: %s\n", boot_command_line); 573 printk(KERN_NOTICE "Kernel command line: %s\n", boot_command_line);
@@ -584,6 +601,7 @@ asmlinkage void __init start_kernel(void)
584 local_irq_disable(); 601 local_irq_disable();
585 } 602 }
586 rcu_init(); 603 rcu_init();
604 radix_tree_init();
587 /* init some links before init_ISA_irqs() */ 605 /* init some links before init_ISA_irqs() */
588 early_irq_init(); 606 early_irq_init();
589 init_IRQ(); 607 init_IRQ();
@@ -601,7 +619,7 @@ asmlinkage void __init start_kernel(void)
601 local_irq_enable(); 619 local_irq_enable();
602 620
603 /* Interrupts are enabled now so all GFP allocations are safe. */ 621 /* Interrupts are enabled now so all GFP allocations are safe. */
604 set_gfp_allowed_mask(__GFP_BITS_MASK); 622 gfp_allowed_mask = __GFP_BITS_MASK;
605 623
606 kmem_cache_init_late(); 624 kmem_cache_init_late();
607 625
@@ -658,8 +676,8 @@ asmlinkage void __init start_kernel(void)
658 buffer_init(); 676 buffer_init();
659 key_init(); 677 key_init();
660 security_init(); 678 security_init();
679 dbg_late_init();
661 vfs_caches_init(totalram_pages); 680 vfs_caches_init(totalram_pages);
662 radix_tree_init();
663 signals_init(); 681 signals_init();
664 /* rootfs populating might need page-writeback */ 682 /* rootfs populating might need page-writeback */
665 page_writeback_init(); 683 page_writeback_init();
@@ -806,11 +824,6 @@ static noinline int init_post(void)
806 system_state = SYSTEM_RUNNING; 824 system_state = SYSTEM_RUNNING;
807 numa_default_policy(); 825 numa_default_policy();
808 826
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 827
815 current->signal->flags |= SIGNAL_UNKILLABLE; 828 current->signal->flags |= SIGNAL_UNKILLABLE;
816 829
@@ -836,7 +849,8 @@ static noinline int init_post(void)
836 run_init_process("/bin/init"); 849 run_init_process("/bin/init");
837 run_init_process("/bin/sh"); 850 run_init_process("/bin/sh");
838 851
839 panic("No init found. Try passing init= option to kernel."); 852 panic("No init found. Try passing init= option to kernel. "
853 "See Linux Documentation/init.txt for guidance.");
840} 854}
841 855
842static int __init kernel_init(void * unused) 856static int __init kernel_init(void * unused)
@@ -846,7 +860,7 @@ static int __init kernel_init(void * unused)
846 /* 860 /*
847 * init can allocate pages on any node 861 * init can allocate pages on any node
848 */ 862 */
849 set_mems_allowed(node_possible_map); 863 set_mems_allowed(node_states[N_HIGH_MEMORY]);
850 /* 864 /*
851 * init can run on any cpu. 865 * init can run on any cpu.
852 */ 866 */
@@ -873,6 +887,12 @@ static int __init kernel_init(void * unused)
873 887
874 do_basic_setup(); 888 do_basic_setup();
875 889
890 /* Open the /dev/console on the rootfs, this should never fail */
891 if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
892 printk(KERN_WARNING "Warning: unable to open an initial console.\n");
893
894 (void) sys_dup(0);
895 (void) sys_dup(0);
876 /* 896 /*
877 * check if there is an early userspace init. If yes, let it do all 897 * check if there is an early userspace init. If yes, let it do all
878 * the work 898 * the work