aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig41
-rw-r--r--init/main.c53
2 files changed, 76 insertions, 18 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 4389cee99db0..fed6dc31b0da 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -302,13 +302,14 @@ config AUDITSYSCALL
302 302
303config AUDIT_TREE 303config AUDIT_TREE
304 def_bool y 304 def_bool y
305 depends on AUDITSYSCALL && INOTIFY 305 depends on AUDITSYSCALL
306 select INOTIFY
306 307
307menu "RCU Subsystem" 308menu "RCU Subsystem"
308 309
309choice 310choice
310 prompt "RCU Implementation" 311 prompt "RCU Implementation"
311 default CLASSIC_RCU 312 default TREE_RCU
312 313
313config CLASSIC_RCU 314config CLASSIC_RCU
314 bool "Classic RCU" 315 bool "Classic RCU"
@@ -925,6 +926,42 @@ config AIO
925 by some high performance threaded applications. Disabling 926 by some high performance threaded applications. Disabling
926 this option saves about 7k. 927 this option saves about 7k.
927 928
929config HAVE_PERF_COUNTERS
930 bool
931 help
932 See tools/perf/design.txt for details.
933
934menu "Performance Counters"
935
936config PERF_COUNTERS
937 bool "Kernel Performance Counters"
938 depends on HAVE_PERF_COUNTERS
939 select ANON_INODES
940 help
941 Enable kernel support for performance counter hardware.
942
943 Performance counters are special hardware registers available
944 on most modern CPUs. These registers count the number of certain
945 types of hw events: such as instructions executed, cachemisses
946 suffered, or branches mis-predicted - without slowing down the
947 kernel or applications. These registers can also trigger interrupts
948 when a threshold number of events have passed - and can thus be
949 used to profile the code that runs on that CPU.
950
951 The Linux Performance Counter subsystem provides an abstraction of
952 these hardware capabilities, available via a system call. It
953 provides per task and per CPU counters, and it provides event
954 capabilities on top of those.
955
956 Say Y if unsure.
957
958config EVENT_PROFILE
959 bool "Tracepoint profile sources"
960 depends on PERF_COUNTERS && EVENT_TRACER
961 default y
962
963endmenu
964
928config VM_EVENT_COUNTERS 965config VM_EVENT_COUNTERS
929 default y 966 default y
930 bool "Enable VM event counters for /proc/vmstat" if EMBEDDED 967 bool "Enable VM event counters for /proc/vmstat" if EMBEDDED
diff --git a/init/main.c b/init/main.c
index d721dad05dd7..f6204f712e7c 100644
--- a/init/main.c
+++ b/init/main.c
@@ -56,6 +56,7 @@
56#include <linux/debug_locks.h> 56#include <linux/debug_locks.h>
57#include <linux/debugobjects.h> 57#include <linux/debugobjects.h>
58#include <linux/lockdep.h> 58#include <linux/lockdep.h>
59#include <linux/kmemleak.h>
59#include <linux/pid_namespace.h> 60#include <linux/pid_namespace.h>
60#include <linux/device.h> 61#include <linux/device.h>
61#include <linux/kthread.h> 62#include <linux/kthread.h>
@@ -64,6 +65,7 @@
64#include <linux/idr.h> 65#include <linux/idr.h>
65#include <linux/ftrace.h> 66#include <linux/ftrace.h>
66#include <linux/async.h> 67#include <linux/async.h>
68#include <linux/kmemtrace.h>
67#include <trace/boot.h> 69#include <trace/boot.h>
68 70
69#include <asm/io.h> 71#include <asm/io.h>
@@ -71,7 +73,6 @@
71#include <asm/setup.h> 73#include <asm/setup.h>
72#include <asm/sections.h> 74#include <asm/sections.h>
73#include <asm/cacheflush.h> 75#include <asm/cacheflush.h>
74#include <trace/kmemtrace.h>
75 76
76#ifdef CONFIG_X86_LOCAL_APIC 77#ifdef CONFIG_X86_LOCAL_APIC
77#include <asm/smp.h> 78#include <asm/smp.h>
@@ -533,6 +534,21 @@ void __init __weak thread_info_cache_init(void)
533{ 534{
534} 535}
535 536
537/*
538 * Set up kernel memory allocators
539 */
540static void __init mm_init(void)
541{
542 /*
543 * page_cgroup requires countinous pages as memmap
544 * and it's bigger than MAX_ORDER unless SPARSEMEM.
545 */
546 page_cgroup_init_flatmem();
547 mem_init();
548 kmem_cache_init();
549 vmalloc_init();
550}
551
536asmlinkage void __init start_kernel(void) 552asmlinkage void __init start_kernel(void)
537{ 553{
538 char * command_line; 554 char * command_line;
@@ -574,6 +590,23 @@ asmlinkage void __init start_kernel(void)
574 setup_nr_cpu_ids(); 590 setup_nr_cpu_ids();
575 smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */ 591 smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */
576 592
593 build_all_zonelists();
594 page_alloc_init();
595
596 printk(KERN_NOTICE "Kernel command line: %s\n", boot_command_line);
597 parse_early_param();
598 parse_args("Booting kernel", static_command_line, __start___param,
599 __stop___param - __start___param,
600 &unknown_bootoption);
601 /*
602 * These use large bootmem allocations and must precede
603 * kmem_cache_init()
604 */
605 pidhash_init();
606 vfs_caches_init_early();
607 sort_main_extable();
608 trap_init();
609 mm_init();
577 /* 610 /*
578 * Set up the scheduler prior starting any interrupts (such as the 611 * Set up the scheduler prior starting any interrupts (such as the
579 * timer interrupt). Full topology setup happens at smp_init() 612 * timer interrupt). Full topology setup happens at smp_init()
@@ -585,25 +618,16 @@ asmlinkage void __init start_kernel(void)
585 * fragile until we cpu_idle() for the first time. 618 * fragile until we cpu_idle() for the first time.
586 */ 619 */
587 preempt_disable(); 620 preempt_disable();
588 build_all_zonelists();
589 page_alloc_init();
590 printk(KERN_NOTICE "Kernel command line: %s\n", boot_command_line);
591 parse_early_param();
592 parse_args("Booting kernel", static_command_line, __start___param,
593 __stop___param - __start___param,
594 &unknown_bootoption);
595 if (!irqs_disabled()) { 621 if (!irqs_disabled()) {
596 printk(KERN_WARNING "start_kernel(): bug: interrupts were " 622 printk(KERN_WARNING "start_kernel(): bug: interrupts were "
597 "enabled *very* early, fixing it\n"); 623 "enabled *very* early, fixing it\n");
598 local_irq_disable(); 624 local_irq_disable();
599 } 625 }
600 sort_main_extable();
601 trap_init();
602 rcu_init(); 626 rcu_init();
603 /* init some links before init_ISA_irqs() */ 627 /* init some links before init_ISA_irqs() */
604 early_irq_init(); 628 early_irq_init();
605 init_IRQ(); 629 init_IRQ();
606 pidhash_init(); 630 prio_tree_init();
607 init_timers(); 631 init_timers();
608 hrtimers_init(); 632 hrtimers_init();
609 softirq_init(); 633 softirq_init();
@@ -616,6 +640,7 @@ asmlinkage void __init start_kernel(void)
616 "enabled early\n"); 640 "enabled early\n");
617 early_boot_irqs_on(); 641 early_boot_irqs_on();
618 local_irq_enable(); 642 local_irq_enable();
643 kmem_cache_init_late();
619 644
620 /* 645 /*
621 * HACK ALERT! This is early. We're enabling the console before 646 * HACK ALERT! This is early. We're enabling the console before
@@ -645,15 +670,12 @@ asmlinkage void __init start_kernel(void)
645 initrd_start = 0; 670 initrd_start = 0;
646 } 671 }
647#endif 672#endif
648 vmalloc_init();
649 vfs_caches_init_early();
650 cpuset_init_early(); 673 cpuset_init_early();
651 page_cgroup_init(); 674 page_cgroup_init();
652 mem_init();
653 enable_debug_pagealloc(); 675 enable_debug_pagealloc();
654 cpu_hotplug_init(); 676 cpu_hotplug_init();
655 kmem_cache_init();
656 kmemtrace_init(); 677 kmemtrace_init();
678 kmemleak_init();
657 debug_objects_mem_init(); 679 debug_objects_mem_init();
658 idr_init_cache(); 680 idr_init_cache();
659 setup_per_cpu_pageset(); 681 setup_per_cpu_pageset();
@@ -663,7 +685,6 @@ asmlinkage void __init start_kernel(void)
663 calibrate_delay(); 685 calibrate_delay();
664 pidmap_init(); 686 pidmap_init();
665 pgtable_cache_init(); 687 pgtable_cache_init();
666 prio_tree_init();
667 anon_vma_init(); 688 anon_vma_init();
668#ifdef CONFIG_X86 689#ifdef CONFIG_X86
669 if (efi_enabled) 690 if (efi_enabled)