>From bd918c40d92e4f074763a88bc8f13593c4f2dc52 Mon Sep 17 00:00:00 2001 From: Alan D. Brunelle Date: Fri, 24 Apr 2009 17:30:32 -0400 Subject: [PATCH] Added in blktrace msgs for dm-ioband Added the following messages: In hold_bio - added messages as they are being added to either the urgent or normal hold lists. ioband hold_urg ioband hold_nrm In make_issue_list - added messages when placing previously held bios onto either the pushback or issue lists: ioband add_pback ioband add_iss In release_urgent bios - added a message indicating that an urgent bio was added to the issue list: ioband urg_add_iss> In ioband_conduct - added messages as bios are being popped and executed (sent to generic_make_request) or pushed back (bio_endio): ioband pop_iss ioband pop_pback Signed-off-by: Alan D. Brunelle --- 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 #include #include +#include #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