All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
To: axboe@kernel.dk, viro@zeniv.linux.org.uk, rostedt@goodmis.org,
	mingo@redhat.com, chaitanya.kulkarni@wdc.com,
	johannes.thumshirn@wdc.com, damien.lemoal@wdc.com,
	bvanassche@acm.org, dongli.zhang@oracle.com,
	aravind.ramesh@wdc.com, joshi.k@samsung.com,
	niklas.cassel@wdc.com, hch@lst.de, osandov@fb.com,
	martin.petersen@oracle.com
Cc: linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: [RFC PATCH 38/39] blktrace: track zone appaend completion sector
Date: Wed, 24 Feb 2021 23:02:30 -0800	[thread overview]
Message-ID: <20210225070231.21136-39-chaitanya.kulkarni@wdc.com> (raw)
In-Reply-To: <20210225070231.21136-1-chaitanya.kulkarni@wdc.com>

The request type REQ_OP_ZONE_APPENDT needs zone start the when issued
not the actual sector where this I/O lands and returns completion sector
in for trace complete event 'C'. Right now we cannot track submission &
completion sector for this special request with existing format.

Add a new completion sector field in the blk_io_trace_ext structure,
when generating the trace when req_op is REQ_OP_ZONE_APPEND update
the completion sector from the I/O and store the zone start (where
actual I/O was issued) in the secor field of the trace.

With this new format we can track completion sector. (* is not a part
real trace it is here as a place holder so that it is easy to read for
reviewers) :-

252,0 15  1 92.785481956  6139  Q ZAS N 262144 + 8 [dd]
252,0 15  2 92.785490381  6139  G ZAS N 262144 + 8 [dd]
252,0 15  3 92.785498517  6139  I ZAS N 262144 + 8 [dd]
252,0 15  4 92.785519065   804  D ZAS N 262144 + 8 [kworker/15:1H]
252,0 15  5 92.785541527    86  C ZAS N 262144 + 8 [0] <262144>

252,0 15  6 92.785561936  6139  Q ZAS N 262144 + 8 [dd]
252,0 15  7 92.785568368  6139  G ZAS N 262144 + 8 [dd]
252,0 15  8 92.785574820  6139  I ZAS N 262144 + 8 [dd]
252,0 15  9 92.785587754   804  D ZAS N 262144 + 8 [kworker/15:1H]
252,0 15 10 92.785602802    86  C ZAS N 262144 + 8 [0] <262152>

252,0 15 11 92.785619704  6139  Q ZAS N 262144 + 8 [dd]
252,0 15 12 92.785626076  6139  G ZAS N 262144 + 8 [dd]
252,0 15 13 92.785632438  6139  I ZAS N 262144 + 8 [dd]
252,0 15 14 92.785644801   804  D ZAS N 262144 + 8 [kworker/15:1H]
252,0 15 15 92.785659939    86  C ZAS N 262144 + 8 [0] <262160>

252,0 15 16 92.785676460  6139  Q ZAS N 262144 + 8 [dd]
252,0 15 17 92.785682872  6139  G ZAS N 262144 + 8 [dd]
252,0 15 18 92.785689294  6139  I ZAS N 262144 + 8 [dd]
252,0 15 19 92.785701487   804  D ZAS N 262144 + 8 [kworker/15:1H]
252,0 15 20 92.785716024    86  C ZAS N 262144 + 8 [0] <262168>

252,0 15 21 92.785732335  6139  Q ZAS N 262144 + 8 [dd]
252,0 15 22 92.785738687  6139  G ZAS N 262144 + 8 [dd]
252,0 15 23 92.785745019  6139  I ZAS N 262144 + 8 [dd]
252,0 15 24 92.785757843   804  D ZAS N 262144 + 8 [kworker/15:1H]
252,0 15 25 92.785772020    86  C ZAS N 262144 + 8 [0] <262176>

252,0 15 26 92.785788180  6139  Q ZAS N 262144 + 8 [dd]
252,0 15 27 92.785794492  6139  G ZAS N 262144 + 8 [dd]
252,0 15 28 92.785800763  6139  I ZAS N 262144 + 8 [dd]
252,0 15 29 92.785812696   804  D ZAS N 262144 + 8 [kworker/15:1H]
252,0 15 30 92.785826762    86  C ZAS N 262144 + 8 [0] <262184>

