aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig30
-rw-r--r--init/main.c19
2 files changed, 43 insertions, 6 deletions
diff --git a/init/Kconfig b/init/Kconfig
index f068071fcc5d..5a3ad5c20e2b 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -869,6 +869,36 @@ config AIO
869 by some high performance threaded applications. Disabling 869 by some high performance threaded applications. Disabling
870 this option saves about 7k. 870 this option saves about 7k.
871 871
872config HAVE_PERF_COUNTERS
873 bool
874
875menu "Performance Counters"
876
877config PERF_COUNTERS
878 bool "Kernel Performance Counters"
879 depends on HAVE_PERF_COUNTERS
880 default y
881 select ANON_INODES
882 help
883 Enable kernel support for performance counter hardware.
884
885 Performance counters are special hardware registers available
886 on most modern CPUs. These registers count the number of certain
887 types of hw events: such as instructions executed, cachemisses
888 suffered, or branches mis-predicted - without slowing down the
889 kernel or applications. These registers can also trigger interrupts
890 when a threshold number of events have passed - and can thus be
891 used to profile the code that runs on that CPU.
892
893 The Linux Performance Counter subsystem provides an abstraction of
894 these hardware capabilities, available via a system call. It
895 provides per task and per CPU counters, and it provides event
896 capabilities on top of those.
897
898 Say Y if unsure.
899
900endmenu
901
872config VM_EVENT_COUNTERS 902config VM_EVENT_COUNTERS
873 default y 903 default y
874 bool "Enable VM event counters for /proc/vmstat" if EMBEDDED 904 bool "Enable VM event counters for /proc/vmstat" if EMBEDDED
diff --git a/init/main.c b/init/main.c
index 83697e160b3a..6bf83afd654d 100644
--- a/init/main.c
+++ b/init/main.c
@@ -14,6 +14,7 @@
14#include <linux/proc_fs.h> 14#include <linux/proc_fs.h>
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/syscalls.h> 16#include <linux/syscalls.h>
17#include <linux/stackprotector.h>
17#include <linux/string.h> 18#include <linux/string.h>
18#include <linux/ctype.h> 19#include <linux/ctype.h>
19#include <linux/delay.h> 20#include <linux/delay.h>
@@ -135,14 +136,14 @@ unsigned int __initdata setup_max_cpus = NR_CPUS;
135 * greater than 0, limits the maximum number of CPUs activated in 136 * greater than 0, limits the maximum number of CPUs activated in
136 * SMP mode to <NUM>. 137 * SMP mode to <NUM>.
137 */ 138 */
138#ifndef CONFIG_X86_IO_APIC 139
139static inline void disable_ioapic_setup(void) {}; 140void __weak arch_disable_smp_support(void) { }
140#endif
141 141
142static int __init nosmp(char *str) 142static int __init nosmp(char *str)
143{ 143{
144 setup_max_cpus = 0; 144 setup_max_cpus = 0;
145 disable_ioapic_setup(); 145 arch_disable_smp_support();
146
146 return 0; 147 return 0;
147} 148}
148 149
@@ -152,14 +153,14 @@ static int __init maxcpus(char *str)
152{ 153{
153 get_option(&str, &setup_max_cpus); 154 get_option(&str, &setup_max_cpus);
154 if (setup_max_cpus == 0) 155 if (setup_max_cpus == 0)
155 disable_ioapic_setup(); 156 arch_disable_smp_support();
156 157
157 return 0; 158 return 0;
158} 159}
159 160
160early_param("maxcpus", maxcpus); 161early_param("maxcpus", maxcpus);
161#else 162#else
162#define setup_max_cpus NR_CPUS 163const unsigned int setup_max_cpus = NR_CPUS;
163#endif 164#endif
164 165
165/* 166/*
@@ -540,6 +541,12 @@ asmlinkage void __init start_kernel(void)
540 */ 541 */
541 lockdep_init(); 542 lockdep_init();
542 debug_objects_early_init(); 543 debug_objects_early_init();
544
545 /*
546 * Set up the the initial canary ASAP:
547 */
548 boot_init_stack_canary();
549
543 cgroup_init_early(); 550 cgroup_init_early();
544 551
545 local_irq_disable(); 552 local_irq_disable();