return ret;
}
+extern cycles_t cpu_up_times[100];
+#define t cpu_up_times
int native_cpu_up(unsigned int cpu, struct task_struct *tidle)
{
int ret;
+ t[3] = get_cycles();
/* If parallel AP bringup isn't enabled, perform the first steps now. */
if (!do_parallel_bringup) {
ret = do_cpu_up(cpu, tidle);
return ret;
}
+ t[4] = get_cycles();
+
ret = do_wait_cpu_callin(cpu);
if (ret)
return ret;
-
+ t[5] = get_cycles();
ret = do_wait_cpu_online(cpu);
-
+ t[6] = get_cycles();
if (x86_platform.legacy.warm_reset) {
/*
* Cleanup possible dangling ends...
*/
smpboot_restore_warm_reset_vector();
}
-
+ t[7] = get_cycles();
return ret;
}
return ret;
}
+cycles_t cpu_up_times[100];
+#define t cpu_up_times
+
static int bringup_wait_for_ap(unsigned int cpu)
{
struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu);
/* Wait for the CPU to reach CPUHP_AP_ONLINE_IDLE */
wait_for_ap_thread(st, true);
+ t[9] = get_cycles();
if (WARN_ON_ONCE((!cpu_online(cpu))))
return -ECANCELED;
irq_unlock_sparse();
if (ret)
return ret;
+ t[8] = get_cycles();
return bringup_wait_for_ap(cpu);
}
if (st->state >= target)
goto out;
+ t[0] = get_cycles();
if (st->state == CPUHP_OFFLINE) {
/* Let it fail before we try to bring the cpu up */
idle = idle_thread_get(cpu);
* If the current CPU state is in the range of the AP hotplug thread,
* then we need to kick the thread once more.
*/
+ t[1] = get_cycles();
if (st->state > CPUHP_BRINGUP_CPU) {
ret = cpuhp_kick_ap_work(cpu);
/*
if (ret)
goto out;
}
-
+ t[2] = get_cycles();
/*
* Try to reach the target state. We max out on the BP at
* CPUHP_BRINGUP_CPU. After that the AP hotplug thread is
*/
target = min((int)target, CPUHP_BRINGUP_CPU);
ret = cpuhp_up_callbacks(cpu, st, target);
+ t[10] = get_cycles();
+
+ printk("CPU %d to %d/%s in %lld %lld %lld %lld . %lld %lld %lld %lld . %lld %lld\n", cpu, target,
+ cpuhp_hp_states[target].name, t[1] - t[0], t[2] - t[1], t[3] - t[2], t[4] - t[3],
+ t[5] - t[4], t[6] - t[5], t[7] - t[6], t[8] - t[7], t[9] - t[8], t[10] - t[9]);
out:
cpus_write_unlock();
arch_smt_update();