aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig4
-rw-r--r--init/calibrate.c11
-rw-r--r--init/main.c20
3 files changed, 28 insertions, 7 deletions
diff --git a/init/Kconfig b/init/Kconfig
index e20aa3112240..d62778390e55 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -673,7 +673,7 @@ config CGROUP_MEM_RES_CTLR_SWAP
673 be careful about enabling this. When memory resource controller 673 be careful about enabling this. When memory resource controller
674 is disabled by boot option, this will be automatically disabled and 674 is disabled by boot option, this will be automatically disabled and
675 there will be no overhead from this. Even when you set this config=y, 675 there will be no overhead from this. Even when you set this config=y,
676 if boot option "noswapaccount" is set, swap will not be accounted. 676 if boot option "swapaccount=0" is set, swap will not be accounted.
677 Now, memory usage of swap_cgroup is 2 bytes per entry. If swap page 677 Now, memory usage of swap_cgroup is 2 bytes per entry. If swap page
678 size is 4096bytes, 512k per 1Gbytes of swap. 678 size is 4096bytes, 512k per 1Gbytes of swap.
679config CGROUP_MEM_RES_CTLR_SWAP_ENABLED 679config CGROUP_MEM_RES_CTLR_SWAP_ENABLED
@@ -688,7 +688,7 @@ config CGROUP_MEM_RES_CTLR_SWAP_ENABLED
688 parameter should have this option unselected. 688 parameter should have this option unselected.
689 For those who want to have the feature enabled by default should 689 For those who want to have the feature enabled by default should
690 select this option (if, for some reason, they need to disable it 690 select this option (if, for some reason, they need to disable it
691 then noswapaccount does the trick). 691 then swapaccount=0 does the trick).
692 692
693config CGROUP_PERF 693config CGROUP_PERF
694 bool "Enable perf_event per-cpu per-container group (cgroup) monitoring" 694 bool "Enable perf_event per-cpu per-container group (cgroup) monitoring"
diff --git a/init/calibrate.c b/init/calibrate.c
index aae2f40fea4c..24df7976816c 100644
--- a/init/calibrate.c
+++ b/init/calibrate.c
@@ -9,6 +9,7 @@
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/timex.h> 10#include <linux/timex.h>
11#include <linux/smp.h> 11#include <linux/smp.h>
12#include <linux/percpu.h>
12 13
13unsigned long lpj_fine; 14unsigned long lpj_fine;
14unsigned long preset_lpj; 15unsigned long preset_lpj;
@@ -243,12 +244,19 @@ recalibrate:
243 return lpj; 244 return lpj;
244} 245}
245 246
247static DEFINE_PER_CPU(unsigned long, cpu_loops_per_jiffy) = { 0 };
248
246void __cpuinit calibrate_delay(void) 249void __cpuinit calibrate_delay(void)
247{ 250{
248 unsigned long lpj; 251 unsigned long lpj;
249 static bool printed; 252 static bool printed;
253 int this_cpu = smp_processor_id();
250 254
251 if (preset_lpj) { 255 if (per_cpu(cpu_loops_per_jiffy, this_cpu)) {
256 lpj = per_cpu(cpu_loops_per_jiffy, this_cpu);
257 pr_info("Calibrating delay loop (skipped) "
258 "already calibrated this CPU");
259 } else if (preset_lpj) {
252 lpj = preset_lpj; 260 lpj = preset_lpj;
253 if (!printed) 261 if (!printed)
254 pr_info("Calibrating delay loop (skipped) " 262 pr_info("Calibrating delay loop (skipped) "
@@ -266,6 +274,7 @@ void __cpuinit calibrate_delay(void)
266 pr_info("Calibrating delay loop... "); 274 pr_info("Calibrating delay loop... ");
267 lpj = calibrate_delay_converge(); 275 lpj = calibrate_delay_converge();
268 } 276 }
277 per_cpu(cpu_loops_per_jiffy, this_cpu) = lpj;
269 if (!printed) 278 if (!printed)
270 pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n", 279 pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n",
271 lpj/(500000/HZ), 280 lpj/(500000/HZ),
diff --git a/init/main.c b/init/main.c
index d7211faed2ad..03b408dff825 100644
--- a/init/main.c
+++ b/init/main.c
@@ -209,8 +209,19 @@ early_param("quiet", quiet_kernel);
209 209
210static int __init loglevel(char *str) 210static int __init loglevel(char *str)
211{ 211{
212 get_option(&str, &console_loglevel); 212 int newlevel;
213 return 0; 213
214 /*
215 * Only update loglevel value when a correct setting was passed,
216 * to prevent blind crashes (when loglevel being set to 0) that
217 * are quite hard to debug
218 */
219 if (get_option(&str, &newlevel)) {
220 console_loglevel = newlevel;
221 return 0;
222 }
223
224 return -EINVAL;
214} 225}
215 226
216early_param("loglevel", loglevel); 227early_param("loglevel", loglevel);
@@ -369,9 +380,9 @@ static noinline void __init_refok rest_init(void)
369 init_idle_bootup_task(current); 380 init_idle_bootup_task(current);
370 preempt_enable_no_resched(); 381 preempt_enable_no_resched();
371 schedule(); 382 schedule();
372 preempt_disable();
373 383
374 /* Call into cpu_idle with preempt disabled */ 384 /* Call into cpu_idle with preempt disabled */
385 preempt_disable();
375 cpu_idle(); 386 cpu_idle();
376} 387}
377 388
@@ -715,10 +726,11 @@ static void __init do_basic_setup(void)
715{ 726{
716 cpuset_init_smp(); 727 cpuset_init_smp();
717 usermodehelper_init(); 728 usermodehelper_init();
718 init_tmpfs(); 729 shmem_init();
719 driver_init(); 730 driver_init();
720 init_irq_proc(); 731 init_irq_proc();
721 do_ctors(); 732 do_ctors();
733 usermodehelper_enable();
722 do_initcalls(); 734 do_initcalls();
723} 735}
724 736