From 91494170333015a14aaa858c39f25cd2f9031c3a Mon Sep 17 00:00:00 2001 From: Sameer Nanda Date: Mon, 25 Jul 2011 17:13:29 -0700 Subject: [PATCH] --- yaml --- r: 259029 b: refs/heads/master c: 7afe1845dd1e7c90828c942daed7e57ffa7c38d6 h: refs/heads/master i: 259027: 3f9e180830de1a2f9378517621cd9ab09935f9d9 v: v3 --- [refs] | 2 +- trunk/init/calibrate.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 9c824875e01b..93e2de59649b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 469dded1839105cfbfc265376e23e24dbc48d2a7 +refs/heads/master: 7afe1845dd1e7c90828c942daed7e57ffa7c38d6 diff --git a/trunk/init/calibrate.c b/trunk/init/calibrate.c index aae2f40fea4c..24df7976816c 100644 --- a/trunk/init/calibrate.c +++ b/trunk/init/calibrate.c @@ -9,6 +9,7 @@ #include #include #include +#include unsigned long lpj_fine; unsigned long preset_lpj; @@ -243,12 +244,19 @@ static unsigned long __cpuinit calibrate_delay_converge(void) return lpj; } +static DEFINE_PER_CPU(unsigned long, cpu_loops_per_jiffy) = { 0 }; + void __cpuinit calibrate_delay(void) { unsigned long lpj; static bool printed; + int this_cpu = smp_processor_id(); - if (preset_lpj) { + if (per_cpu(cpu_loops_per_jiffy, this_cpu)) { + lpj = per_cpu(cpu_loops_per_jiffy, this_cpu); + pr_info("Calibrating delay loop (skipped) " + "already calibrated this CPU"); + } else if (preset_lpj) { lpj = preset_lpj; if (!printed) pr_info("Calibrating delay loop (skipped) " @@ -266,6 +274,7 @@ void __cpuinit calibrate_delay(void) pr_info("Calibrating delay loop... "); lpj = calibrate_delay_converge(); } + per_cpu(cpu_loops_per_jiffy, this_cpu) = lpj; if (!printed) pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n", lpj/(500000/HZ),