]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
Print bringup timing
authorDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 9 Dec 2021 14:20:23 +0000 (14:20 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Tue, 1 Feb 2022 12:38:55 +0000 (12:38 +0000)
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
kernel/cpu.c

index cc6f9bb91fb25dfa0f59c464ed1e0fa4c331d6a4..52b0e0f252a5ffb72d49e02b91bc9a7f37e6301c 100644 (file)
@@ -1470,6 +1470,7 @@ void bringup_nonboot_cpus(unsigned int setup_max_cpus)
 {
        unsigned int cpu;
        int n = setup_max_cpus - num_online_cpus();
+       cycles_t t1, t2;
 
        /* ∀ parallel pre-bringup state, bring N CPUs to it */
        if (n > 0) {
@@ -1478,22 +1479,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