summaryrefslogtreecommitdiff
path: root/btt/trace_requeue.c
diff options
context:
space:
mode:
authorDave Boutcher <boutcher@cs.umn.edu>2008-01-03 10:21:32 -0500
committerAlan D. Brunelle <adb@bannor.(none)>2008-01-03 10:21:32 -0500
commit461afe819c41fa811f9c6264524cb8edbd2acc63 (patch)
tree3be614c8339093d499dee0cb43aa7e8b01ca8c97 /btt/trace_requeue.c
parentae6d30f4475181d685d1f33faf056755803f189b (diff)
downloadblktrace-461afe819c41fa811f9c6264524cb8edbd2acc63.tar.gz
blktrace-461afe819c41fa811f9c6264524cb8edbd2acc63.tar.bz2
Fix Q counts during requeue and merges.
It looks to me like btt doesn't correctly keep track of the number of requests currently in the queue for a device. n_act_q gets incremented in trace_queue and decremented in trace_issue, but I think it also needs to get updated in trace_merge and trace_requeue. The one thing I'm not sure about is whether we want r_iop->dip->n_qs++ in the new handle_requeue routine. The following patch makes the "active requests at Q" count a little more sane for me. This is against git as of yesterday. Signed-off-by: Alan D. Brunelle <Alan.Brunelle@hp.com>
Diffstat (limited to 'btt/trace_requeue.c')
-rw-r--r--btt/trace_requeue.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/btt/trace_requeue.c b/btt/trace_requeue.c
index db5f7b7..f1324d9 100644
--- a/btt/trace_requeue.c
+++ b/btt/trace_requeue.c
@@ -20,7 +20,16 @@
*/
#include "globals.h"
+static void handle_requeue(struct io *r_iop)
+{
+ r_iop->dip->n_qs++;
+ r_iop->dip->t_act_q += r_iop->dip->n_act_q;
+ r_iop->dip->n_act_q++;
+}
+
void trace_requeue(struct io *r_iop)
{
+ if (io_setup(r_iop, IOP_R))
+ handle_requeue(r_iop);
io_release(r_iop);
}