path: root/btt/trace_requeue.c
diff options
authorAlan D. Brunelle <>2007-02-06 20:46:16 +0100
committerJens Axboe <>2007-02-06 20:46:16 +0100
commitd76c5b81b99faca0959afcdd2e73330c61f69bfc (patch)
treecfb3df57c89960cd144fcf6437e617ea39f78aa4 /btt/trace_requeue.c
parent0ac4c20e46fc644b1ac9e3021e3ebaa88b9c536f (diff)
[PATCH]: btt - major fixes and speed improvements
From: Alan D. Brunelle <> Lots of changes to how we handle traces - adds robustness & quicker This large patch contains the following changes to the trace handling aspects of btt: 1. Use larger buffers for output options. 2. Use mmap to handle the input of trace data. 3. More precise btt statistics are output at the end. 4. Added in (under DEBUG) the display of unhandled traces. I was running into the problem where traces were not being connected, and the rb trees would get quite large. This would slow things down considerably. (See below for details on why traces weren't being handled.) 5. Sprinkled some ASSERTs (under DEBUG). 6. Added a new btt-specific trace type: "links" - since 'A' (remaps) contain two separate pieces of information, I broke them up into a link and a remap trace. [Thus, it is easy to find either end of the remap.] 7. Added in the notion of retries of completes (and requeues). I'm finding some discrepencies in the time stamps, in order to make btt handle these better, I've added the notion of keeping the trace around for a bit, to see if it gets linked up later. 8. Separated trace streams into: simple IOs, and remapped IOs. 9. Fixed up D2C averages - Q2I + I2D + D2C should equal Q2C averages. ---------------------------------------------------------------------------- I do not understand why it is so, but I am seeing two 'C' (complete) traces for the same IO track at times. The sequence number is different (+1 for the second one), and the time stamps are different (100's of microseconds apart). I'm investigating this. At least on an IA64, I am seeing time inconsistencies amongst CPUs on very heavy loads (48 disks, 4 CPUs, almost 300 million traces). I find the 'D' (issue) and 'C' (complete) traces coming out ahead of the associate 'I' (insert) and 'M' (merge) traces. It would be good to get this fixed in the kernel, but I figure it is also goodness to attempt to account for it in post-processing as well. ---------------------------------------------------------------------------- This work was done in order to handle some of these large data sets, and I've found that the performance is reasonable - here are some stats for very large file (the largest of which used to take well over 12 minutes, now it takes about 5 1/2 minutes - and a lot of that is just getting the 18GiB of data read in): Size Real User System ----- -------- -------- ------- 7GiB 123.445s 80.188s 11.392s 10GiB 179.148s 137.456s 16.680s 13GiB 237.561s 156.992s 21.968s 16GiB 283.262s 187.468s 26.748s 18GiB 336.345s 225.084s 31.200s Signed-off-by: Alan D. Brunelle <> Signed-off-by: Jens Axboe <>
Diffstat (limited to 'btt/trace_requeue.c')
1 files changed, 15 insertions, 35 deletions
diff --git a/btt/trace_requeue.c b/btt/trace_requeue.c
index 55bb3f4..ac1948d 100644
--- a/btt/trace_requeue.c
+++ b/btt/trace_requeue.c
@@ -22,44 +22,24 @@
void trace_requeue(struct io *r_iop)
- if (!io_setup(r_iop, IOP_R)) {
+ LIST_HEAD(rmhd);
+ struct io *d_iop;
+ if ((io_setup(r_iop, IOP_R) == 0) ||
+ (d_iop = dip_find_sec(r_iop->dip, IOP_D,
+ BIT_START(r_iop))) == NULL) {
+ dip_rem(d_iop);
- if (ready_requeue(r_iop, r_iop))
- run_requeue(r_iop);
- else
- add_retry(r_iop);
-int retry_requeue(struct io *r_iop)
- if (!ready_requeue(r_iop, r_iop))
- return 0;
- run_requeue(r_iop);
- return 1;
-int ready_requeue(struct io *r_iop, struct io *top)
- struct io *d_iop = dip_find_sec(r_iop->dip, IOP_D, BIT_START(r_iop));
- if (d_iop)
- return ready_issue(d_iop, top);
- return 0;
-void run_requeue(struct io *r_iop)
- LIST_HEAD(del_head);
- struct io *d_iop = dip_find_sec(r_iop->dip, IOP_D, BIT_START(r_iop));
- __link(d_iop, r_iop);
- run_unissue(d_iop, &del_head);
- __unlink(d_iop, r_iop);
+#if defined(DEBUG)
+ ASSERT(ready_issue(d_iop, r_iop) != 0);
+ (void)ready_issue(d_iop, r_iop);
- del_retry(r_iop);
- list_add_tail(&r_iop->f_head, &del_head);
- release_iops(&del_head);
+ run_unissue(d_iop, &rmhd);
+ list_add_tail(&r_iop->f_head, &rmhd);
+ release_iops(&rmhd);