]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
xen-blkback: add pending_req allocation stats
authorAnkur Arora <ankur.a.arora@oracle.com>
Thu, 4 Jan 2018 12:48:43 +0000 (07:48 -0500)
committerAnkur Arora <ankur.a.arora@oracle.com>
Wed, 17 Jan 2018 17:59:47 +0000 (12:59 -0500)
Add statistics to count direct and indirect pending_req allocations
separately.

Orabug: 26670475

Reviewed-by: Bhavesh Davda <bhavesh.davda@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Ankur Arora <ankur.a.arora@oracle.com>
drivers/block/xen-blkback/blkback.c
drivers/block/xen-blkback/common.h
drivers/block/xen-blkback/xenbus.c

index 919c48a6cf6d82f99a43415a2e3ec0733e8d337f..523769d7e2b9e46b2e50d09fe0f3febf752d9de8 100644 (file)
@@ -476,8 +476,13 @@ static struct pending_req *alloc_req(struct xen_blkif_ring *ring, unsigned int n
                        ring->st_oo_req++;
                }
                spin_unlock_irqrestore(&ring->pending_free_lock, flags);
+
+               ring->st_req_direct++;
        } else {
                req = xen_blkbk_alloc_req(nsegs, true /* indirect req */);
+               if (!req)
+                       ring->st_oo_req_indirect++;
+               ring->st_req_indirect++;
        }
 
        return req;
@@ -600,18 +605,24 @@ irqreturn_t xen_blkif_be_int(int irq, void *dev_id)
 
 static void print_stats(struct xen_blkif_ring *ring)
 {
-       pr_info("(%s): oo %3llu  |  rd %4llu  |  wr %4llu  |  f %4llu"
-                "  |  ds %4llu | pg: %4u/%4d\n",
-                current->comm, ring->st_oo_req,
-                ring->st_rd_req, ring->st_wr_req,
-                ring->st_f_req, ring->st_ds_req,
-                ring->persistent_gnt_c,
-                xen_blkif_max_pgrants);
+       pr_info("(%s): d   %8llu  |  i %8llu  |  oo %3llu  |"
+               "  ooi %3llu  |  rd %4llu  |  wr %4llu  |  f %4llu"
+               "  |  ds %4llu | pg: %4u/%4d\n", current->comm,
+               ring->st_req_direct, ring->st_req_indirect,
+               ring->st_oo_req, ring->st_oo_req_indirect,
+               ring->st_rd_req, ring->st_wr_req,
+               ring->st_f_req, ring->st_ds_req,
+               ring->persistent_gnt_c,
+               xen_blkif_max_pgrants);
+
        ring->st_print = jiffies + msecs_to_jiffies(10 * 1000);
        ring->st_rd_req = 0;
        ring->st_wr_req = 0;
        ring->st_oo_req = 0;
        ring->st_ds_req = 0;
+       ring->st_req_direct = 0;
+       ring->st_req_indirect = 0;
+       ring->st_oo_req_indirect = 0;
 }
 
 int xen_blkif_schedule(void *arg)
index 7dd81544bd9a744612eff4dbd71eafa8c11b3a7d..8bb31d26cdf74c0e47e34b1cdef76d5acadede0d 100644 (file)
@@ -292,6 +292,9 @@ struct xen_blkif_ring {
        unsigned long long      st_ds_req;
        unsigned long long      st_rd_sect;
        unsigned long long      st_wr_sect;
+       unsigned long long      st_req_direct;
+       unsigned long long      st_req_indirect;
+       unsigned long long      st_oo_req_indirect;
 
        /* Used by the kworker that offload work from the persistent purge. */
        struct list_head        persistent_purge_list;
index 70c958ff068d355468f159b14e99b91e89ba1385..59dd6c606f30c5e7cab55ef55680dd5715c67767 100644 (file)
@@ -365,6 +365,9 @@ VBD_SHOW_ALLRING(f_req,  "%llu\n");
 VBD_SHOW_ALLRING(ds_req,  "%llu\n");
 VBD_SHOW_ALLRING(rd_sect, "%llu\n");
 VBD_SHOW_ALLRING(wr_sect, "%llu\n");
+VBD_SHOW_ALLRING(oo_req_indirect, "%llu\n");
+VBD_SHOW_ALLRING(req_direct, "%llu\n");
+VBD_SHOW_ALLRING(req_indirect, "%llu\n");
 
 static struct attribute *xen_vbdstat_attrs[] = {
        &dev_attr_oo_req.attr,
@@ -374,6 +377,9 @@ static struct attribute *xen_vbdstat_attrs[] = {
        &dev_attr_ds_req.attr,
        &dev_attr_rd_sect.attr,
        &dev_attr_wr_sect.attr,
+       &dev_attr_oo_req_indirect.attr,
+       &dev_attr_req_direct.attr,
+       &dev_attr_req_indirect.attr,
        NULL
 };