Added active requests at Q information.
authorAlan D. Brunelle <Alan.Brunelle@hp.com>
Tue, 13 Nov 2007 22:16:38 +0000 (17:16 -0500)
committerAlan D. Brunelle <Alan.Brunelle@hp.com>
Tue, 13 Nov 2007 22:16:38 +0000 (17:16 -0500)
An important consideration when analyzing block IO schedulers is to know
how many requests the scheduler has to work with. The metric provided
in this section details how many requests (on average) were being held
by the IO scheduler when an incoming IO request was being handled. To
determine this, btt keeps track of how many Q requests came in, and
subtacts requests that have been issued (D).

Sample:

==================== Active Requests At Q Information ====================

       DEV |  Avg Reqs @ Q
---------- | -------------
 ( 65, 80) |          12.0
 ( 65,240) |          16.9
 ( 65,112) |          13.3
 ( 66, 64) |          32.8
 ( 66, 80) |          21.5
 ( 65, 96) |           8.6
 ( 66, 16) |          16.2
 ( 65, 64) |          20.4
 ( 66, 96) |          18.3
 ( 65,176) |          17.4
 ( 66, 32) |          13.6
 ( 65,144) |          13.4
 ( 66,  0) |          21.4
 ( 65,192) |          19.4
 ( 66,128) |          18.4
 ( 66,144) |          16.2
 ( 65,128) |           8.0
 ( 66,112) |          44.2
---------- | -------------
   Overall | Avgs Reqs @ Q
   Average |          17.4

Signed-off-by: Alan D. Brunelle <Alan.Brunelle@hp.com>
btt/doc/btt.tex
btt/globals.h
btt/output.c
btt/trace_issue.c
btt/trace_queue.c

index c795cb99cb65de9d946b5d8a2e3fe5cd9b39d0b1..f35cf1f072dd8c01f75f546e0ff753fa1d4ccf1a 100644 (file)
@@ -22,7 +22,7 @@
 
 \title{\texttt{btt} User Guide}
 \author{Alan D. Brunelle (Alan.Brunelle@hp.com)}
-\date{16 April 2007}
+\date{13 November 2007}
 
 \begin{document}
 \maketitle
@@ -56,7 +56,7 @@ easier.
 
 \bigskip
   This document refers to the output formats generated by \texttt{btt}
-  version 0.99.1.  However, the descriptions are general enough to cover
+  version 2.00.  However, the descriptions are general enough to cover
   output formats prior to that.
 
 \newpage\tableofcontents
@@ -251,6 +251,32 @@ Q2C    0.000207665   0.125405263   1.830917198     2262311
 
   The total number of unplugs is equal to the number of plugs less the
   ones due to timer unplugs.
+
+  \item[Active Requests At Q Information]
+
+  An important consideration when analyzing block IO schedulers is to
+  know how many requests the scheduler has to work with. The metric
+  provided in this section details how many requests (on average) were
+  being held by the IO scheduler when an incoming IO request was being
+  handled. To determine this, \texttt{btt} keeps track of how many Q
+  requests came in, and subtacts requests that have been issued (D).
+
+  Here is a sample output of this sections:
+
+\begin{verbatim}
+==================== Active Requests At Q Information ====================
+
+       DEV |  Avg Reqs @ Q
+---------- | -------------
+ ( 65, 80) |          12.0
+ ( 65,240) |          16.9
+...
+ ( 66,112) |          44.2
+---------- | -------------
+   Overall | Avgs Reqs @ Q
+   Average |          17.4
+\end{verbatim}
+
 \end{description}
 
 \newpage
@@ -646,7 +672,7 @@ Device:       rrqm/s   wrqm/s     r/s     w/s    rsec/s    wsec/s
 \newpage\section{\label{sec:cmd-line}Command Line}
 
 \begin{verbatim}
-Usage: \texttt{btt} 0.99.1 
+Usage: btt 2.00 
 [ -a               | --seek-absolute ]
 [ -A               | --all-data ]
 [ -B <output name> | --dump-blocknos=<output name> ]
