Convert amd64 clock and ipi event counters to per-cpu
authorjmatthew <jmatthew@openbsd.org>
Thu, 10 Nov 2022 08:26:54 +0000 (08:26 +0000)
committerjmatthew <jmatthew@openbsd.org>
Thu, 10 Nov 2022 08:26:54 +0000 (08:26 +0000)
ok kettenis@ jca@ cheloha@

sys/arch/amd64/amd64/ipi.c
sys/arch/amd64/amd64/lapic.c

index 1e0a688..4ec264a 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ipi.c,v 1.17 2020/01/21 02:01:50 mlarkin Exp $        */
+/*     $OpenBSD: ipi.c,v 1.18 2022/11/10 08:26:54 jmatthew Exp $       */
 /*     $NetBSD: ipi.c,v 1.2 2003/03/01 13:05:37 fvdl Exp $     */
 
 /*-
@@ -103,7 +103,7 @@ x86_ipi_handler(void)
                if (pending & (1 << bit)) {
                        pending &= ~(1 << bit);
                        (*ipifunc[bit])(ci);
-                       ipi_count.ec_count++;
+                       evcount_inc(&ipi_count);
                }
        }
 
index 3b8c9ea..1be0bf1 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: lapic.c,v 1.64 2022/11/08 17:34:13 cheloha Exp $      */
+/*     $OpenBSD: lapic.c,v 1.65 2022/11/10 08:26:54 jmatthew Exp $     */
 /* $NetBSD: lapic.c,v 1.2 2003/05/08 01:04:35 fvdl Exp $ */
 
 /*-
@@ -388,8 +388,10 @@ lapic_boot_init(paddr_t lapic_base)
 #endif
 
        evcount_attach(&clk_count, "clock", &clk_irq);
+       evcount_percpu(&clk_count);
 #ifdef MULTIPROCESSOR
        evcount_attach(&ipi_count, "ipi", &ipi_irq);
+       evcount_percpu(&ipi_count);
 #endif
 }
 
@@ -476,7 +478,7 @@ lapic_clockintr(void *arg, struct intrframe frame)
        clockintr_dispatch(&frame);
        ci->ci_handled_intr_level = floor;
 
-       clk_count.ec_count++;
+       evcount_inc(&clk_count);
 }
 
 void