aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-01-11 16:06:33 -0500
committerJens Axboe <axboe@kernel.dk>2013-01-14 09:00:36 -0500
commit3a366e614d0837d9fc23f78cdb1a1186ebc3387f (patch)
tree5be6ec716687234ac1e6202db62c84ee1d2246be /drivers/md
parentac9a19745196388ae5d828c0be7a1d6e472101f3 (diff)
block: add missing block_bio_complete() tracepoint
bio completion didn't kick block_bio_complete TP. Only dm was explicitly triggering the TP on IO completion. This makes block_bio_complete TP useless for tracers which want to know about bios, and all other bio based drivers skip generating blktrace completion events. This patch makes all bio completions via bio_endio() generate block_bio_complete TP. * Explicit trace_block_bio_complete() invocation removed from dm and the trace point is unexported. * @rq dropped from trace_block_bio_complete(). bios may fly around w/o queue associated. Verifying and accessing the assocaited queue belongs to TP probes. * blktrace now gets both request and bio completions. Make it ignore bio completions if request completion path is happening. This makes all bio based drivers generate blktrace completion events properly and makes the block_bio_complete TP actually useful. v2: With this change, block_bio_complete TP could be invoked on sg commands which have bio's with %NULL bi_bdev. Update TP assignment code to check whether bio->bi_bdev is %NULL before dereferencing. Signed-off-by: Tejun Heo <tj@kernel.org> Original-patch-by: Namhyung Kim <namhyung@gmail.com> Cc: Tejun Heo <tj@kernel.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Alasdair Kergon <agk@redhat.com> Cc: dm-devel@redhat.com Cc: Neil Brown <neilb@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm.c1
-rw-r--r--drivers/md/raid5.c11
2 files changed, 1 insertions, 11 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index c72e4d5a9617..650ec2866e34 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -627,7 +627,6 @@ static void dec_pending(struct dm_io *io, int error)
627 queue_io(md, bio); 627 queue_io(md, bio);
628 } else { 628 } else {
629 /* done with normal IO or empty flush */ 629 /* done with normal IO or empty flush */
630 trace_block_bio_complete(md->queue, bio, io_error);
631 bio_endio(bio, io_error); 630 bio_endio(bio, io_error);
632 } 631 }
633 } 632 }
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 19d77a026639..9ab506df42da 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -184,8 +184,6 @@ static void return_io(struct bio *return_bi)
184 return_bi = bi->bi_next; 184 return_bi = bi->bi_next;
185 bi->bi_next = NULL; 185 bi->bi_next = NULL;
186 bi->bi_size = 0; 186 bi->bi_size = 0;
187 trace_block_bio_complete(bdev_get_queue(bi->bi_bdev),
188 bi, 0);
189 bio_endio(bi, 0); 187 bio_endio(bi, 0);
190 bi = return_bi; 188 bi = return_bi;
191 } 189 }
@@ -3917,8 +3915,6 @@ static void raid5_align_endio(struct bio *bi, int error)
3917 rdev_dec_pending(rdev, conf->mddev); 3915 rdev_dec_pending(rdev, conf->mddev);
3918 3916
3919 if (!error && uptodate) { 3917 if (!error && uptodate) {
3920 trace_block_bio_complete(bdev_get_queue(raid_bi->bi_bdev),
3921 raid_bi, 0);
3922 bio_endio(raid_bi, 0); 3918 bio_endio(raid_bi, 0);
3923 if (atomic_dec_and_test(&conf->active_aligned_reads)) 3919 if (atomic_dec_and_test(&conf->active_aligned_reads))
3924 wake_up(&conf->wait_for_stripe); 3920 wake_up(&conf->wait_for_stripe);
@@ -4377,8 +4373,6 @@ static void make_request(struct mddev *mddev, struct bio * bi)
4377 if ( rw == WRITE ) 4373 if ( rw == WRITE )
4378 md_write_end(mddev); 4374 md_write_end(mddev);
4379 4375
4380 trace_block_bio_complete(bdev_get_queue(bi->bi_bdev),
4381 bi, 0);
4382 bio_endio(bi, 0); 4376 bio_endio(bi, 0);
4383 } 4377 }
4384} 4378}
@@ -4755,11 +4749,8 @@ static int retry_aligned_read(struct r5conf *conf, struct bio *raid_bio)
4755 handled++; 4749 handled++;
4756 } 4750 }
4757 remaining = raid5_dec_bi_active_stripes(raid_bio); 4751 remaining = raid5_dec_bi_active_stripes(raid_bio);
4758 if (remaining == 0) { 4752 if (remaining == 0)
4759 trace_block_bio_complete(bdev_get_queue(raid_bio->bi_bdev),
4760 raid_bio, 0);
4761 bio_endio(raid_bio, 0); 4753 bio_endio(raid_bio, 0);
4762 }
4763 if (atomic_dec_and_test(&conf->active_aligned_reads)) 4754 if (atomic_dec_and_test(&conf->active_aligned_reads))
4764 wake_up(&conf->wait_for_stripe); 4755 wake_up(&conf->wait_for_stripe);
4765 return handled; 4756 return handled;