[PATCH] Added in blktrace msgs for dm-ioband

From: Alan D . Brunelle
Date: Fri Apr 24 2009 - 17:30:32 EST


Added the following messages:

In hold_bio - added messages as they are being added to either the
urgent or normal hold lists.

ioband <g_name> hold_urg <g_blocked>
ioband <g_name> hold_nrm <g_blocked>

In make_issue_list - added messages when placing previously held bios
onto either the pushback or issue lists:

ioband <g_name> add_pback <g_blocked> <c_blocked>
ioband <g_name> add_iss <g_blocked> <c_blocked>

In release_urgent bios - added a message indicating that an urgent bio
was added to the issue list:

ioband <g_name> urg_add_iss> <g_blocked>

In ioband_conduct - added messages as bios are being popped and executed
(sent to generic_make_request) or pushed back (bio_endio):

ioband <g_name> pop_iss
ioband <g_name> pop_pback

Signed-off-by: Alan D. Brunelle <alan.brunelle@xxxxxx>
---
drivers/md/dm-ioband-ctl.c | 30 +++++++++++++++++++++++++++---
1 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/drivers/md/dm-ioband-ctl.c b/drivers/md/dm-ioband-ctl.c
index 29bef11..26ad7a5 100644
--- a/drivers/md/dm-ioband-ctl.c
+++ b/drivers/md/dm-ioband-ctl.c
@@ -13,6 +13,7 @@
#include <linux/slab.h>
#include <linux/workqueue.h>
#include <linux/rbtree.h>
+#include <linux/blktrace_api.h>
#include "dm.h"
#include "md.h"
#include "dm-bio-list.h"
@@ -633,9 +634,15 @@ static void hold_bio(struct ioband_group *gp, struct bio *bio)
*/
dp->g_prepare_bio(gp, bio, IOBAND_URGENT);
bio_list_add(&dp->g_urgent_bios, bio);
+ blk_add_trace_msg(bdev_get_queue(bio->bi_bdev),
+ "ioband %s hold_urg %d", dp->g_name,
+ dp->g_blocked);
} else {
gp->c_blocked++;
dp->g_hold_bio(gp, bio);
+ blk_add_trace_msg(bdev_get_queue(bio->bi_bdev),
+ "ioband %s hold_nrm %d", dp->g_name,
+ gp->c_blocked);
}
}

@@ -676,14 +683,21 @@ static int make_issue_list(struct ioband_group *gp, struct bio *bio,
clear_group_blocked(gp);
wake_up_all(&gp->c_waitq);
}
- if (should_pushback_bio(gp))
+ if (should_pushback_bio(gp)) {
bio_list_add(pushback_list, bio);
+ blk_add_trace_msg(bdev_get_queue(bio->bi_bdev),
+ "ioband %s add_pback %d %d", dp->g_name,
+ dp->g_blocked, gp->c_blocked);
+ }
else {
int rw = bio_data_dir(bio);

gp->c_stat[rw].deferred++;
gp->c_stat[rw].sectors += bio_sectors(bio);
bio_list_add(issue_list, bio);
+ blk_add_trace_msg(bdev_get_queue(bio->bi_bdev),
+ "ioband %s add_iss %d %d", dp->g_name,
+ dp->g_blocked, gp->c_blocked);
}
return prepare_to_issue(gp, bio);
}
@@ -703,6 +717,9 @@ static void release_urgent_bios(struct ioband_device *dp,
dp->g_blocked--;
dp->g_issued[bio_data_dir(bio)]++;
bio_list_add(issue_list, bio);
+ blk_add_trace_msg(bdev_get_queue(bio->bi_bdev),
+ "ioband %s urg_add_iss %d", dp->g_name,
+ dp->g_blocked);
}
}

@@ -916,10 +933,17 @@ static void ioband_conduct(struct work_struct *work)

spin_unlock_irqrestore(&dp->g_lock, flags);

- while ((bio = bio_list_pop(&issue_list)))
+ while ((bio = bio_list_pop(&issue_list))) {
+ blk_add_trace_msg(bdev_get_queue(bio->bi_bdev),
+ "ioband %s pop_iss", dp->g_name);
generic_make_request(bio);
- while ((bio = bio_list_pop(&pushback_list)))
+ }
+
+ while ((bio = bio_list_pop(&pushback_list))) {
+ blk_add_trace_msg(bdev_get_queue(bio->bi_bdev),
+ "ioband %s pop_pback", dp->g_name);
bio_endio(bio, -EIO);
+ }
}

static int ioband_end_io(struct dm_target *ti, struct bio *bio,
--
1.5.6.3


--------------070500080301040709040703--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/