summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>2002-04-04 21:38:47 +0000
committerdillon <dillon@FreeBSD.org>2002-04-04 21:38:47 +0000
commita74c71d7cd207a74d1a201cb8b58253e42e412bf (patch)
tree145ba66a57ff6db67725dd5e965f3db61810cc51 /sys/i386
parentcc9830e3c2e98230b0991e00e57a5c2706cbad81 (diff)
downloadFreeBSD-src-a74c71d7cd207a74d1a201cb8b58253e42e412bf.zip
FreeBSD-src-a74c71d7cd207a74d1a201cb8b58253e42e412bf.tar.gz
Embed a struct vmmeter in the per-cpu structure and add a macro,
PCPU_LAZY_INC() which increments elements in it for cases where we can afford the occassional inaccuracy. Use of per-cpu stats counters avoids significant cache stalls in various critical paths that would otherwise severely limit our cpu scaleability. Adjust all sysctl's accessing cnt.* elements to now use a procedure which aggregates the requested field for all cpus and for the global vmmeter. The global vmmeter is retained, since some stats counters, like v_free_min, cannot be made per-cpu. Also, this allows us to convert counters from the global vmmeter to the per-cpu vmmeter in a piecemeal fashion, so have at it!
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/trap.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c
index b039284..30af1b6 100644
--- a/sys/i386/i386/trap.c
+++ b/sys/i386/i386/trap.c
@@ -941,7 +941,11 @@ syscall(frame)
int args[8];
u_int code;
- atomic_add_int(&cnt.v_syscall, 1);
+ /*
+ * note: PCPU_LAZY_INC() can only be used if we can afford
+ * occassional inaccuracy in the count.
+ */
+ PCPU_LAZY_INC(cnt.v_syscall);
#ifdef DIAGNOSTIC
if (ISPL(frame.tf_cs) != SEL_UPL) {
OpenPOWER on IntegriCloud