Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 07 May 2011 12:37:26 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        current@FreeBSD.org
Subject:   COUNT_IPIS vs CPU_FOREACH
Message-ID:  <4DC512D6.9070904@FreeBSD.org>

next in thread | raw e-mail | index | archive | help

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4DC512D6.9070904>