linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung.kim@lge.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: Namhyung Kim <namhyung@gmail.com>,
	linux-kernel@vger.kernel.org, Tejun Heo <tj@kernel.org>
Subject: [PATCH 2/3] block: prevent duplicated bio completion report
Date: Tue, 17 Jan 2012 10:32:07 +0900	[thread overview]
Message-ID: <1326763928-1972-2-git-send-email-namhyung.kim@lge.com> (raw)
In-Reply-To: <1326763928-1972-1-git-send-email-namhyung.kim@lge.com>

Since previous patch make block_bio_complete TP working,
it will generate duplicated BLK_TA_COMPLETEs for bounced
bios. Fix it.

Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
Cc: Tejun Heo <tj@kernel.org>
---
 include/linux/blk_types.h    |    3 +++
 include/trace/events/block.h |    3 ++-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 4053cbd4490e..45cd0074a1c8 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -97,6 +97,9 @@ struct bio {
 #define BIO_MAPPED_INTEGRITY 11/* integrity metadata has been remapped */
 #define bio_flagged(bio, flag)	((bio)->bi_flags & (1 << (flag)))
 
+/* masked bio's won't report its completion via tracepoint */
+#define BIO_COMPLETE_MASK	(1 << BIO_BOUNCED)
+
 /*
  * top 4 bits of bio flags indicate the pool this bio came from
  */
diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index 96955f4828b3..72888542e186 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -219,7 +219,8 @@ TRACE_EVENT_CONDITION(block_bio_complete,
 
 	TP_ARGS(q, bio, error),
 
-	TP_CONDITION(bio->bi_bdev != NULL),
+	TP_CONDITION(bio->bi_bdev != NULL &&
+		     !(bio->bi_flags & BIO_COMPLETE_MASK)),
 
 	TP_STRUCT__entry(
 		__field( dev_t,		dev		)
-- 
1.7.9.rc1.dirty


  reply	other threads:[~2012-01-17  1:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-17  1:32 [PATCH 1/3] block: add missing block_bio_complete() tracepoint Namhyung Kim
2012-01-17  1:32 ` Namhyung Kim [this message]
2012-01-17 17:45   ` [PATCH 2/3] block: prevent duplicated bio completion report Tejun Heo
2012-01-18  1:20     ` Namhyung Kim
2012-01-19  1:14       ` Namhyung Kim
2012-01-17  1:32 ` [PATCH 3/3] block: don't export block_bio_complete tracepoint Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1326763928-1972-2-git-send-email-namhyung.kim@lge.com \
    --to=namhyung.kim@lge.com \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@gmail.com \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).