252,0 15 31 92.785842852  6139  Q ZAS N 262144 + 8 [dd]
252,0 15 32 92.785849104  6139  G ZAS N 262144 + 8 [dd]
252,0 15 33 92.785855346  6139  I ZAS N 262144 + 8 [dd]
252,0 15 34 92.785867599   804  D ZAS N 262144 + 8 [kworker/15:1H]
252,0 15 35 92.785881835    86  C ZAS N 262144 + 8 [0] <262192>

252,0 15 36 92.785897845  6139  Q ZAS N 262144 + 8 [dd]
252,0 15 37 92.785904107  6139  G ZAS N 262144 + 8 [dd]
252,0 15 38 92.785910329  6139  I ZAS N 262144 + 8 [dd]
252,0 15 39 92.785922181   804  D ZAS N 262144 + 8 [kworker/15:1H]
252,0 15 40 92.785936237    86  C ZAS N 262144 + 8 [0] <262200>

252,0 15 41 92.785952037  6139  Q ZAS N 262144 + 8 [dd]
252,0 15 42 92.785958289  6139  G ZAS N 262144 + 8 [dd]
252,0 15 43 92.785964651  6139  I ZAS N 262144 + 8 [dd]
252,0 15 44 92.785976373   804  D ZAS N 262144 + 8 [kworker/15:1H]
252,0 15 45 92.785990419    86  C ZAS N 262144 + 8 [0] <262208>

252,0 15 46 92.786006339  6139  Q ZAS N 262144 + 8 [dd]
252,0 15 47 92.786025204  6139  G ZAS N 262144 + 8 [dd]
252,0 15 48 92.786031566  6139  I ZAS N 262144 + 8 [dd]
252,0 15 49 92.786043869   804  D ZAS N 262144 + 8 [kworker/15:1H]
252,0 15 50 92.786058216    86  C ZAS N 262144 + 8 [0] <262216>

252,0 10  1 92.783369654  6138  Q ZRS N 262144 + 0 [truncate]
252,0 10  2 92.783384813  6138  G ZRS N 262144 + 0 [truncate]
252,0 10  3 92.783395182  6138  I ZRS N 262144 + 0 [truncate]
252,0 10  4 92.783419628   782  D ZRS N 262144 + 0 [kworker/10:1H]
252,0 10  5 92.783460895    61  C ZRS N 262144 + 0 [0]
252,0  8  1 92.788546342  6140  Q ZRAS N 0 + 0 [blkzone]
252,0  8  2 92.788554628  6140  G ZRAS N 0 + 0 [blkzone]
252,0  8  3 92.788562232  6140  I ZRAS N 0 + 0 [blkzone]
252,0  8  4 92.788580977   934  D ZRAS N 0 + 0 [kworker/8:1H]
252,0  8  5 92.788597268    51  C ZRAS N 0 + 0 [0]

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 include/uapi/linux/blktrace_api.h |  1 +
 kernel/trace/blktrace.c           | 31 ++++++++++++++++++++++---------
 2 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/include/uapi/linux/blktrace_api.h b/include/uapi/linux/blktrace_api.h
