Statistics for high memory flips in the buffer cache
authorbeck <beck@openbsd.org>
Sun, 16 Apr 2017 14:24:03 +0000 (14:24 +0000)
committerbeck <beck@openbsd.org>
Sun, 16 Apr 2017 14:24:03 +0000 (14:24 +0000)
nits from deraadt@
ok krw@ guenther@ kettenis@

sys/sys/mount.h
usr.bin/systat/iostat.c

index 90ce21e..8a58bcd 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: mount.h,v 1.129 2017/04/15 13:56:43 bluhm Exp $       */
+/*     $OpenBSD: mount.h,v 1.130 2017/04/16 14:24:03 beck Exp $        */
 /*     $NetBSD: mount.h,v 1.48 1996/02/18 11:55:47 fvdl Exp $  */
 
 /*
@@ -487,6 +487,9 @@ struct bcachestats {
        int64_t delwribufs;             /* delayed write buffers */
        int64_t kvaslots;               /* kva slots total */
        int64_t kvaslots_avail;         /* available kva slots */
+       int64_t highflips;              /* total flips to above DMA */
+       int64_t highflops;              /* total failed flips to above DMA */
+       int64_t dmaflips;               /* total flips from high to DMA */
 };
 #ifdef _KERNEL
 extern struct bcachestats bcstats;
index a0bb03e..ae32ff0 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: iostat.c,v 1.46 2017/04/02 00:27:44 beck Exp $        */
+/*     $OpenBSD: iostat.c,v 1.47 2017/04/16 14:24:03 beck Exp $        */
 /*     $NetBSD: iostat.c,v 1.5 1996/05/10 23:16:35 thorpej Exp $       */
 
 /*
@@ -257,4 +257,16 @@ showbcache(void)
        print_fld_str(FLD_IO_SSTR, "cache hits");
        print_fld_ssize(FLD_IO_SVAL, bccur.cachehits - bclast.cachehits);
        end_line();
+
+       print_fld_str(FLD_IO_SSTR, "high flips");
+       print_fld_ssize(FLD_IO_SVAL, bccur.highflips - bclast.highflips);
+       end_line();
+
+       print_fld_str(FLD_IO_SSTR, "high flops");
+       print_fld_ssize(FLD_IO_SVAL, bccur.highflops - bclast.highflops);
+       end_line();
+
+       print_fld_str(FLD_IO_SSTR, "dma flips");
+       print_fld_ssize(FLD_IO_SVAL, bccur.dmaflips - bclast.dmaflips);
+       end_line();
 }