index e1751e452fc51c94b4f1214633e192c80f255a8c..5a6db048d2b09154015eec27e497476896fd2e7b 100644 (file)
@@ -163,6 +163,7 @@ struct d_info {
        struct avgs_info avgs;
        struct stats stats, all_stats;
        __u64 last_q, n_qs, n_ds;
+       __u64 n_act_q, t_act_q; /* # currently active when Q comes in */
        __u32 device;
 
        int pre_culling;
index 21392d636cc71b6d6718e113c509f92e244ac9b9..ebfd3d835f4556927f1332f64a86f1a49b917a08 100644 (file)
@@ -510,6 +510,45 @@ void output_plug_info(FILE *ofp)
        fprintf(ofp, "\n");
 }
 
+int n_actQs;
+struct actQ_info {
+       __u64 t_qs;
+       __u64 t_act_qs;
+} actQ_info;
+
+void __dip_output_actQ(struct d_info *dip, void *arg)
+{
+       if (dip->n_qs > 0 && !remapper_dev(dip->device)) {
+               char dev_info[15];
+               double a_actQs = (double)dip->t_act_q / (double)dip->n_qs;
+
+               fprintf((FILE *)arg, "%10s | %13.1lf\n", 
+                       make_dev_hdr(dev_info, 15, dip), a_actQs);
+                       
+               n_actQs++;
+               actQ_info.t_qs += dip->n_qs;
+               actQ_info.t_act_qs += dip->t_act_q;
+       }
+}
+
+void __dip_output_actQ_all(FILE *ofp, struct actQ_info *p)
+{
+       fprintf(ofp, "---------- | -------------\n");
+       fprintf(ofp, "%10s | %13s\n", "Overall", "Avgs Reqs @ Q");
+       fprintf(ofp, "%10s | %13.1lf\n", "Average", 
+               (double)p->t_act_qs / (double)p->t_qs);
+}
+
+void output_actQ_info(FILE *ofp)
+{
+       fprintf(ofp, "%10s | %13s\n", "DEV", "Avg Reqs @ Q");
+       fprintf(ofp, "---------- | -------------\n");
+       dip_foreach_out(__dip_output_actQ, ofp);
+       if (n_actQs > 1)
+               __dip_output_actQ_all(ofp, &actQ_info);
+       fprintf(ofp, "\n");
+}
+
 void output_histos(void)
 {
        int i;
@@ -604,6 +643,9 @@ int output_avgs(FILE *ofp)
        output_section_hdr(ofp, "Plug Information");
        output_plug_info(ofp);
 
+       output_section_hdr(ofp, "Active Requests At Q Information");
+       output_actQ_info(ofp);
+
        output_histos();
 
        return 0;
index 8b1571ac7f94439fecc2c40f287c14fe33863798..fd7ea494c32f28d4f5446932051fa2f5b010aaca 100644 (file)
@@ -25,6 +25,9 @@ static void handle_issue(struct io *d_iop)
        LIST_HEAD(head);
        struct list_head *p, *q;
 
+       if (d_iop->dip->n_act_q != 0)
+               d_iop->dip->n_act_q--;
+
        seeki_add(d_iop->dip->seek_handle, d_iop);
        bno_dump_add(d_iop->dip->bno_dump_handle, d_iop);
        iostat_issue(d_iop);
index 1d2afbe3486ad2e59b2cfc25adeb92e5db607cc4..fe85a095dc44fc9bb2672be9377bdace4f6d0c58 100644 (file)
@@ -33,6 +33,9 @@ static void handle_queue(struct io *q_iop)
        q_iop->i_time = q_iop->gm_time = q_iop->d_time = (__u64)-1;
        q_iop->is_getrq = -1;
        q_iop->dip->n_qs++;
+
+       q_iop->dip->t_act_q += q_iop->dip->n_act_q;
+       q_iop->dip->n_act_q++;
 }
 
 void trace_queue(struct io *q_iop)