index ac533a0b0928..ebfe3029cd10 100644
--- a/include/uapi/linux/blktrace_api.h
+++ b/include/uapi/linux/blktrace_api.h
@@ -155,6 +155,7 @@ struct blk_io_trace_ext {
 	__u32 sequence;		/* event number */
 	__u64 time;		/* in nanoseconds */
 	__u64 sector;		/* disk offset */
+	__u64 completion_sector;/* zone append completion sector */
 	__u32 bytes;		/* transfer length */
 	__u64 action;		/* what happened */
 	__u32 ioprio;		/* I/O priority */
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 32100c5db7a6..59bf99b4106a 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -502,7 +502,8 @@ static const u64 ddir_act_ext[2] = { BLK_TC_ACT_EXT(BLK_TC_READ),
  */
 static void __blk_add_trace_ext(struct blk_trace_ext *bt, sector_t sector, int bytes,
 		     int op, int op_flags, u64 what, int error, int pdu_len,
-		     void *pdu_data, u64 cgid, u32 ioprio, void *bip)
+		     void *pdu_data, u64 cgid, u32 ioprio, void *bip,
+		     sector_t blk_queue_zone_sectors)
 {
 	struct task_struct *tsk = current;
 	struct ring_buffer_event *event = NULL;
@@ -595,6 +596,16 @@ static void __blk_add_trace_ext(struct blk_trace_ext *bt, sector_t sector, int b
 		t->pid = pid;
 
 		t->sector = sector;
+		if (op == REQ_OP_ZONE_APPEND) {
+			sector_t zno = sector >> ilog2(blk_queue_zone_sectors);
+
+			t->completion_sector = sector;
+			/*
+			*  Start of the zone sector in which this completion
+			*  sector belongs to.
+			*/
+			sector = zno * blk_queue_zone_sectors;
+		}
 		t->bytes = bytes;
 		t->action = what;
 		t->ioprio = ioprio;
@@ -1445,7 +1456,8 @@ static void blk_add_trace_rq(struct request *rq, int error,
 			what |= BLK_TC_ACT_EXT(BLK_TC_FS);
 		__blk_add_trace_ext(bte, blk_rq_trace_sector(rq), nr_bytes,
 				    req_op(rq), rq->cmd_flags, what, error, 0,
-				    NULL, cgid, req_get_ioprio(rq), NULL);
+				    NULL, cgid, req_get_ioprio(rq), NULL,
+				    blk_queue_zone_sectors(rq->q));
 	}
 	rcu_read_unlock();
 }
@@ -1588,7 +1600,8 @@ static void blk_add_trace_bio(struct request_queue *q, struct bio *bio,
 				    bio->bi_iter.bi_size, bio_op(bio),
 				    bio->bi_opf, what, error, 0, NULL,
 				    blk_trace_bio_get_cgid(q, bio),
-				    bio_prio(bio), bio_integrity(bio));
+				    bio_prio(bio), bio_integrity(bio),
+				    blk_queue_zone_sectors(q));
 	}
 	rcu_read_unlock();
 }
@@ -1748,7 +1761,7 @@ static void blk_add_trace_plug(void *ignore, struct request_queue *q)
 		__blk_add_trace(bt, 0, 0, 0, 0, BLK_TA_PLUG, 0, 0, NULL, 0);
 	else if (bte)
 		__blk_add_trace_ext(bte, 0, 0, 0, 0, BLK_TA_PLUG_EXT, 0, 0,
-				    NULL, 0, 0, NULL);
+				    NULL, 0, 0, NULL, 0);
 	rcu_read_unlock();
 }
 
@@ -1780,7 +1793,7 @@ static void blk_add_trace_unplug(void *ignore, struct request_queue *q,
 		else
 			what = BLK_TA_UNPLUG_TIMER_EXT;
 		__blk_add_trace_ext(bte, 0, 0, 0, 0, what, 0, sizeof(rpdu),
-				&rpdu, 0, 0, NULL);
+				&rpdu, 0, 0, NULL, 0);
 	}
 	rcu_read_unlock();
 }
@@ -1813,7 +1826,7 @@ static void blk_add_trace_split(void *ignore, struct bio *bio, unsigned int pdu)
 				    bio->bi_status, sizeof(rpdu), &rpdu,
 				    blk_trace_bio_get_cgid(q, bio),
 				    bio_prio(bio),
-				    bio_integrity(bio));
+				    bio_integrity(bio), 0);
 	}
 	rcu_read_unlock();
 }
@@ -1859,7 +1872,7 @@ static void blk_add_trace_bio_remap(void *ignore, struct bio *bio, dev_t dev,
 				    sizeof(r), &r,
 				    blk_trace_bio_get_cgid(q, bio),
 				    bio_prio(bio),
-				    bio_integrity(bio));
+				    bio_integrity(bio), 0);
 	}
 	rcu_read_unlock();
 }
@@ -1904,7 +1917,7 @@ static void blk_add_trace_rq_remap(void *ignore, struct request *rq, dev_t dev,
 		__blk_add_trace_ext(bte, blk_rq_pos(rq), blk_rq_bytes(rq),
 				    rq_data_dir(rq), 0, BLK_TA_REMAP_EXT, 0,
 				    sizeof(r), &r,
-				    blk_trace_request_get_cgid(rq), 0, NULL);
+				    blk_trace_request_get_cgid(rq), 0, NULL, 0);
 	}
 	rcu_read_unlock();
 }
