aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig154
-rw-r--r--init/do_mounts_initrd.c8
-rw-r--r--init/main.c53
-rw-r--r--init/version.c2
4 files changed, 127 insertions, 90 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 5341d7232c3a..a76d13189e47 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -505,6 +505,7 @@ config RCU_USER_QS
505config CONTEXT_TRACKING_FORCE 505config CONTEXT_TRACKING_FORCE
506 bool "Force context tracking" 506 bool "Force context tracking"
507 depends on CONTEXT_TRACKING 507 depends on CONTEXT_TRACKING
508 default CONTEXT_TRACKING
508 help 509 help
509 Probe on user/kernel boundaries by default in order to 510 Probe on user/kernel boundaries by default in order to
510 test the features that rely on it such as userspace RCU extended 511 test the features that rely on it such as userspace RCU extended
@@ -578,13 +579,16 @@ config RCU_FAST_NO_HZ
578 depends on NO_HZ && SMP 579 depends on NO_HZ && SMP
579 default n 580 default n
580 help 581 help
581 This option causes RCU to attempt to accelerate grace periods in 582 This option permits CPUs to enter dynticks-idle state even if
582 order to allow CPUs to enter dynticks-idle state more quickly. 583 they have RCU callbacks queued, and prevents RCU from waking
583 On the other hand, this option increases the overhead of the 584 these CPUs up more than roughly once every four jiffies (by
584 dynticks-idle checking, thus degrading scheduling latency. 585 default, you can adjust this using the rcutree.rcu_idle_gp_delay
586 parameter), thus improving energy efficiency. On the other
587 hand, this option increases the duration of RCU grace periods,
588 for example, slowing down synchronize_rcu().
585 589
586 Say Y if energy efficiency is critically important, and you don't 590 Say Y if energy efficiency is critically important, and you
587 care about real-time response. 591 don't care about increased grace-period durations.
588 592
589 Say N if you are unsure. 593 Say N if you are unsure.
590 594
@@ -651,7 +655,7 @@ config RCU_BOOST_DELAY
651 Accept the default if unsure. 655 Accept the default if unsure.
652 656
653config RCU_NOCB_CPU 657config RCU_NOCB_CPU
654 bool "Offload RCU callback processing from boot-selected CPUs" 658 bool "Offload RCU callback processing from boot-selected CPUs (EXPERIMENTAL"
655 depends on TREE_RCU || TREE_PREEMPT_RCU 659 depends on TREE_RCU || TREE_PREEMPT_RCU
656 default n 660 default n
657 help 661 help
@@ -662,16 +666,56 @@ config RCU_NOCB_CPU
662 666
663 This option offloads callback invocation from the set of 667 This option offloads callback invocation from the set of
664 CPUs specified at boot time by the rcu_nocbs parameter. 668 CPUs specified at boot time by the rcu_nocbs parameter.
665 For each such CPU, a kthread ("rcuoN") will be created to 669 For each such CPU, a kthread ("rcuox/N") will be created to
666 invoke callbacks, where the "N" is the CPU being offloaded. 670 invoke callbacks, where the "N" is the CPU being offloaded,
667 Nothing prevents this kthread from running on the specified 671 and where the "x" is "b" for RCU-bh, "p" for RCU-preempt, and
668 CPUs, but (1) the kthreads may be preempted between each 672 "s" for RCU-sched. Nothing prevents this kthread from running
669 callback, and (2) affinity or cgroups can be used to force 673 on the specified CPUs, but (1) the kthreads may be preempted
670 the kthreads to run on whatever set of CPUs is desired. 674 between each callback, and (2) affinity or cgroups can be used
671 675 to force the kthreads to run on whatever set of CPUs is desired.
672 Say Y here if you want reduced OS jitter on selected CPUs. 676
677 Say Y here if you want to help to debug reduced OS jitter.
673 Say N here if you are unsure. 678 Say N here if you are unsure.
674 679
680choice
681 prompt "Build-forced no-CBs CPUs"
682 default RCU_NOCB_CPU_NONE
683 help
684 This option allows no-CBs CPUs to be specified at build time.
685 Additional no-CBs CPUs may be specified by the rcu_nocbs=
686 boot parameter.
687
688config RCU_NOCB_CPU_NONE
689 bool "No build_forced no-CBs CPUs"
690 depends on RCU_NOCB_CPU
691 help
692 This option does not force any of the CPUs to be no-CBs CPUs.
693 Only CPUs designated by the rcu_nocbs= boot parameter will be
694 no-CBs CPUs.
695
696config RCU_NOCB_CPU_ZERO
697 bool "CPU 0 is a build_forced no-CBs CPU"
698 depends on RCU_NOCB_CPU
699 help
700 This option forces CPU 0 to be a no-CBs CPU. Additional CPUs
701 may be designated as no-CBs CPUs using the rcu_nocbs= boot
702 parameter will be no-CBs CPUs.
703
704 Select this if CPU 0 needs to be a no-CBs CPU for real-time
705 or energy-efficiency reasons.
706
707config RCU_NOCB_CPU_ALL
708 bool "All CPUs are build_forced no-CBs CPUs"
709 depends on RCU_NOCB_CPU
710 help
711 This option forces all CPUs to be no-CBs CPUs. The rcu_nocbs=
712 boot parameter will be ignored.
713
714 Select this if all CPUs need to be no-CBs CPUs for real-time
715 or energy-efficiency reasons.
716
717endchoice
718
675endmenu # "RCU Subsystem" 719endmenu # "RCU Subsystem"
676 720
677config IKCONFIG 721config IKCONFIG
@@ -1177,6 +1221,35 @@ config SYSCTL
1177config ANON_INODES 1221config ANON_INODES
1178 bool 1222 bool
1179 1223
1224config HAVE_UID16
1225 bool
1226
1227config SYSCTL_EXCEPTION_TRACE
1228 bool
1229 help
1230 Enable support for /proc/sys/debug/exception-trace.
1231
1232config SYSCTL_ARCH_UNALIGN_NO_WARN
1233 bool
1234 help
1235 Enable support for /proc/sys/kernel/ignore-unaligned-usertrap
1236 Allows arch to define/use @no_unaligned_warning to possibly warn
1237 about unaligned access emulation going on under the hood.
1238
1239config SYSCTL_ARCH_UNALIGN_ALLOW
1240 bool
1241 help
1242 Enable support for /proc/sys/kernel/unaligned-trap
1243 Allows arches to define/use @unaligned_enabled to runtime toggle
1244 the unaligned access emulation.
1245 see arch/parisc/kernel/unaligned.c for reference
1246
1247config HOTPLUG
1248 def_bool y
1249
1250config HAVE_PCSPKR_PLATFORM
1251 bool
1252
1180menuconfig EXPERT 1253menuconfig EXPERT
1181 bool "Configure standard kernel features (expert users)" 1254 bool "Configure standard kernel features (expert users)"
1182 # Unhide debug options, to make the on-by-default options visible 1255 # Unhide debug options, to make the on-by-default options visible
@@ -1187,9 +1260,6 @@ menuconfig EXPERT
1187 environments which can tolerate a "non-standard" kernel. 1260 environments which can tolerate a "non-standard" kernel.
1188 Only use this if you really know what you are doing. 1261 Only use this if you really know what you are doing.
1189 1262
1190config HAVE_UID16
1191 bool
1192
1193config UID16 1263config UID16
1194 bool "Enable 16-bit UID system calls" if EXPERT 1264 bool "Enable 16-bit UID system calls" if EXPERT
1195 depends on HAVE_UID16 1265 depends on HAVE_UID16
@@ -1214,26 +1284,6 @@ config SYSCTL_SYSCALL
1214 1284
1215 If unsure say N here. 1285 If unsure say N here.
1216 1286
1217config SYSCTL_EXCEPTION_TRACE
1218 bool
1219 help
1220 Enable support for /proc/sys/debug/exception-trace.
1221
1222config SYSCTL_ARCH_UNALIGN_NO_WARN
1223 bool
1224 help
1225 Enable support for /proc/sys/kernel/ignore-unaligned-usertrap
1226 Allows arch to define/use @no_unaligned_warning to possibly warn
1227 about unaligned access emulation going on under the hood.
1228
1229config SYSCTL_ARCH_UNALIGN_ALLOW
1230 bool
1231 help
1232 Enable support for /proc/sys/kernel/unaligned-trap
1233 Allows arches to define/use @unaligned_enabled to runtime toggle
1234 the unaligned access emulation.
1235 see arch/parisc/kernel/unaligned.c for reference
1236
1237config KALLSYMS 1287config KALLSYMS
1238 bool "Load all symbols for debugging/ksymoops" if EXPERT 1288 bool "Load all symbols for debugging/ksymoops" if EXPERT
1239 default y 1289 default y
@@ -1259,9 +1309,6 @@ config KALLSYMS_ALL
1259 1309
1260 Say N unless you really need all symbols. 1310 Say N unless you really need all symbols.
1261 1311
1262config HOTPLUG
1263 def_bool y
1264
1265config PRINTK 1312config PRINTK
1266 default y 1313 default y
1267 bool "Enable support for printk" if EXPERT 1314 bool "Enable support for printk" if EXPERT
@@ -1300,9 +1347,6 @@ config PCSPKR_PLATFORM
1300 This option allows to disable the internal PC-Speaker 1347 This option allows to disable the internal PC-Speaker
1301 support, saving some memory. 1348 support, saving some memory.
1302 1349
1303config HAVE_PCSPKR_PLATFORM
1304 bool
1305
1306config BASE_FULL 1350config BASE_FULL
1307 default y 1351 default y
1308 bool "Enable full-sized data structures for core" if EXPERT 1352 bool "Enable full-sized data structures for core" if EXPERT
@@ -1374,8 +1418,17 @@ config AIO
1374 default y 1418 default y
1375 help 1419 help
1376 This option enables POSIX asynchronous I/O which may by used 1420 This option enables POSIX asynchronous I/O which may by used
1377 by some high performance threaded applications. Disabling 1421 by some high performance threaded applications. Disabling
1378 this option saves about 7k. 1422 this option saves about 7k.
1423
1424config PCI_QUIRKS
1425 default y
1426 bool "Enable PCI quirk workarounds" if EXPERT
1427 depends on PCI
1428 help
1429 This enables workarounds for various PCI chipset
1430 bugs/quirks. Disable this only if your target machine is
1431 unaffected by PCI quirks.
1379 1432
1380config EMBEDDED 1433config EMBEDDED
1381 bool "Embedded system" 1434 bool "Embedded system"
@@ -1450,15 +1503,6 @@ config VM_EVENT_COUNTERS
1450 on EXPERT systems. /proc/vmstat will only show page counts 1503 on EXPERT systems. /proc/vmstat will only show page counts
1451 if VM event counters are disabled. 1504 if VM event counters are disabled.
1452 1505
1453config PCI_QUIRKS
1454 default y
1455 bool "Enable PCI quirk workarounds" if EXPERT
1456 depends on PCI
1457 help
1458 This enables workarounds for various PCI chipset
1459 bugs/quirks. Disable this only if your target machine is
1460 unaffected by PCI quirks.
1461
1462config SLUB_DEBUG 1506config SLUB_DEBUG
1463 default y 1507 default y
1464 bool "Enable SLUB debugging support" if EXPERT 1508 bool "Enable SLUB debugging support" if EXPERT
diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c
index a32ec1ce882b..3e0878e8a80d 100644
--- a/init/do_mounts_initrd.c
+++ b/init/do_mounts_initrd.c
@@ -50,6 +50,7 @@ static int init_linuxrc(struct subprocess_info *info, struct cred *new)
50 50
51static void __init handle_initrd(void) 51static void __init handle_initrd(void)
52{ 52{
53 struct subprocess_info *info;
53 static char *argv[] = { "linuxrc", NULL, }; 54 static char *argv[] = { "linuxrc", NULL, };
54 extern char *envp_init[]; 55 extern char *envp_init[];
55 int error; 56 int error;
@@ -70,8 +71,11 @@ static void __init handle_initrd(void)
70 */ 71 */
71 current->flags |= PF_FREEZER_SKIP; 72 current->flags |= PF_FREEZER_SKIP;
72 73
73 call_usermodehelper_fns("/linuxrc", argv, envp_init, UMH_WAIT_PROC, 74 info = call_usermodehelper_setup("/linuxrc", argv, envp_init,
74 init_linuxrc, NULL, NULL); 75 GFP_KERNEL, init_linuxrc, NULL, NULL);
76 if (!info)
77 return;
78 call_usermodehelper_exec(info, UMH_WAIT_PROC);
75 79
76 current->flags &= ~PF_FREEZER_SKIP; 80 current->flags &= ~PF_FREEZER_SKIP;
77 81
diff --git a/init/main.c b/init/main.c
index 63534a141b4e..ceed17aaedfd 100644
--- a/init/main.c
+++ b/init/main.c
@@ -9,6 +9,8 @@
9 * Simplified starting of init: Michael A. Griffith <grif@acm.org> 9 * Simplified starting of init: Michael A. Griffith <grif@acm.org>
10 */ 10 */
11 11
12#define DEBUG /* Enable initcall_debug */
13
12#include <linux/types.h> 14#include <linux/types.h>
13#include <linux/module.h> 15#include <linux/module.h>
14#include <linux/proc_fs.h> 16#include <linux/proc_fs.h>
@@ -174,8 +176,8 @@ static int __init obsolete_checksetup(char *line)
174 if (line[n] == '\0' || line[n] == '=') 176 if (line[n] == '\0' || line[n] == '=')
175 had_early_param = 1; 177 had_early_param = 1;
176 } else if (!p->setup_func) { 178 } else if (!p->setup_func) {
177 printk(KERN_WARNING "Parameter %s is obsolete," 179 pr_warn("Parameter %s is obsolete, ignored\n",
178 " ignored\n", p->str); 180 p->str);
179 return 1; 181 return 1;
180 } else if (p->setup_func(line + n)) 182 } else if (p->setup_func(line + n))
181 return 1; 183 return 1;
@@ -384,7 +386,7 @@ static noinline void __init_refok rest_init(void)
384 init_idle_bootup_task(current); 386 init_idle_bootup_task(current);
385 schedule_preempt_disabled(); 387 schedule_preempt_disabled();
386 /* Call into cpu_idle with preempt disabled */ 388 /* Call into cpu_idle with preempt disabled */
387 cpu_idle(); 389 cpu_startup_entry(CPUHP_ONLINE);
388} 390}
389 391
390/* Check for early params. */ 392/* Check for early params. */
@@ -398,8 +400,7 @@ static int __init do_early_param(char *param, char *val, const char *unused)
398 strcmp(p->str, "earlycon") == 0) 400 strcmp(p->str, "earlycon") == 0)
399 ) { 401 ) {
400 if (p->setup_func(val) != 0) 402 if (p->setup_func(val) != 0)
401 printk(KERN_WARNING 403 pr_warn("Malformed early option '%s'\n", param);
402 "Malformed early option '%s'\n", param);
403 } 404 }
404 } 405 }
405 /* We accept everything at this stage. */ 406 /* We accept everything at this stage. */
@@ -494,10 +495,9 @@ asmlinkage void __init start_kernel(void)
494 * Interrupts are still disabled. Do necessary setups, then 495 * Interrupts are still disabled. Do necessary setups, then
495 * enable them 496 * enable them
496 */ 497 */
497 tick_init();
498 boot_cpu_init(); 498 boot_cpu_init();
499 page_address_init(); 499 page_address_init();
500 printk(KERN_NOTICE "%s", linux_banner); 500 pr_notice("%s", linux_banner);
501 setup_arch(&command_line); 501 setup_arch(&command_line);
502 mm_init_owner(&init_mm, &init_task); 502 mm_init_owner(&init_mm, &init_task);
503 mm_init_cpumask(&init_mm); 503 mm_init_cpumask(&init_mm);
@@ -509,7 +509,7 @@ asmlinkage void __init start_kernel(void)
509 build_all_zonelists(NULL, NULL); 509 build_all_zonelists(NULL, NULL);
510 page_alloc_init(); 510 page_alloc_init();
511 511
512 printk(KERN_NOTICE "Kernel command line: %s\n", boot_command_line); 512 pr_notice("Kernel command line: %s\n", boot_command_line);
513 parse_early_param(); 513 parse_early_param();
514 parse_args("Booting kernel", static_command_line, __start___param, 514 parse_args("Booting kernel", static_command_line, __start___param,
515 __stop___param - __start___param, 515 __stop___param - __start___param,
@@ -539,11 +539,8 @@ asmlinkage void __init start_kernel(void)
539 * fragile until we cpu_idle() for the first time. 539 * fragile until we cpu_idle() for the first time.
540 */ 540 */
541 preempt_disable(); 541 preempt_disable();
542 if (!irqs_disabled()) { 542 if (WARN(!irqs_disabled(), "Interrupts were enabled *very* early, fixing it\n"))
543 printk(KERN_WARNING "start_kernel(): bug: interrupts were "
544 "enabled *very* early, fixing it\n");
545 local_irq_disable(); 543 local_irq_disable();
546 }
547 idr_init_cache(); 544 idr_init_cache();
548 perf_event_init(); 545 perf_event_init();
549 rcu_init(); 546 rcu_init();
@@ -551,6 +548,7 @@ asmlinkage void __init start_kernel(void)
551 /* init some links before init_ISA_irqs() */ 548 /* init some links before init_ISA_irqs() */
552 early_irq_init(); 549 early_irq_init();
553 init_IRQ(); 550 init_IRQ();
551 tick_init();
554 init_timers(); 552 init_timers();
555 hrtimers_init(); 553 hrtimers_init();
556 softirq_init(); 554 softirq_init();
@@ -558,9 +556,7 @@ asmlinkage void __init start_kernel(void)
558 time_init(); 556 time_init();
559 profile_init(); 557 profile_init();
560 call_function_init(); 558 call_function_init();
561 if (!irqs_disabled()) 559 WARN(!irqs_disabled(), "Interrupts were enabled early\n");
562 printk(KERN_CRIT "start_kernel(): bug: interrupts were "
563 "enabled early\n");
564 early_boot_irqs_disabled = false; 560 early_boot_irqs_disabled = false;
565 local_irq_enable(); 561 local_irq_enable();
566 562
@@ -587,8 +583,7 @@ asmlinkage void __init start_kernel(void)
587#ifdef CONFIG_BLK_DEV_INITRD 583#ifdef CONFIG_BLK_DEV_INITRD
588 if (initrd_start && !initrd_below_start_ok && 584 if (initrd_start && !initrd_below_start_ok &&
589 page_to_pfn(virt_to_page((void *)initrd_start)) < min_low_pfn) { 585 page_to_pfn(virt_to_page((void *)initrd_start)) < min_low_pfn) {
590 printk(KERN_CRIT "initrd overwritten (0x%08lx < 0x%08lx) - " 586 pr_crit("initrd overwritten (0x%08lx < 0x%08lx) - disabling it.\n",
591 "disabling it.\n",
592 page_to_pfn(virt_to_page((void *)initrd_start)), 587 page_to_pfn(virt_to_page((void *)initrd_start)),
593 min_low_pfn); 588 min_low_pfn);
594 initrd_start = 0; 589 initrd_start = 0;
@@ -667,14 +662,14 @@ static int __init_or_module do_one_initcall_debug(initcall_t fn)
667 unsigned long long duration; 662 unsigned long long duration;
668 int ret; 663 int ret;
669 664
670 printk(KERN_DEBUG "calling %pF @ %i\n", fn, task_pid_nr(current)); 665 pr_debug("calling %pF @ %i\n", fn, task_pid_nr(current));
671 calltime = ktime_get(); 666 calltime = ktime_get();
672 ret = fn(); 667 ret = fn();
673 rettime = ktime_get(); 668 rettime = ktime_get();
674 delta = ktime_sub(rettime, calltime); 669 delta = ktime_sub(rettime, calltime);
675 duration = (unsigned long long) ktime_to_ns(delta) >> 10; 670 duration = (unsigned long long) ktime_to_ns(delta) >> 10;
676 printk(KERN_DEBUG "initcall %pF returned %d after %lld usecs\n", fn, 671 pr_debug("initcall %pF returned %d after %lld usecs\n",
677 ret, duration); 672 fn, ret, duration);
678 673
679 return ret; 674 return ret;
680} 675}
@@ -691,20 +686,15 @@ int __init_or_module do_one_initcall(initcall_t fn)
691 686
692 msgbuf[0] = 0; 687 msgbuf[0] = 0;
693 688
694 if (ret && ret != -ENODEV && initcall_debug)
695 sprintf(msgbuf, "error code %d ", ret);
696
697 if (preempt_count() != count) { 689 if (preempt_count() != count) {
698 strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf)); 690 sprintf(msgbuf, "preemption imbalance ");
699 preempt_count() = count; 691 preempt_count() = count;
700 } 692 }
701 if (irqs_disabled()) { 693 if (irqs_disabled()) {
702 strlcat(msgbuf, "disabled interrupts ", sizeof(msgbuf)); 694 strlcat(msgbuf, "disabled interrupts ", sizeof(msgbuf));
703 local_irq_enable(); 695 local_irq_enable();
704 } 696 }
705 if (msgbuf[0]) { 697 WARN(msgbuf[0], "initcall %pF returned with %s\n", fn, msgbuf);
706 printk("initcall %pF returned with %s\n", fn, msgbuf);
707 }
708 698
709 return ret; 699 return ret;
710} 700}
@@ -832,8 +822,7 @@ static int __ref kernel_init(void *unused)
832 if (ramdisk_execute_command) { 822 if (ramdisk_execute_command) {
833 if (!run_init_process(ramdisk_execute_command)) 823 if (!run_init_process(ramdisk_execute_command))
834 return 0; 824 return 0;
835 printk(KERN_WARNING "Failed to execute %s\n", 825 pr_err("Failed to execute %s\n", ramdisk_execute_command);
836 ramdisk_execute_command);
837 } 826 }
838 827
839 /* 828 /*
@@ -845,8 +834,8 @@ static int __ref kernel_init(void *unused)
845 if (execute_command) { 834 if (execute_command) {
846 if (!run_init_process(execute_command)) 835 if (!run_init_process(execute_command))
847 return 0; 836 return 0;
848 printk(KERN_WARNING "Failed to execute %s. Attempting " 837 pr_err("Failed to execute %s. Attempting defaults...\n",
849 "defaults...\n", execute_command); 838 execute_command);
850 } 839 }
851 if (!run_init_process("/sbin/init") || 840 if (!run_init_process("/sbin/init") ||
852 !run_init_process("/etc/init") || 841 !run_init_process("/etc/init") ||
@@ -891,7 +880,7 @@ static noinline void __init kernel_init_freeable(void)
891 880
892 /* Open the /dev/console on the rootfs, this should never fail */ 881 /* Open the /dev/console on the rootfs, this should never fail */
893 if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) 882 if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
894 printk(KERN_WARNING "Warning: unable to open an initial console.\n"); 883 pr_err("Warning: unable to open an initial console.\n");
895 884
896 (void) sys_dup(0); 885 (void) sys_dup(0);
897 (void) sys_dup(0); 886 (void) sys_dup(0);
diff --git a/init/version.c b/init/version.c
index 58170f18912d..1a4718e500fe 100644
--- a/init/version.c
+++ b/init/version.c
@@ -12,7 +12,7 @@
12#include <linux/utsname.h> 12#include <linux/utsname.h>
13#include <generated/utsrelease.h> 13#include <generated/utsrelease.h>
14#include <linux/version.h> 14#include <linux/version.h>
15#include <linux/proc_fs.h> 15#include <linux/proc_ns.h>
16 16
17#ifndef CONFIG_KALLSYMS 17#ifndef CONFIG_KALLSYMS
18#define version(a) Version_ ## a 18#define version(a) Version_ ## a