linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block: call trace_block_split() from bio_split()
@ 2016-11-18  2:14 NeilBrown
  2016-11-18 12:55 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: NeilBrown @ 2016-11-18  2:14 UTC (permalink / raw)
  To: Jens Axboe, Christoph Hellwig; +Cc: linux-block, linux-raid, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1588 bytes --]



Somewhere around
Commit: 20d0189b1012 ("block: Introduce new bio_split()")
and
Commit: 4b1faf931650 ("block: Kill bio_pair_split()")

in 3.14 we lost the call to trace_block_split() from bio_split().

Commit: cda22646adaa ("block: add call to split trace point")

in 4.5 added it back for blk_queue_split(), but not for other users of
bio_split(), and particularly not for md/raid.

This patch moves the trace_block_split() call from blk_queue_split()
to bio_split().
As blk_queue_split() calls bio_split() (via various helper functions)
the same events that were traced before will still be traced.

Signed-off-by: NeilBrown <neilb@suse.com>
---
 block/bio.c       | 1 +
 block/blk-merge.c | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/bio.c b/block/bio.c
index db85c5753a76..212ea95a7401 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1804,6 +1804,7 @@ struct bio *bio_split(struct bio *bio, int sectors,
 		bio_integrity_trim(split, 0, sectors);
 
 	bio_advance(bio, split->bi_iter.bi_size);
+	trace_block_split(bdev_get_queue(bio->bi_bdev), split, bio->bi_iter.bi_sector);
 
 	return split;
 }
diff --git a/block/blk-merge.c b/block/blk-merge.c
index 2642e5fc8b69..82cdd35a9f07 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -217,7 +217,6 @@ void blk_queue_split(struct request_queue *q, struct bio **bio,
 		split->bi_opf |= REQ_NOMERGE;
 
 		bio_chain(split, *bio);
-		trace_block_split(q, split, (*bio)->bi_iter.bi_sector);
 		generic_make_request(*bio);
 		*bio = split;
 	}
-- 
2.10.2


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 800 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] block: call trace_block_split() from bio_split()
  2016-11-18  2:14 [PATCH] block: call trace_block_split() from bio_split() NeilBrown
@ 2016-11-18 12:55 ` Christoph Hellwig
  2016-11-21  3:33   ` [PATCH - v2] " NeilBrown
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2016-11-18 12:55 UTC (permalink / raw)
  To: NeilBrown
  Cc: Jens Axboe, Christoph Hellwig, linux-block, linux-raid,
	linux-kernel

On Fri, Nov 18, 2016 at 01:14:20PM +1100, NeilBrown wrote:
> 
> 
> Somewhere around
> Commit: 20d0189b1012 ("block: Introduce new bio_split()")
> and
> Commit: 4b1faf931650 ("block: Kill bio_pair_split()")
> 
> in 3.14 we lost the call to trace_block_split() from bio_split().
> 
> Commit: cda22646adaa ("block: add call to split trace point")
> 
> in 4.5 added it back for blk_queue_split(), but not for other users of
> bio_split(), and particularly not for md/raid.
> 
> This patch moves the trace_block_split() call from blk_queue_split()
> to bio_split().
> As blk_queue_split() calls bio_split() (via various helper functions)
> the same events that were traced before will still be traced.
> 
> Signed-off-by: NeilBrown <neilb@suse.com>
> ---
>  block/bio.c       | 1 +
>  block/blk-merge.c | 1 -
>  2 files changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/bio.c b/block/bio.c
> index db85c5753a76..212ea95a7401 100644
> --- a/block/bio.c
> +++ b/block/bio.c
> @@ -1804,6 +1804,7 @@ struct bio *bio_split(struct bio *bio, int sectors,
>  		bio_integrity_trim(split, 0, sectors);
>  
>  	bio_advance(bio, split->bi_iter.bi_size);
> +	trace_block_split(bdev_get_queue(bio->bi_bdev), split, bio->bi_iter.bi_sector);

This line needs to be wrapped.

Otherwise looks fine:

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH - v2] block: call trace_block_split() from bio_split()
  2016-11-18 12:55 ` Christoph Hellwig
@ 2016-11-21  3:33   ` NeilBrown
  0 siblings, 0 replies; 3+ messages in thread
From: NeilBrown @ 2016-11-21  3:33 UTC (permalink / raw)
  Cc: Jens Axboe, Christoph Hellwig, linux-block, linux-raid,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1714 bytes --]


Somewhere around
Commit: 20d0189b1012 ("block: Introduce new bio_split()")
and
Commit: 4b1faf931650 ("block: Kill bio_pair_split()")

in 3.14 we lost the call to trace_block_split() from bio_split().

Commit: cda22646adaa ("block: add call to split trace point")

in 4.5 added it back for blk_queue_split(), but not for other users of
bio_split(), and particularly not for md.

This patch moves the trace_block_split() call from blk_queue_split()
to bio_split().
As blk_queue_split() calls bio_split() (via various helper functions)
the same events that were traced before will still be traced.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: NeilBrown <neilb@suse.com>
---

Thanks Christoph.
This adds the wrap and the reviewed-by.

NeilBrown


 block/bio.c       | 2 ++
 block/blk-merge.c | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/block/bio.c b/block/bio.c
index db85c5753a76..0aa755abd10b 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1804,6 +1804,8 @@ struct bio *bio_split(struct bio *bio, int sectors,
 		bio_integrity_trim(split, 0, sectors);
 
 	bio_advance(bio, split->bi_iter.bi_size);
+	trace_block_split(bdev_get_queue(bio->bi_bdev), split,
+			  bio->bi_iter.bi_sector);
 
 	return split;
 }
diff --git a/block/blk-merge.c b/block/blk-merge.c
index 2642e5fc8b69..82cdd35a9f07 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -217,7 +217,6 @@ void blk_queue_split(struct request_queue *q, struct bio **bio,
 		split->bi_opf |= REQ_NOMERGE;
 
 		bio_chain(split, *bio);
-		trace_block_split(q, split, (*bio)->bi_iter.bi_sector);
 		generic_make_request(*bio);
 		*bio = split;
 	}
-- 
2.10.2


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 800 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-21  3:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-18  2:14 [PATCH] block: call trace_block_split() from bio_split() NeilBrown
2016-11-18 12:55 ` Christoph Hellwig
2016-11-21  3:33   ` [PATCH - v2] " NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).