]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
more timing debug
authorDavid Woodhouse <dwmw@amazon.co.uk>
Tue, 14 Dec 2021 17:22:37 +0000 (17:22 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Tue, 14 Dec 2021 17:36:30 +0000 (17:36 +0000)
Let's see how much is in the x86 code waking it up, and how much
is just waiting for it.

kernel/cpu.c

index 9979f670501b0a0f1b06d65c40996a68e53c272c..971f38a389dacb63a12f0a0d6a5c555da4c539ab 100644 (file)
@@ -586,20 +586,28 @@ static int bringup_cpu(unsigned int cpu)
 {
        struct task_struct *idle = idle_thread_get(cpu);
        int ret;
-
+       cycles_t t[3];
        /*
         * Some architectures have to walk the irq descriptors to
         * setup the vector space for the cpu which comes online.
         * Prevent irq alloc/free across the bringup.
         */
+       t[0] = get_cycles();
        irq_lock_sparse();
 
        /* Arch-specific enabling code. */
        ret = __cpu_up(cpu, idle);
        irq_unlock_sparse();
+       t[1] = get_cycles();
        if (ret)
                return ret;
-       return bringup_wait_for_ap(cpu);
+
+       ret = bringup_wait_for_ap(cpu);
+       t[2] = get_cycles();
+
+       printk("Bringup CPU %d took %lld, %lld cycles\n", cpu,
+              t[1] - t[0], t[2] - t[1]);
+       return ret;
 }
 
 static int finish_cpu(unsigned int cpu)