aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig44
-rw-r--r--init/do_mounts_initrd.c7
-rw-r--r--init/init_task.c2
-rw-r--r--init/initramfs.c8
-rw-r--r--init/main.c24
5 files changed, 72 insertions, 13 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 7d30240e5bfe..7000d9657402 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -20,12 +20,8 @@ config CONSTRUCTORS
20 bool 20 bool
21 depends on !UML 21 depends on !UML
22 22
23config HAVE_IRQ_WORK
24 bool
25
26config IRQ_WORK 23config IRQ_WORK
27 bool 24 bool
28 depends on HAVE_IRQ_WORK
29 25
30config BUILDTIME_EXTABLE_SORT 26config BUILDTIME_EXTABLE_SORT
31 bool 27 bool
@@ -326,10 +322,13 @@ source "kernel/time/Kconfig"
326 322
327menu "CPU/Task time and stats accounting" 323menu "CPU/Task time and stats accounting"
328 324
325config VIRT_CPU_ACCOUNTING
326 bool
327
329choice 328choice
330 prompt "Cputime accounting" 329 prompt "Cputime accounting"
331 default TICK_CPU_ACCOUNTING if !PPC64 330 default TICK_CPU_ACCOUNTING if !PPC64
332 default VIRT_CPU_ACCOUNTING if PPC64 331 default VIRT_CPU_ACCOUNTING_NATIVE if PPC64
333 332
334# Kind of a stub config for the pure tick based cputime accounting 333# Kind of a stub config for the pure tick based cputime accounting
335config TICK_CPU_ACCOUNTING 334config TICK_CPU_ACCOUNTING
@@ -342,9 +341,10 @@ config TICK_CPU_ACCOUNTING
342 341
343 If unsure, say Y. 342 If unsure, say Y.
344 343
345config VIRT_CPU_ACCOUNTING 344config VIRT_CPU_ACCOUNTING_NATIVE
346 bool "Deterministic task and CPU time accounting" 345 bool "Deterministic task and CPU time accounting"
347 depends on HAVE_VIRT_CPU_ACCOUNTING 346 depends on HAVE_VIRT_CPU_ACCOUNTING
347 select VIRT_CPU_ACCOUNTING
348 help 348 help
349 Select this option to enable more accurate task and CPU time 349 Select this option to enable more accurate task and CPU time
350 accounting. This is done by reading a CPU counter on each 350 accounting. This is done by reading a CPU counter on each
@@ -354,6 +354,23 @@ config VIRT_CPU_ACCOUNTING
354 this also enables accounting of stolen time on logically-partitioned 354 this also enables accounting of stolen time on logically-partitioned
355 systems. 355 systems.
356 356
357config VIRT_CPU_ACCOUNTING_GEN
358 bool "Full dynticks CPU time accounting"
359 depends on HAVE_CONTEXT_TRACKING && 64BIT
360 select VIRT_CPU_ACCOUNTING
361 select CONTEXT_TRACKING
362 help
363 Select this option to enable task and CPU time accounting on full
364 dynticks systems. This accounting is implemented by watching every
365 kernel-user boundaries using the context tracking subsystem.
366 The accounting is thus performed at the expense of some significant
367 overhead.
368
369 For now this is only useful if you are working on the full
370 dynticks subsystem development.
371
372 If unsure, say N.
373
357config IRQ_TIME_ACCOUNTING 374config IRQ_TIME_ACCOUNTING
358 bool "Fine granularity task level IRQ time accounting" 375 bool "Fine granularity task level IRQ time accounting"
359 depends on HAVE_IRQ_TIME_ACCOUNTING 376 depends on HAVE_IRQ_TIME_ACCOUNTING
@@ -453,7 +470,7 @@ config TREE_RCU
453 470
454config TREE_PREEMPT_RCU 471config TREE_PREEMPT_RCU
455 bool "Preemptible tree-based hierarchical RCU" 472 bool "Preemptible tree-based hierarchical RCU"
456 depends on PREEMPT && SMP 473 depends on PREEMPT
457 help 474 help
458 This option selects the RCU implementation that is 475 This option selects the RCU implementation that is
459 designed for very large SMP systems with hundreds or 476 designed for very large SMP systems with hundreds or
@@ -461,6 +478,8 @@ config TREE_PREEMPT_RCU
461 is also required. It also scales down nicely to 478 is also required. It also scales down nicely to
462 smaller systems. 479 smaller systems.
463 480
481 Select this option if you are unsure.
482
464config TINY_RCU 483config TINY_RCU
465 bool "UP-only small-memory-footprint RCU" 484 bool "UP-only small-memory-footprint RCU"
466 depends on !PREEMPT && !SMP 485 depends on !PREEMPT && !SMP
@@ -486,6 +505,14 @@ config PREEMPT_RCU
486 This option enables preemptible-RCU code that is common between 505 This option enables preemptible-RCU code that is common between
487 the TREE_PREEMPT_RCU and TINY_PREEMPT_RCU implementations. 506 the TREE_PREEMPT_RCU and TINY_PREEMPT_RCU implementations.
488 507
508config RCU_STALL_COMMON
509 def_bool ( TREE_RCU || TREE_PREEMPT_RCU || RCU_TRACE )
510 help
511 This option enables RCU CPU stall code that is common between
512 the TINY and TREE variants of RCU. The purpose is to allow
513 the tiny variants to disable RCU CPU stall warnings, while
514 making these warnings mandatory for the tree variants.
515
489config CONTEXT_TRACKING 516config CONTEXT_TRACKING
490 bool 517 bool
491 518
@@ -1182,7 +1209,7 @@ config CC_OPTIMIZE_FOR_SIZE
1182 Enabling this option will pass "-Os" instead of "-O2" to gcc 1209 Enabling this option will pass "-Os" instead of "-O2" to gcc
1183 resulting in a smaller kernel. 1210 resulting in a smaller kernel.
1184 1211
1185 If unsure, say Y. 1212 If unsure, say N.
1186 1213
1187config SYSCTL 1214config SYSCTL
1188 bool 1215 bool
@@ -1263,6 +1290,7 @@ config HOTPLUG
1263config PRINTK 1290config PRINTK
1264 default y 1291 default y
1265 bool "Enable support for printk" if EXPERT 1292 bool "Enable support for printk" if EXPERT
1293 select IRQ_WORK
1266 help 1294 help
1267 This option enables normal printk support. Removing it 1295 This option enables normal printk support. Removing it
1268 eliminates most of the message strings from the kernel image 1296 eliminates most of the message strings from the kernel image
diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c
index 5e4ded51788e..a32ec1ce882b 100644
--- a/init/do_mounts_initrd.c
+++ b/init/do_mounts_initrd.c
@@ -36,6 +36,10 @@ __setup("noinitrd", no_initrd);
36static int init_linuxrc(struct subprocess_info *info, struct cred *new) 36static int init_linuxrc(struct subprocess_info *info, struct cred *new)
37{ 37{
38 sys_unshare(CLONE_FS | CLONE_FILES); 38 sys_unshare(CLONE_FS | CLONE_FILES);
39 /* stdin/stdout/stderr for /linuxrc */
40 sys_open("/dev/console", O_RDWR, 0);
41 sys_dup(0);
42 sys_dup(0);
39 /* move initrd over / and chdir/chroot in initrd root */ 43 /* move initrd over / and chdir/chroot in initrd root */
40 sys_chdir("/root"); 44 sys_chdir("/root");
41 sys_mount(".", "/", NULL, MS_MOVE, NULL); 45 sys_mount(".", "/", NULL, MS_MOVE, NULL);
@@ -57,6 +61,9 @@ static void __init handle_initrd(void)
57 sys_mkdir("/old", 0700); 61 sys_mkdir("/old", 0700);
58 sys_chdir("/old"); 62 sys_chdir("/old");
59 63
64 /* try loading default modules from initrd */
65 load_default_modules();
66
60 /* 67 /*
61 * In case that a resume from disk is carried out by linuxrc or one of 68 * In case that a resume from disk is carried out by linuxrc or one of
62 * its children, we need to tell the freezer not to wait for us. 69 * its children, we need to tell the freezer not to wait for us.
diff --git a/init/init_task.c b/init/init_task.c
index 8b2f3996b035..ba0a7f362d9e 100644
--- a/init/init_task.c
+++ b/init/init_task.c
@@ -2,6 +2,8 @@
2#include <linux/export.h> 2#include <linux/export.h>
3#include <linux/mqueue.h> 3#include <linux/mqueue.h>
4#include <linux/sched.h> 4#include <linux/sched.h>
5#include <linux/sched/sysctl.h>
6#include <linux/sched/rt.h>
5#include <linux/init.h> 7#include <linux/init.h>
6#include <linux/fs.h> 8#include <linux/fs.h>
7#include <linux/mm.h> 9#include <linux/mm.h>
diff --git a/init/initramfs.c b/init/initramfs.c
index 84c6bf111300..a67ef9dbda9d 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -592,7 +592,7 @@ static int __init populate_rootfs(void)
592 initrd_end - initrd_start); 592 initrd_end - initrd_start);
593 if (!err) { 593 if (!err) {
594 free_initrd(); 594 free_initrd();
595 return 0; 595 goto done;
596 } else { 596 } else {
597 clean_rootfs(); 597 clean_rootfs();
598 unpack_to_rootfs(__initramfs_start, __initramfs_size); 598 unpack_to_rootfs(__initramfs_start, __initramfs_size);
@@ -607,6 +607,7 @@ static int __init populate_rootfs(void)
607 sys_close(fd); 607 sys_close(fd);
608 free_initrd(); 608 free_initrd();
609 } 609 }
610 done:
610#else 611#else
611 printk(KERN_INFO "Unpacking initramfs...\n"); 612 printk(KERN_INFO "Unpacking initramfs...\n");
612 err = unpack_to_rootfs((char *)initrd_start, 613 err = unpack_to_rootfs((char *)initrd_start,
@@ -615,6 +616,11 @@ static int __init populate_rootfs(void)
615 printk(KERN_EMERG "Initramfs unpacking failed: %s\n", err); 616 printk(KERN_EMERG "Initramfs unpacking failed: %s\n", err);
616 free_initrd(); 617 free_initrd();
617#endif 618#endif
619 /*
620 * Try loading default modules from initramfs. This gives
621 * us a chance to load before device_initcalls.
622 */
623 load_default_modules();
618 } 624 }
619 return 0; 625 return 0;
620} 626}
diff --git a/init/main.c b/init/main.c
index 85d69dffe864..63534a141b4e 100644
--- a/init/main.c
+++ b/init/main.c
@@ -70,6 +70,8 @@
70#include <linux/perf_event.h> 70#include <linux/perf_event.h>
71#include <linux/file.h> 71#include <linux/file.h>
72#include <linux/ptrace.h> 72#include <linux/ptrace.h>
73#include <linux/blkdev.h>
74#include <linux/elevator.h>
73 75
74#include <asm/io.h> 76#include <asm/io.h>
75#include <asm/bugs.h> 77#include <asm/bugs.h>
@@ -604,7 +606,7 @@ asmlinkage void __init start_kernel(void)
604 pidmap_init(); 606 pidmap_init();
605 anon_vma_init(); 607 anon_vma_init();
606#ifdef CONFIG_X86 608#ifdef CONFIG_X86
607 if (efi_enabled) 609 if (efi_enabled(EFI_RUNTIME_SERVICES))
608 efi_enter_virtual_mode(); 610 efi_enter_virtual_mode();
609#endif 611#endif
610 thread_info_cache_init(); 612 thread_info_cache_init();
@@ -632,7 +634,7 @@ asmlinkage void __init start_kernel(void)
632 acpi_early_init(); /* before LAPIC and SMP init */ 634 acpi_early_init(); /* before LAPIC and SMP init */
633 sfi_init_late(); 635 sfi_init_late();
634 636
635 if (efi_enabled) { 637 if (efi_enabled(EFI_RUNTIME_SERVICES)) {
636 efi_late_init(); 638 efi_late_init();
637 efi_free_boot_services(); 639 efi_free_boot_services();
638 } 640 }
@@ -794,6 +796,17 @@ static void __init do_pre_smp_initcalls(void)
794 do_one_initcall(*fn); 796 do_one_initcall(*fn);
795} 797}
796 798
799/*
800 * This function requests modules which should be loaded by default and is
801 * called twice right after initrd is mounted and right before init is
802 * exec'd. If such modules are on either initrd or rootfs, they will be
803 * loaded before control is passed to userland.
804 */
805void __init load_default_modules(void)
806{
807 load_default_elevator_module();
808}
809
797static int run_init_process(const char *init_filename) 810static int run_init_process(const char *init_filename)
798{ 811{
799 argv_init[0] = init_filename; 812 argv_init[0] = init_filename;
@@ -802,7 +815,7 @@ static int run_init_process(const char *init_filename)
802 (const char __user *const __user *)envp_init); 815 (const char __user *const __user *)envp_init);
803} 816}
804 817
805static void __init kernel_init_freeable(void); 818static noinline void __init kernel_init_freeable(void);
806 819
807static int __ref kernel_init(void *unused) 820static int __ref kernel_init(void *unused)
808{ 821{
@@ -845,7 +858,7 @@ static int __ref kernel_init(void *unused)
845 "See Linux Documentation/init.txt for guidance."); 858 "See Linux Documentation/init.txt for guidance.");
846} 859}
847 860
848static void __init kernel_init_freeable(void) 861static noinline void __init kernel_init_freeable(void)
849{ 862{
850 /* 863 /*
851 * Wait until kthreadd is all set-up. 864 * Wait until kthreadd is all set-up.
@@ -900,4 +913,7 @@ static void __init kernel_init_freeable(void)
900 * we're essentially up and running. Get rid of the 913 * we're essentially up and running. Get rid of the
901 * initmem segments and start the user-mode stuff.. 914 * initmem segments and start the user-mode stuff..
902 */ 915 */
916
917 /* rootfs is available now, try loading default modules */
918 load_default_modules();
903} 919}