From 19adcef673ab8dead1a515bf1d880c3beb175c10 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Tue, 14 Dec 2021 16:46:30 +0000 Subject: [PATCH] Print per-phase x86 timing --- arch/x86/kernel/smpboot.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 725fede281ace..4fde609107d84 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -1338,7 +1338,9 @@ early_param("no_parallel_bringup", no_parallel_bringup); int native_cpu_up(unsigned int cpu, struct task_struct *tidle) { int ret; + cycles_t t[5]; + t[0] = get_cycles(); /* If parallel AP bringup isn't enabled, perform the first steps now. */ if (!do_parallel_bringup) { ret = do_cpu_up(cpu, tidle); @@ -1346,16 +1348,24 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle) return ret; } + t[1] = get_cycles(); ret = do_wait_cpu_initialized(cpu); if (ret) return ret; + t[2] = get_cycles(); ret = do_wait_cpu_callin(cpu); if (ret) return ret; + t[3] = get_cycles(); ret = do_wait_cpu_online(cpu); + t[4] = get_cycles(); + + printk("Brought up CPU %d in %lld, %lld, %lld, %lld, cycles\n", cpu, + t[1] - t[0], t[2] - t[1], t[3] - t[2], t[4] - t[3]); + if (x86_platform.legacy.warm_reset) { /* * Cleanup possible dangling ends... -- 2.50.1