From 9c2a0794960302480a8940f0cf43a9c7e73b93c7 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Thu, 9 Dec 2021 14:20:23 +0000 Subject: [PATCH] Print bringup timing Signed-off-by: David Woodhouse --- kernel/cpu.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/kernel/cpu.c b/kernel/cpu.c index 4a7791d74272c..b49f988ff9416 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -1506,6 +1506,7 @@ void bringup_nonboot_cpus(unsigned int setup_max_cpus) { unsigned int n = setup_max_cpus - num_online_cpus(); unsigned int cpu; + cycles_t t1, t2; /* * An architecture may have regustered parallel pre-bringup states to @@ -1518,22 +1519,29 @@ void bringup_nonboot_cpus(unsigned int setup_max_cpus) while (st <= CPUHP_BP_PARALLEL_DYN_END && cpuhp_hp_states[st].name) { int i = n; - + t1 = get_cycles(); for_each_present_cpu(cpu) { cpu_up(cpu, st); if (!--i) break; } + t2 = get_cycles(); + + printk("Brought %d CPUs to %s in %lld cycles\n", n - i, + cpuhp_hp_states[st].name, t2 - t1); st++; } } + t1 = get_cycles(); for_each_present_cpu(cpu) { if (num_online_cpus() >= setup_max_cpus) break; if (!cpu_online(cpu)) cpu_up(cpu, CPUHP_ONLINE); } + t2 = get_cycles(); + printk("Brought CPUs online in %lld cycles\n", t2 - t1); } #ifdef CONFIG_PM_SLEEP_SMP -- 2.50.1