@@ -1940,7 +1953,7 @@ void blk_add_driver_data(struct request *rq, void *data, size_t len)
 		__blk_add_trace_ext(bte, blk_rq_trace_sector(rq),
 				blk_rq_bytes(rq), 0, 0, BLK_TA_DRV_DATA_EXT, 0,
 				len, data, blk_trace_request_get_cgid(rq),
-				req_get_ioprio(rq), NULL);
+				req_get_ioprio(rq), NULL, 0);
 	}
 	rcu_read_unlock();
 }
-- 
2.22.1


  parent reply	other threads:[~2021-02-25  7:12 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-25  7:01 [RFC PATCH 00/39] blktrace: add block trace extension support Chaitanya Kulkarni
2021-02-25  7:01 ` [RFC PATCH 01/39] blktrace_api: add new trace definitions Chaitanya Kulkarni
2021-02-26  4:31   ` Damien Le Moal
2021-02-25  7:01 ` [RFC PATCH 02/39] blktrace_api: add new trace definition Chaitanya Kulkarni
2021-02-26  4:33   ` Damien Le Moal
2021-02-25  7:01 ` [RFC PATCH 03/39] blkdev.h: add new trace ext as a queue member Chaitanya Kulkarni
2021-02-26  4:35   ` Damien Le Moal
2021-02-25  7:01 ` [RFC PATCH 04/39] blktrace: add a new global list Chaitanya Kulkarni
2021-02-26  4:36   ` Damien Le Moal
2021-02-25  7:01 ` [RFC PATCH 05/39] blktrace: add trace note APIs Chaitanya Kulkarni
2021-02-25  9:07   ` kernel test robot
2021-02-25 12:12   ` kernel test robot
2021-02-26  4:39   ` Damien Le Moal
2021-02-25  7:01 ` [RFC PATCH 06/39] blktrace: add act and prio check helpers Chaitanya Kulkarni
2021-02-26  4:41   ` Damien Le Moal
2021-02-25  7:01 ` [RFC PATCH 07/39] blktrace: add core trace API Chaitanya Kulkarni
2021-02-26  4:44   ` Damien Le Moal
2021-02-25  7:02 ` [RFC PATCH 08/39] blktrace: update blk_add_trace_rq() Chaitanya Kulkarni
2021-02-26  4:46   ` Damien Le Moal
2021-02-25  7:02 ` [RFC PATCH 09/39] blktrace: update blk_add_trace_rq_insert() Chaitanya Kulkarni
2021-02-26  4:48   ` Damien Le Moal
2021-02-25  7:02 ` [RFC PATCH 10/39] blktrace: update blk_add_trace_rq_issue() Chaitanya Kulkarni
2021-02-25 13:14   ` kernel test robot
2021-02-26  4:48   ` Damien Le Moal
2021-02-25  7:02 ` [RFC PATCH 11/39] blktrace: update blk_add_trace_rq_requeue() Chaitanya Kulkarni
2021-02-26  4:48   ` Damien Le Moal
2021-02-25  7:02 ` [RFC PATCH 12/39] blktrace: update blk_add_trace_rq_complete() Chaitanya Kulkarni
2021-02-26  4:48   ` Damien Le Moal
2021-02-25  7:02 ` [RFC PATCH 13/39] blktrace: update blk_add_trace_bio() Chaitanya Kulkarni
2021-02-26  4:49   ` Damien Le Moal
2021-02-25  7:02 ` [RFC PATCH 14/39] blktrace: update blk_add_trace_bio_bounce() Chaitanya Kulkarni
2021-02-25  7:02 ` [RFC PATCH 15/39] blktrace: update blk_add_trace_bio_complete() Chaitanya Kulkarni
2021-02-25  7:02 ` [RFC PATCH 16/39] blktrace: update blk_add_trace_bio_backmerge() Chaitanya Kulkarni
2021-02-25  7:02 ` [RFC PATCH 17/39] blktrace: update blk_add_trace_bio_frontmerge() Chaitanya Kulkarni
2021-02-25  7:02 ` [RFC PATCH 18/39] blktrace: update blk_add_trace_bio_queue() Chaitanya Kulkarni
2021-02-25  7:02 ` [RFC PATCH 19/39] blktrace: update blk_add_trace_getrq() Chaitanya Kulkarni
2021-02-25  7:02 ` [RFC PATCH 20/39] blktrace: update blk_add_trace_plug() Chaitanya Kulkarni
2021-02-25  7:02 ` [RFC PATCH 21/39] blktrace: update blk_add_trace_unplug() Chaitanya Kulkarni
2021-02-25  7:02 ` [RFC PATCH 22/39] blktrace: update blk_add_trace_split() Chaitanya Kulkarni
2021-02-25  7:02 ` [RFC PATCH 23/39] blktrace: update blk_add_trace_bio_remap() Chaitanya Kulkarni
2021-02-25  7:02 ` [RFC PATCH 24/39] blktrace: update blk_add_trace_rq_remap() Chaitanya Kulkarni
2021-02-25  7:02 ` [RFC PATCH 25/39] blktrace: update blk_add_driver_data() Chaitanya Kulkarni
2021-02-25  7:02 ` [RFC PATCH 26/39] blktrace: add trace entry & pdu helpers Chaitanya Kulkarni
2021-02-25  7:02 ` [RFC PATCH 27/39] blktrace: add a new formatting routine Chaitanya Kulkarni
2021-02-25  7:02 ` [RFC PATCH 28/39] blktrace: add blk_log_xxx helpers() Chaitanya Kulkarni
2021-02-25  7:02 ` [RFC PATCH 29/39] blktrace: link blk_log_xxx() to trace action Chaitanya Kulkarni
2021-02-25  7:02 ` [RFC PATCH 30/39] blktrace: add trace event print helper Chaitanya Kulkarni
2021-02-25  7:02 ` [RFC PATCH 31/39] blktrace: add trace_synthesize helper Chaitanya Kulkarni
2021-02-25  7:02 ` [RFC PATCH 32/39] blktrace: add trace print helpers Chaitanya Kulkarni
2021-02-25  7:02 ` [RFC PATCH 33/39] blktrace: add blkext tracer Chaitanya Kulkarni
2021-02-27 11:44   ` [blktrace] c055908abe: WARNING:at_kernel/trace/trace.c:#create_trace_option_files kernel test robot
2021-02-27 11:44     ` kernel test robot
2021-02-27 14:49     ` Steven Rostedt
2021-02-27 14:49       ` Steven Rostedt
2021-02-27 19:51       ` Chaitanya Kulkarni
2021-02-27 19:51       ` Chaitanya Kulkarni
2021-02-25  7:02 ` [RFC PATCH 34/39] blktrace: implement setup-start-stop ioclts Chaitanya Kulkarni
2021-02-25  7:02 ` [RFC PATCH 35/39] block: update blkdev_ioctl with new trace ioctls Chaitanya Kulkarni
2021-02-25  7:02 ` [RFC PATCH 36/39] blktrace: add integrity tracking support Chaitanya Kulkarni
2021-02-25  7:02 ` [RFC PATCH 37/39] blktrace: update blk_fill_rwbs() with new requests Chaitanya Kulkarni
2021-02-25  7:02 ` Chaitanya Kulkarni [this message]
2021-02-25  7:02 ` [RFC PATCH 39/39] blktrace: debug patch for the demo Chaitanya Kulkarni
2021-02-26  4:25 ` [RFC PATCH 00/39] blktrace: add block trace extension support Damien Le Moal

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=20210225070231.21136-39-chaitanya.kulkarni@wdc.com \
    --to=chaitanya.kulkarni@wdc.com \
    --cc=aravind.ramesh@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=damien.lemoal@wdc.com \
    --cc=dongli.zhang@oracle.com \
    --cc=hch@lst.de \
    --cc=johannes.thumshirn@wdc.com \
    --cc=joshi.k@samsung.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mingo@redhat.com \
    --cc=niklas.cassel@wdc.com \
    --cc=osandov@fb.com \
    --cc=rostedt@goodmis.org \
    --cc=viro@zeniv.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.