Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/xen/xen add event counter for the unaligned map to ...



details:   https://anonhg.NetBSD.org/src/rev/34f0236afd28
branches:  trunk
changeset: 365660:34f0236afd28
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sun Aug 26 21:04:16 2018 +0000

description:
add event counter for the unaligned map to get a handle on how often this
actually happens

diffstat:

 sys/arch/xen/xen/xbd_xenbus.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (54 lines):

diff -r 61a87168036e -r 34f0236afd28 sys/arch/xen/xen/xbd_xenbus.c
--- a/sys/arch/xen/xen/xbd_xenbus.c     Sun Aug 26 18:57:24 2018 +0000
+++ b/sys/arch/xen/xen/xbd_xenbus.c     Sun Aug 26 21:04:16 2018 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: xbd_xenbus.c,v 1.87 2018/08/26 11:31:56 bouyer Exp $      */
+/*      $NetBSD: xbd_xenbus.c,v 1.88 2018/08/26 21:04:16 jdolecek Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.87 2018/08/26 11:31:56 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.88 2018/08/26 21:04:16 jdolecek Exp $");
 
 #include "opt_xen.h"
 
@@ -151,6 +151,7 @@
        u_long sc_info; /* VDISK_* */
        u_long sc_handle; /* from backend */
        int sc_cache_flush; /* backend supports BLKIF_OP_FLUSH_DISKCACHE */
+       struct evcnt sc_cnt_map_unalign;
 };
 
 #if 0
@@ -301,6 +302,9 @@
                panic("%s: can't alloc ring", device_xname(self));
        sc->sc_ring.sring = ring;
 
+       evcnt_attach_dynamic(&sc->sc_cnt_map_unalign, EVCNT_TYPE_MISC,
+           NULL, device_xname(self), "map unaligned");
+
        /* resume shared structures and tell backend that we are ready */
        if (xbd_xenbus_resume(self, PMF_Q_NONE) == false) {
                uvm_km_free(kernel_map, (vaddr_t)ring, PAGE_SIZE,
@@ -384,6 +388,8 @@
        uvm_km_free(kernel_map, (vaddr_t)sc->sc_ring.sring,
            PAGE_SIZE, UVM_KMF_WIRED);
 
+       evcnt_detach(&sc->sc_cnt_map_unalign);
+
        pmf_device_deregister(dev);
 
        return 0;
@@ -982,6 +988,8 @@
        xbdreq->req_bp = bp;
        xbdreq->req_data = bp->b_data;
        if (__predict_false((vaddr_t)bp->b_data & (XEN_BSIZE - 1))) {
+               sc->sc_cnt_map_unalign.ev_count++;
+
                if (__predict_false(xbd_map_align(xbdreq) != 0)) {
                        DPRINTF(("xbd_diskstart: no align\n"));
                        error = EAGAIN;



Home | Main Index | Thread Index | Old Index