COUNT_IPIS vs CPU_FOREACH

Andriy Gapon avg at FreeBSD.org
Sat May 7 09:37:30 UTC 2011


I believe that the following change is needed to fix COUNT_IPIS option.
Right now it seems to be a noop.


    mp_ipi_intrcnt: CPU_FOREACH can't be used this early

    ... because all_cpus is not set yet.

diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c
index 33bb424..3d957ec 100644
--- a/sys/amd64/amd64/mp_machdep.c
+++ b/sys/amd64/amd64/mp_machdep.c
@@ -1687,7 +1687,7 @@ mp_ipi_intrcnt(void *dummy)
 	char buf[64];
 	int i;

-	CPU_FOREACH(i) {
+	for (i = 0; i <= mp_maxid; i++) {
 		snprintf(buf, sizeof(buf), "cpu%d:invltlb", i);
 		intrcnt_add(buf, &ipi_invltlb_counts[i]);
 		snprintf(buf, sizeof(buf), "cpu%d:invlrng", i);

-- 
Andriy Gapon


More information about the freebsd-current mailing list