From 57b33517ea3c83cbc6b2c45759ec2656bed82558 Mon Sep 17 00:00:00 2001 From: jmatthew Date: Thu, 10 Nov 2022 08:26:54 +0000 Subject: [PATCH] Convert amd64 clock and ipi event counters to per-cpu ok kettenis@ jca@ cheloha@ --- sys/arch/amd64/amd64/ipi.c | 4 ++-- sys/arch/amd64/amd64/lapic.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/arch/amd64/amd64/ipi.c b/sys/arch/amd64/amd64/ipi.c index 1e0a6881b42..4ec264a1288 100644 --- a/sys/arch/amd64/amd64/ipi.c +++ b/sys/arch/amd64/amd64/ipi.c @@ -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); } } diff --git a/sys/arch/amd64/amd64/lapic.c b/sys/arch/amd64/amd64/lapic.c index 3b8c9eaa15a..1be0bf12918 100644 --- a/sys/arch/amd64/amd64/lapic.c +++ b/sys/arch/amd64/amd64/lapic.c @@ -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 -- 2.20.1