From patchwork Mon Jun 29 23:43:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11634211 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 65D496C1 for ; Tue, 30 Jun 2020 14:49:11 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1B23420663 for ; Tue, 30 Jun 2020 14:49:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B23420663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-326-IOKMvBvTOeCEN12wfJ2GYg-1; Tue, 30 Jun 2020 10:49:06 -0400 X-MC-Unique: IOKMvBvTOeCEN12wfJ2GYg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EF25819200C3; Tue, 30 Jun 2020 14:48:58 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D1FCA60CD0; Tue, 30 Jun 2020 14:48:58 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id AB8131800433; Tue, 30 Jun 2020 14:48:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05TNibAg020424 for ; Mon, 29 Jun 2020 19:44:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id 939812156A54; Mon, 29 Jun 2020 23:44:37 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6ACF12156A4E for ; Mon, 29 Jun 2020 23:44:35 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 603F3800143 for ; Mon, 29 Jun 2020 23:44:35 +0000 (UTC) Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-201-DHJlla1UOeKx6OyKK_tzcA-1; Mon, 29 Jun 2020 19:44:31 -0400 X-MC-Unique: DHJlla1UOeKx6OyKK_tzcA-1 IronPort-SDR: m2+s82TJes1IYP9RiQonHHnFD7xl853Be65/EUH9dpd6vhnWFO5raBnTHK3ofPSsaQdSdp5fXy GAH05iQ7pT2mMb/KgbW1QoUmqMM1VrKz8J7dubE+ZZ8igOvzIUY0tGpFMoEVZio05lBHSOQgKo t6xh6nPB/QvJzpUKZf65dtE8To/KwT/dzxoMhfHCAwHOl8du1VaSNn9kI8xqmeVOxBMa5glaks OYjqTkr4fyt9TH9HlLx2sDkFpM2IIcGZIkNieHETcMtVqx4S5CboNu2t6DIh5SqozdRLJ8fujc 3Wg= X-IronPort-AV: E=Sophos;i="5.75,296,1589212800"; d="scan'208";a="141220064" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 Jun 2020 07:43:25 +0800 IronPort-SDR: KeLWLdmxjfTu/UejIEuvdVe+k1LQ9Uyq0/s/CE/p/4uwrb8AaUX8AEeTmRvW0HGUE+jYGaLFFU Tn3lXRiQZfAEBaQ6WvbM//iAJAJMTuLnI= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jun 2020 16:31:45 -0700 IronPort-SDR: uG3fCcwY/B5SNgcEE22NujsRNqT1GdU67QrZWUOjlZYVNt4+3mwyZLYWV8/1jksNk3cqfuKMTf p1mBQuvFnqzQ== WDCIronportException: Internal Received: from iouring.labspan.wdc.com (HELO iouring.sc.wdc.com) ([10.6.138.107]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Jun 2020 16:43:25 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org, dm-devel@redhat.com Date: Mon, 29 Jun 2020 16:43:04 -0700 Message-Id: <20200629234314.10509-2-chaitanya.kulkarni@wdc.com> In-Reply-To: <20200629234314.10509-1-chaitanya.kulkarni@wdc.com> References: <20200629234314.10509-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Tue, 30 Jun 2020 10:48:45 -0400 Cc: axboe@kernel.dk, paolo.valente@linaro.org, sagi@grimberg.me, snitzer@redhat.com, Chaitanya Kulkarni , fangguoju@gmail.com, rdunlap@infradead.org, rostedt@goodmis.org, ming.lei@redhat.com, mingo@redhat.com, colyli@suse.de, jack@suse.czi, hch@lst.de, agk@redhat.com, bvanassche@acm.org Subject: [dm-devel] [PATCH 01/11] block: blktrace framework cleanup X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com This patch removes the extra variables from the trace events and overall kernel blktrace framework. The removed members can easily be extracted from the remaining argument which reduces the code significantly and allows us to optimize the several tracepoints like the next patch in the series.       Signed-off-by: Chaitanya Kulkarni --- block/blk-core.c | 6 +-- block/blk-merge.c | 4 +- block/blk-mq-sched.c | 2 +- block/blk-mq.c | 10 ++-- block/bounce.c | 2 +- drivers/md/dm.c | 4 +- include/trace/events/block.h | 87 +++++++++++++------------------- kernel/trace/blktrace.c | 98 ++++++++++++++++++------------------ 8 files changed, 98 insertions(+), 115 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 72b102a389a5..6d4c57ef4533 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -674,7 +674,7 @@ bool bio_attempt_back_merge(struct request *req, struct bio *bio, if (!ll_back_merge_fn(req, bio, nr_segs)) return false; - trace_block_bio_backmerge(req->q, req, bio); + trace_block_bio_backmerge(bio); rq_qos_merge(req->q, req, bio); if ((req->cmd_flags & REQ_FAILFAST_MASK) != ff) @@ -698,7 +698,7 @@ bool bio_attempt_front_merge(struct request *req, struct bio *bio, if (!ll_front_merge_fn(req, bio, nr_segs)) return false; - trace_block_bio_frontmerge(req->q, req, bio); + trace_block_bio_frontmerge(bio); rq_qos_merge(req->q, req, bio); if ((req->cmd_flags & REQ_FAILFAST_MASK) != ff) @@ -1082,7 +1082,7 @@ generic_make_request_checks(struct bio *bio) return false; if (!bio_flagged(bio, BIO_TRACE_COMPLETION)) { - trace_block_bio_queue(q, bio); + trace_block_bio_queue(bio); /* Now that enqueuing has been traced, we need to trace * completion as well. */ diff --git a/block/blk-merge.c b/block/blk-merge.c index 9c9fb21584b6..8333ccd60ee1 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -337,7 +337,7 @@ 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); + trace_block_split(split, (*bio)->bi_iter.bi_sector); generic_make_request(*bio); *bio = split; } @@ -793,7 +793,7 @@ static struct request *attempt_merge(struct request_queue *q, */ blk_account_io_merge_request(next); - trace_block_rq_merge(q, next); + trace_block_rq_merge(next); /* * ownership of bio passed from next to req, return 'next' for diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c index fdcc2c1dd178..a3cade16ef80 100644 --- a/block/blk-mq-sched.c +++ b/block/blk-mq-sched.c @@ -409,7 +409,7 @@ EXPORT_SYMBOL_GPL(blk_mq_sched_try_insert_merge); void blk_mq_sched_request_inserted(struct request *rq) { - trace_block_rq_insert(rq->q, rq); + trace_block_rq_insert(rq); } EXPORT_SYMBOL_GPL(blk_mq_sched_request_inserted); diff --git a/block/blk-mq.c b/block/blk-mq.c index b8738b3c6d06..dbb98b2bc868 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -742,7 +742,7 @@ void blk_mq_start_request(struct request *rq) { struct request_queue *q = rq->q; - trace_block_rq_issue(q, rq); + trace_block_rq_issue(rq); if (test_bit(QUEUE_FLAG_STATS, &q->queue_flags)) { rq->io_start_time_ns = ktime_get_ns(); @@ -769,7 +769,7 @@ static void __blk_mq_requeue_request(struct request *rq) blk_mq_put_driver_tag(rq); - trace_block_rq_requeue(q, rq); + trace_block_rq_requeue(rq); rq_qos_requeue(q, rq); if (blk_mq_request_started(rq)) { @@ -1758,7 +1758,7 @@ static inline void __blk_mq_insert_req_list(struct blk_mq_hw_ctx *hctx, lockdep_assert_held(&ctx->lock); - trace_block_rq_insert(hctx->queue, rq); + trace_block_rq_insert(rq); if (at_head) list_add(&rq->queuelist, &ctx->rq_lists[type]); @@ -1814,7 +1814,7 @@ void blk_mq_insert_requests(struct blk_mq_hw_ctx *hctx, struct blk_mq_ctx *ctx, */ list_for_each_entry(rq, list, queuelist) { BUG_ON(rq->mq_ctx != ctx); - trace_block_rq_insert(hctx->queue, rq); + trace_block_rq_insert(rq); } spin_lock(&ctx->lock); @@ -2111,7 +2111,7 @@ blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) goto queue_exit; } - trace_block_getrq(q, bio, bio->bi_opf); + trace_block_getrq(bio, bio->bi_opf); rq_qos_track(q, rq, bio); diff --git a/block/bounce.c b/block/bounce.c index c3aaed070124..9550640b1f86 100644 --- a/block/bounce.c +++ b/block/bounce.c @@ -341,7 +341,7 @@ static void __blk_queue_bounce(struct request_queue *q, struct bio **bio_orig, } } - trace_block_bio_bounce(q, *bio_orig); + trace_block_bio_bounce(*bio_orig); bio->bi_flags |= (1 << BIO_BOUNCED); diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 109e81f33edb..4b9ff226904d 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1678,7 +1678,7 @@ static blk_qc_t __split_and_process_bio(struct mapped_device *md, part_stat_unlock(); bio_chain(b, bio); - trace_block_split(md->queue, b, bio->bi_iter.bi_sector); + trace_block_split(b, bio->bi_iter.bi_sector); ret = generic_make_request(bio); break; } @@ -1745,7 +1745,7 @@ static void dm_queue_split(struct mapped_device *md, struct dm_target *ti, struc struct bio *split = bio_split(*bio, len, GFP_NOIO, &md->queue->bio_split); bio_chain(split, *bio); - trace_block_split(md->queue, split, (*bio)->bi_iter.bi_sector); + trace_block_split(split, (*bio)->bi_iter.bi_sector); generic_make_request(*bio); *bio = split; } diff --git a/include/trace/events/block.h b/include/trace/events/block.h index 34d64ca306b1..237d40a48429 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h @@ -64,7 +64,6 @@ DEFINE_EVENT(block_buffer, block_dirty_buffer, /** * block_rq_requeue - place block IO request back on a queue - * @q: queue holding operation * @rq: block IO operation request * * The block operation request @rq is being placed back into queue @@ -73,9 +72,9 @@ DEFINE_EVENT(block_buffer, block_dirty_buffer, */ TRACE_EVENT(block_rq_requeue, - TP_PROTO(struct request_queue *q, struct request *rq), + TP_PROTO(struct request *rq), - TP_ARGS(q, rq), + TP_ARGS(rq), TP_STRUCT__entry( __field( dev_t, dev ) @@ -103,7 +102,6 @@ TRACE_EVENT(block_rq_requeue, /** * block_rq_complete - block IO operation completed by device driver - * @rq: block operations request * @error: status code * @nr_bytes: number of completed bytes * @@ -147,9 +145,9 @@ TRACE_EVENT(block_rq_complete, DECLARE_EVENT_CLASS(block_rq, - TP_PROTO(struct request_queue *q, struct request *rq), + TP_PROTO(struct request *rq), - TP_ARGS(q, rq), + TP_ARGS(rq), TP_STRUCT__entry( __field( dev_t, dev ) @@ -181,24 +179,22 @@ DECLARE_EVENT_CLASS(block_rq, /** * block_rq_insert - insert block operation request into queue - * @q: target queue * @rq: block IO operation request * * Called immediately before block operation request @rq is inserted - * into queue @q. The fields in the operation request @rq struct can + * into queue. The fields in the operation request @rq struct can * be examined to determine which device and sectors the pending * operation would access. */ DEFINE_EVENT(block_rq, block_rq_insert, - TP_PROTO(struct request_queue *q, struct request *rq), + TP_PROTO(struct request *rq), - TP_ARGS(q, rq) + TP_ARGS(rq) ); /** * block_rq_issue - issue pending block IO request operation to device driver - * @q: queue holding operation * @rq: block IO operation operation request * * Called when block operation request @rq from queue @q is sent to a @@ -206,32 +202,30 @@ DEFINE_EVENT(block_rq, block_rq_insert, */ DEFINE_EVENT(block_rq, block_rq_issue, - TP_PROTO(struct request_queue *q, struct request *rq), + TP_PROTO(struct request *rq), - TP_ARGS(q, rq) + TP_ARGS(rq) ); /** * block_rq_merge - merge request with another one in the elevator - * @q: queue holding operation * @rq: block IO operation operation request * - * Called when block operation request @rq from queue @q is merged to another + * Called when block operation request @rq from queue is merged to another * request queued in the elevator. */ DEFINE_EVENT(block_rq, block_rq_merge, - TP_PROTO(struct request_queue *q, struct request *rq), + TP_PROTO(struct request *rq), - TP_ARGS(q, rq) + TP_ARGS(rq) ); /** * block_bio_bounce - used bounce buffer when processing block operation - * @q: queue holding the block operation * @bio: block operation * - * A bounce buffer was used to handle the block operation @bio in @q. + * A bounce buffer was used to handle the block operation @bio in queue. * This occurs when hardware limitations prevent a direct transfer of * data between the @bio data memory area and the IO device. Use of a * bounce buffer requires extra copying of data and decreases @@ -239,9 +233,9 @@ DEFINE_EVENT(block_rq, block_rq_merge, */ TRACE_EVENT(block_bio_bounce, - TP_PROTO(struct request_queue *q, struct bio *bio), + TP_PROTO(struct bio *bio), - TP_ARGS(q, bio), + TP_ARGS(bio), TP_STRUCT__entry( __field( dev_t, dev ) @@ -303,9 +297,9 @@ TRACE_EVENT(block_bio_complete, DECLARE_EVENT_CLASS(block_bio_merge, - TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio), + TP_PROTO(struct bio *bio), - TP_ARGS(q, rq, bio), + TP_ARGS(bio), TP_STRUCT__entry( __field( dev_t, dev ) @@ -331,48 +325,43 @@ DECLARE_EVENT_CLASS(block_bio_merge, /** * block_bio_backmerge - merging block operation to the end of an existing operation - * @q: queue holding operation - * @rq: request bio is being merged into * @bio: new block operation to merge * * Merging block request @bio to the end of an existing block request - * in queue @q. + * in queue. */ DEFINE_EVENT(block_bio_merge, block_bio_backmerge, - TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio), + TP_PROTO(struct bio *bio), - TP_ARGS(q, rq, bio) + TP_ARGS(bio) ); /** * block_bio_frontmerge - merging block operation to the beginning of an existing operation - * @q: queue holding operation - * @rq: request bio is being merged into * @bio: new block operation to merge * * Merging block IO operation @bio to the beginning of an existing block - * operation in queue @q. + * operation in queue. */ DEFINE_EVENT(block_bio_merge, block_bio_frontmerge, - TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio), + TP_PROTO(struct bio *bio), - TP_ARGS(q, rq, bio) + TP_ARGS(bio) ); /** * block_bio_queue - putting new block IO operation in queue - * @q: queue holding operation * @bio: new block operation * - * About to place the block IO operation @bio into queue @q. + * About to place the block IO operation @bio into queue. */ TRACE_EVENT(block_bio_queue, - TP_PROTO(struct request_queue *q, struct bio *bio), + TP_PROTO(struct bio *bio), - TP_ARGS(q, bio), + TP_ARGS(bio), TP_STRUCT__entry( __field( dev_t, dev ) @@ -398,9 +387,9 @@ TRACE_EVENT(block_bio_queue, DECLARE_EVENT_CLASS(block_get_rq, - TP_PROTO(struct request_queue *q, struct bio *bio, int rw), + TP_PROTO(struct bio *bio, int rw), - TP_ARGS(q, bio, rw), + TP_ARGS(bio, rw), TP_STRUCT__entry( __field( dev_t, dev ) @@ -427,36 +416,34 @@ DECLARE_EVENT_CLASS(block_get_rq, /** * block_getrq - get a free request entry in queue for block IO operations - * @q: queue for operations * @bio: pending block IO operation (can be %NULL) * @rw: low bit indicates a read (%0) or a write (%1) * - * A request struct for queue @q has been allocated to handle the + * A request struct for queue has been allocated to handle the * block IO operation @bio. */ DEFINE_EVENT(block_get_rq, block_getrq, - TP_PROTO(struct request_queue *q, struct bio *bio, int rw), + TP_PROTO(struct bio *bio, int rw), - TP_ARGS(q, bio, rw) + TP_ARGS(bio, rw) ); /** * block_sleeprq - waiting to get a free request entry in queue for block IO operation - * @q: queue for operation * @bio: pending block IO operation (can be %NULL) * @rw: low bit indicates a read (%0) or a write (%1) * - * In the case where a request struct cannot be provided for queue @q + * In the case where a request struct cannot be provided for queue * the process needs to wait for an request struct to become * available. This tracepoint event is generated each time the * process goes to sleep waiting for request struct become available. */ DEFINE_EVENT(block_get_rq, block_sleeprq, - TP_PROTO(struct request_queue *q, struct bio *bio, int rw), + TP_PROTO(struct bio *bio, int rw), - TP_ARGS(q, bio, rw) + TP_ARGS(bio, rw) ); /** @@ -521,7 +508,6 @@ DEFINE_EVENT(block_unplug, block_unplug, /** * block_split - split a single bio struct into two bio structs - * @q: queue containing the bio * @bio: block operation being split * @new_sector: The starting sector for the new bio * @@ -532,10 +518,9 @@ DEFINE_EVENT(block_unplug, block_unplug, */ TRACE_EVENT(block_split, - TP_PROTO(struct request_queue *q, struct bio *bio, - unsigned int new_sector), + TP_PROTO(struct bio *bio, unsigned int new_sector), - TP_ARGS(q, bio, new_sector), + TP_ARGS(bio, new_sector), TP_STRUCT__entry( __field( dev_t, dev ) diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 7ba62d68885a..7b72781a591d 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -28,6 +28,11 @@ #ifdef CONFIG_BLK_DEV_IO_TRACE +static inline struct request_queue *bio_q(struct bio *bio) +{ + return bio->bi_disk->queue; +} + static unsigned int blktrace_seq __read_mostly = 1; static struct trace_array *blk_tr; @@ -846,33 +851,28 @@ static void blk_add_trace_rq(struct request *rq, int error, rcu_read_unlock(); } -static void blk_add_trace_rq_insert(void *ignore, - struct request_queue *q, struct request *rq) +static void blk_add_trace_rq_insert(void *ignore, struct request *rq) { blk_add_trace_rq(rq, 0, blk_rq_bytes(rq), BLK_TA_INSERT, - blk_trace_request_get_cgid(q, rq)); + blk_trace_request_get_cgid(rq->q, rq)); } -static void blk_add_trace_rq_issue(void *ignore, - struct request_queue *q, struct request *rq) +static void blk_add_trace_rq_issue(void *ignore, struct request *rq) { blk_add_trace_rq(rq, 0, blk_rq_bytes(rq), BLK_TA_ISSUE, - blk_trace_request_get_cgid(q, rq)); + blk_trace_request_get_cgid(rq->q, rq)); } -static void blk_add_trace_rq_merge(void *ignore, - struct request_queue *q, struct request *rq) +static void blk_add_trace_rq_merge(void *ignore, struct request *rq) { blk_add_trace_rq(rq, 0, blk_rq_bytes(rq), BLK_TA_BACKMERGE, - blk_trace_request_get_cgid(q, rq)); + blk_trace_request_get_cgid(rq->q, rq)); } -static void blk_add_trace_rq_requeue(void *ignore, - struct request_queue *q, - struct request *rq) +static void blk_add_trace_rq_requeue(void *ignore, struct request *rq) { blk_add_trace_rq(rq, 0, blk_rq_bytes(rq), BLK_TA_REQUEUE, - blk_trace_request_get_cgid(q, rq)); + blk_trace_request_get_cgid(rq->q, rq)); } static void blk_add_trace_rq_complete(void *ignore, struct request *rq, @@ -893,13 +893,12 @@ static void blk_add_trace_rq_complete(void *ignore, struct request *rq, * Records an action against a bio. Will log the bio offset + size. * **/ -static void blk_add_trace_bio(struct request_queue *q, struct bio *bio, - u32 what, int error) +static void blk_add_trace_bio(struct bio *bio, u32 what, int error) { struct blk_trace *bt; rcu_read_lock(); - bt = rcu_dereference(q->blk_trace); + bt = rcu_dereference(bio_q(bio)->blk_trace); if (likely(!bt)) { rcu_read_unlock(); return; @@ -907,56 +906,59 @@ static void blk_add_trace_bio(struct request_queue *q, struct bio *bio, __blk_add_trace(bt, bio->bi_iter.bi_sector, bio->bi_iter.bi_size, bio_op(bio), bio->bi_opf, what, error, 0, NULL, - blk_trace_bio_get_cgid(q, bio)); + blk_trace_bio_get_cgid(bio_q(bio), bio)); rcu_read_unlock(); } -static void blk_add_trace_bio_bounce(void *ignore, - struct request_queue *q, struct bio *bio) +static void blk_add_trace_bio_bounce(void *ignore, struct bio *bio) { - blk_add_trace_bio(q, bio, BLK_TA_BOUNCE, 0); + blk_add_trace_bio(bio, BLK_TA_BOUNCE, 0); } -static void blk_add_trace_bio_complete(void *ignore, - struct request_queue *q, struct bio *bio) +static void blk_add_trace_bio_complete(void *ignore, struct request_queue *q, + struct bio *bio) { - blk_add_trace_bio(q, bio, BLK_TA_COMPLETE, - blk_status_to_errno(bio->bi_status)); + struct blk_trace *bt; + + rcu_read_lock(); + bt = rcu_dereference(q->blk_trace); + if (likely(!bt)) { + rcu_read_unlock(); + return; + } + + __blk_add_trace(bt, bio->bi_iter.bi_sector, bio->bi_iter.bi_size, + bio_op(bio), bio->bi_opf, BLK_TA_COMPLETE, + blk_status_to_errno(bio->bi_status), 0, NULL, + blk_trace_bio_get_cgid(q, bio)); + rcu_read_unlock(); } -static void blk_add_trace_bio_backmerge(void *ignore, - struct request_queue *q, - struct request *rq, - struct bio *bio) +static void blk_add_trace_bio_backmerge(void *ignore, struct bio *bio) { - blk_add_trace_bio(q, bio, BLK_TA_BACKMERGE, 0); + blk_add_trace_bio(bio, BLK_TA_BACKMERGE, 0); } -static void blk_add_trace_bio_frontmerge(void *ignore, - struct request_queue *q, - struct request *rq, - struct bio *bio) +static void blk_add_trace_bio_frontmerge(void *ignore, struct bio *bio) { - blk_add_trace_bio(q, bio, BLK_TA_FRONTMERGE, 0); + blk_add_trace_bio(bio, BLK_TA_FRONTMERGE, 0); } -static void blk_add_trace_bio_queue(void *ignore, - struct request_queue *q, struct bio *bio) +static void blk_add_trace_bio_queue(void *ignore, struct bio *bio) { - blk_add_trace_bio(q, bio, BLK_TA_QUEUE, 0); + blk_add_trace_bio(bio, BLK_TA_QUEUE, 0); } static void blk_add_trace_getrq(void *ignore, - struct request_queue *q, struct bio *bio, int rw) { if (bio) - blk_add_trace_bio(q, bio, BLK_TA_GETRQ, 0); + blk_add_trace_bio(bio, BLK_TA_GETRQ, 0); else { struct blk_trace *bt; rcu_read_lock(); - bt = rcu_dereference(q->blk_trace); + bt = rcu_dereference(bio_q(bio)->blk_trace); if (bt) __blk_add_trace(bt, 0, 0, rw, 0, BLK_TA_GETRQ, 0, 0, NULL, 0); @@ -965,17 +967,15 @@ static void blk_add_trace_getrq(void *ignore, } -static void blk_add_trace_sleeprq(void *ignore, - struct request_queue *q, - struct bio *bio, int rw) +static void blk_add_trace_sleeprq(void *ignore, struct bio *bio, int rw) { if (bio) - blk_add_trace_bio(q, bio, BLK_TA_SLEEPRQ, 0); + blk_add_trace_bio(bio, BLK_TA_SLEEPRQ, 0); else { struct blk_trace *bt; rcu_read_lock(); - bt = rcu_dereference(q->blk_trace); + bt = rcu_dereference(bio_q(bio)->blk_trace); if (bt) __blk_add_trace(bt, 0, 0, rw, 0, BLK_TA_SLEEPRQ, 0, 0, NULL, 0); @@ -1015,14 +1015,12 @@ static void blk_add_trace_unplug(void *ignore, struct request_queue *q, rcu_read_unlock(); } -static void blk_add_trace_split(void *ignore, - struct request_queue *q, struct bio *bio, - unsigned int pdu) +static void blk_add_trace_split(void *ignore, struct bio *bio, unsigned int pdu) { struct blk_trace *bt; rcu_read_lock(); - bt = rcu_dereference(q->blk_trace); + bt = rcu_dereference(bio_q(bio)->blk_trace); if (bt) { __be64 rpdu = cpu_to_be64(pdu); @@ -1031,7 +1029,7 @@ static void blk_add_trace_split(void *ignore, BLK_TA_SPLIT, blk_status_to_errno(bio->bi_status), sizeof(rpdu), &rpdu, - blk_trace_bio_get_cgid(q, bio)); + blk_trace_bio_get_cgid(bio_q(bio), bio)); } rcu_read_unlock(); } From patchwork Mon Jun 29 23:43:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11634209 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BFD29138C for ; Tue, 30 Jun 2020 14:49:10 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7575720663 for ; Tue, 30 Jun 2020 14:49:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7575720663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-110-DuUAFMCJPraPNAIPxHfwHw-1; Tue, 30 Jun 2020 10:49:07 -0400 X-MC-Unique: DuUAFMCJPraPNAIPxHfwHw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BFB5F107B273; Tue, 30 Jun 2020 14:48:58 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9FA6F60CD0; Tue, 30 Jun 2020 14:48:58 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 79B7A1809561; Tue, 30 Jun 2020 14:48:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05TNiioP020443 for ; Mon, 29 Jun 2020 19:44:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 717502156A4F; Mon, 29 Jun 2020 23:44:44 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6C0B52157F25 for ; Mon, 29 Jun 2020 23:44:44 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 51FF11049842 for ; Mon, 29 Jun 2020 23:44:44 +0000 (UTC) Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-358-kCxXWwfiPROrTKHJkCXbHA-1; Mon, 29 Jun 2020 19:44:42 -0400 X-MC-Unique: kCxXWwfiPROrTKHJkCXbHA-1 IronPort-SDR: AUitZF6r3OyDfNSSHprUMq5WtQWVegJjMxMgSLN9GcbcabJj6CbUyRlKkAzswgdwHLFDVPrQKm Fd/BwwlCLnwXvVpe5tMU9AYYVlufhikGzkg12BU2ER2sUN4BhvxZKW9fYG8xwWZcrhQoo/+VgD Ef6opyMesO+9RopSfAaCm3shX/QVXrTx9iTODTB0OnjaU8sj+wKFlvp/bDxv8isSLzAbA9rUA5 ozOYSs3lkZgNWQnF+D8xwaK14uVUgohS489phWTExX8HT0S9cE/73IRa9PNIOM6z1eGxt8KuV0 SrQ= X-IronPort-AV: E=Sophos;i="5.75,296,1589212800"; d="scan'208";a="250451423" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 Jun 2020 07:43:36 +0800 IronPort-SDR: 4i6qqe0lIJevTejfqQI7X6ADF0LJ53JX9JaoTV8e/SrR2kxnSCOWv3eb6D5Zlqj06QyfpmtH7h /HFGp5WXSoTAG25uQE+dLs34+1WJJ9eCI= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jun 2020 16:31:56 -0700 IronPort-SDR: TxSS+fRz0Jce2zgM3RsllAdgIl3rG5wnJxH46xqhp7x9Qs8459WU1bBxhoOsNSoV8SD7hkEBrG UuIG+hqqogAA== WDCIronportException: Internal Received: from iouring.labspan.wdc.com (HELO iouring.sc.wdc.com) ([10.6.138.107]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Jun 2020 16:43:36 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org, dm-devel@redhat.com Date: Mon, 29 Jun 2020 16:43:05 -0700 Message-Id: <20200629234314.10509-3-chaitanya.kulkarni@wdc.com> In-Reply-To: <20200629234314.10509-1-chaitanya.kulkarni@wdc.com> References: <20200629234314.10509-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Tue, 30 Jun 2020 10:48:45 -0400 Cc: axboe@kernel.dk, paolo.valente@linaro.org, sagi@grimberg.me, snitzer@redhat.com, Chaitanya Kulkarni , fangguoju@gmail.com, rdunlap@infradead.org, rostedt@goodmis.org, ming.lei@redhat.com, mingo@redhat.com, colyli@suse.de, jack@suse.czi, hch@lst.de, agk@redhat.com, bvanassche@acm.org Subject: [dm-devel] [PATCH 02/11] block: rename block_bio_merge class to block_bio X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com There are identical TRACE_EVENTS presents which can now take an advantage of the block_bio_merge trace event class. This is a prep patch which renames block_bio_merge to block_bio so that the next patches in this series will be able to resue it. Signed-off-by: Chaitanya Kulkarni --- include/trace/events/block.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/trace/events/block.h b/include/trace/events/block.h index 237d40a48429..b5be387c4115 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h @@ -295,7 +295,7 @@ TRACE_EVENT(block_bio_complete, __entry->nr_sector, __entry->error) ); -DECLARE_EVENT_CLASS(block_bio_merge, +DECLARE_EVENT_CLASS(block_bio, TP_PROTO(struct bio *bio), @@ -330,7 +330,7 @@ DECLARE_EVENT_CLASS(block_bio_merge, * Merging block request @bio to the end of an existing block request * in queue. */ -DEFINE_EVENT(block_bio_merge, block_bio_backmerge, +DEFINE_EVENT(block_bio, block_bio_backmerge, TP_PROTO(struct bio *bio), @@ -344,7 +344,7 @@ DEFINE_EVENT(block_bio_merge, block_bio_backmerge, * Merging block IO operation @bio to the beginning of an existing block * operation in queue. */ -DEFINE_EVENT(block_bio_merge, block_bio_frontmerge, +DEFINE_EVENT(block_bio, block_bio_frontmerge, TP_PROTO(struct bio *bio), From patchwork Mon Jun 29 23:43:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11634213 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B748A14E3 for ; Tue, 30 Jun 2020 14:49:11 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6CEFC20663 for ; Tue, 30 Jun 2020 14:49:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6CEFC20663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-422-oMuAlLI4N1avUAWj3jz6Fg-1; Tue, 30 Jun 2020 10:49:07 -0400 X-MC-Unique: oMuAlLI4N1avUAWj3jz6Fg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0740180466E; Tue, 30 Jun 2020 14:48:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E06235DC1E; Tue, 30 Jun 2020 14:48:56 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BA9301809554; Tue, 30 Jun 2020 14:48:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05TNhtTM020341 for ; Mon, 29 Jun 2020 19:43:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id EE7202029F79; Mon, 29 Jun 2020 23:43:54 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E9E162029F78 for ; Mon, 29 Jun 2020 23:43:53 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E7D6F185A78B for ; Mon, 29 Jun 2020 23:43:52 +0000 (UTC) Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-434-vH3TtY-lOIuM6lhpAxgCnQ-1; Mon, 29 Jun 2020 19:43:48 -0400 X-MC-Unique: vH3TtY-lOIuM6lhpAxgCnQ-1 IronPort-SDR: 7GzuzV+lmPk4ATLkjbNpCb6Kt3aLlOe1QYTlaYZZ7oSc4CG3c0EWoPLGXfLJ1OAJt7wPxJbxwt VMhBHtz2qLJH2Equ5sd1QdQUDf6VorU9LGQ9pbTsFxTUHBUPOkTw6F91QW8nT6kwYWpNHTjQNj oMRuZfppXmR/9SdSxmSdvoI4AG8fC/wa2iin+huwtsHJNC5NjUhmyAbPoN6k5hLUA/rHd5TnuJ aWzDyEtAOlllw6hPyPK91miSjh4fPXZJ6TE8cb4LmsRs61r07rVFDgkeDWiYRoB3ELFR0Copy9 1P8= X-IronPort-AV: E=Sophos;i="5.75,296,1589212800"; d="scan'208";a="141431396" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Jun 2020 07:43:47 +0800 IronPort-SDR: kwj86SRihGrn1elUhhZQBiHcaCI9HDiSlEDfDt7ZNdva1GHgXPu9QkbAOnc63QsWYzV2EqFt+e sBCC00pV/oKfKMetXlTy4K/+n2nt2rtW0= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jun 2020 16:32:40 -0700 IronPort-SDR: GWpo01VB/dDgqIVJbMjgir3MmktW2jUd980tnAe2STAeEiBIqW3F877xTOSjZFjHfBZPYVTjFl 4XXqzgO3aVug== WDCIronportException: Internal Received: from iouring.labspan.wdc.com (HELO iouring.sc.wdc.com) ([10.6.138.107]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Jun 2020 16:43:46 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org, dm-devel@redhat.com Date: Mon, 29 Jun 2020 16:43:06 -0700 Message-Id: <20200629234314.10509-4-chaitanya.kulkarni@wdc.com> In-Reply-To: <20200629234314.10509-1-chaitanya.kulkarni@wdc.com> References: <20200629234314.10509-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Tue, 30 Jun 2020 10:48:45 -0400 Cc: axboe@kernel.dk, paolo.valente@linaro.org, sagi@grimberg.me, snitzer@redhat.com, Chaitanya Kulkarni , fangguoju@gmail.com, rdunlap@infradead.org, rostedt@goodmis.org, ming.lei@redhat.com, mingo@redhat.com, colyli@suse.de, jack@suse.czi, hch@lst.de, agk@redhat.com, bvanassche@acm.org Subject: [dm-devel] [PATCH 03/11] block: use block_bio event class for bio_queue X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Remove block_bio_queue trace event which shares the code with block_bio. Signed-off-by: Chaitanya Kulkarni --- include/trace/events/block.h | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/include/trace/events/block.h b/include/trace/events/block.h index b5be387c4115..5e9f46469f50 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h @@ -357,32 +357,12 @@ DEFINE_EVENT(block_bio, block_bio_frontmerge, * * About to place the block IO operation @bio into queue. */ -TRACE_EVENT(block_bio_queue, - TP_PROTO(struct bio *bio), - - TP_ARGS(bio), - - TP_STRUCT__entry( - __field( dev_t, dev ) - __field( sector_t, sector ) - __field( unsigned int, nr_sector ) - __array( char, rwbs, RWBS_LEN ) - __array( char, comm, TASK_COMM_LEN ) - ), +DEFINE_EVENT(block_bio, block_bio_queue, - TP_fast_assign( - __entry->dev = bio_dev(bio); - __entry->sector = bio->bi_iter.bi_sector; - __entry->nr_sector = bio_sectors(bio); - blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size); - memcpy(__entry->comm, current->comm, TASK_COMM_LEN); - ), + TP_PROTO(struct bio *bio), - TP_printk("%d,%d %s %llu + %u [%s]", - MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, - (unsigned long long)__entry->sector, - __entry->nr_sector, __entry->comm) + TP_ARGS(bio) ); DECLARE_EVENT_CLASS(block_get_rq, From patchwork Mon Jun 29 23:43:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11634217 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0ED716C1 for ; Tue, 30 Jun 2020 14:49:16 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B8A7320663 for ; Tue, 30 Jun 2020 14:49:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B8A7320663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-216-YUM-bV7VOKOkTk7gZPH1TQ-1; Tue, 30 Jun 2020 10:49:11 -0400 X-MC-Unique: YUM-bV7VOKOkTk7gZPH1TQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 43E76804676; Tue, 30 Jun 2020 14:49:02 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 26FED5BAC8; Tue, 30 Jun 2020 14:49:02 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 014CF6C9CD; Tue, 30 Jun 2020 14:49:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05TNj5J1020507 for ; Mon, 29 Jun 2020 19:45:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id AEA352156890; Mon, 29 Jun 2020 23:45:05 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A93162156A4F for ; Mon, 29 Jun 2020 23:45:04 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3C32F1859172 for ; Mon, 29 Jun 2020 23:45:04 +0000 (UTC) Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-1-BUh4CrEzOcuFM2fpm4Fq7w-2; Mon, 29 Jun 2020 19:45:00 -0400 X-MC-Unique: BUh4CrEzOcuFM2fpm4Fq7w-2 IronPort-SDR: m5lrq06poJsHn2WhXuts/pAjVt4+yAfgZXajydH3nJtBEZnya4MauO3On4eiDNxxjAdOtuF2YZ 6066qqJvZBHVfFXZ8OefSvbjTJlQOpNPCX53mc4OjiPA9WSs2/hGq5ugbPo8xu9fM5htxihzQV grlDU+2uFabahJZRAsrfvIv6Evu6AGfCvLETaUjVg/GUbnFgMN3jzn2p5lLbfxqxtco1kziF7v BYHQSpVa1yvf2NfreRtEB0qBXxyxZcHHiM784Gdis7MDzTq8XI8YQO1qd4nwS1hiOOWyN11Oj4 mCE= X-IronPort-AV: E=Sophos;i="5.75,296,1589212800"; d="scan'208";a="141220090" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Jun 2020 07:43:56 +0800 IronPort-SDR: moQKFH8As+Dl6A2iqbN9fheGovNcuSLccEES7KtTopv7KOkCWBRd5y+hwBly4zLjRBt7fUUu+W xIQ+VBEzHP4CZCvOKj9eMupJqAWq0trs4= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jun 2020 16:32:49 -0700 IronPort-SDR: 2TTYKV2UBhmVUliSx1iiNA0qEyTuvXyPEcykDKJ/0JtkuwHLf1c4l7haqfPhSdQFt2rCuSffO0 J8bjRRwkx1QA== WDCIronportException: Internal Received: from iouring.labspan.wdc.com (HELO iouring.sc.wdc.com) ([10.6.138.107]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Jun 2020 16:43:56 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org, dm-devel@redhat.com Date: Mon, 29 Jun 2020 16:43:07 -0700 Message-Id: <20200629234314.10509-5-chaitanya.kulkarni@wdc.com> In-Reply-To: <20200629234314.10509-1-chaitanya.kulkarni@wdc.com> References: <20200629234314.10509-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Tue, 30 Jun 2020 10:48:45 -0400 Cc: axboe@kernel.dk, paolo.valente@linaro.org, sagi@grimberg.me, snitzer@redhat.com, Chaitanya Kulkarni , fangguoju@gmail.com, rdunlap@infradead.org, rostedt@goodmis.org, ming.lei@redhat.com, mingo@redhat.com, colyli@suse.de, jack@suse.czi, hch@lst.de, agk@redhat.com, bvanassche@acm.org Subject: [dm-devel] [PATCH 04/11] block: use block_bio event class for bio_bounce X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Remove block_bio_bounce trace event which shares the code with block_bio. Signed-off-by: Chaitanya Kulkarni --- include/trace/events/block.h | 56 ++++++++++++------------------------ 1 file changed, 18 insertions(+), 38 deletions(-) diff --git a/include/trace/events/block.h b/include/trace/events/block.h index 5e9f46469f50..d7289576f1fd 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h @@ -221,44 +221,6 @@ DEFINE_EVENT(block_rq, block_rq_merge, TP_ARGS(rq) ); -/** - * block_bio_bounce - used bounce buffer when processing block operation - * @bio: block operation - * - * A bounce buffer was used to handle the block operation @bio in queue. - * This occurs when hardware limitations prevent a direct transfer of - * data between the @bio data memory area and the IO device. Use of a - * bounce buffer requires extra copying of data and decreases - * performance. - */ -TRACE_EVENT(block_bio_bounce, - - TP_PROTO(struct bio *bio), - - TP_ARGS(bio), - - TP_STRUCT__entry( - __field( dev_t, dev ) - __field( sector_t, sector ) - __field( unsigned int, nr_sector ) - __array( char, rwbs, RWBS_LEN ) - __array( char, comm, TASK_COMM_LEN ) - ), - - TP_fast_assign( - __entry->dev = bio_dev(bio); - __entry->sector = bio->bi_iter.bi_sector; - __entry->nr_sector = bio_sectors(bio); - blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size); - memcpy(__entry->comm, current->comm, TASK_COMM_LEN); - ), - - TP_printk("%d,%d %s %llu + %u [%s]", - MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, - (unsigned long long)__entry->sector, - __entry->nr_sector, __entry->comm) -); - /** * block_bio_complete - completed all work on the block operation * @q: queue holding the block operation @@ -351,6 +313,24 @@ DEFINE_EVENT(block_bio, block_bio_frontmerge, TP_ARGS(bio) ); +/** + * block_bio_bounce - used bounce buffer when processing block operation + * @bio: block operation + * + * A bounce buffer was used to handle the block operation @bio in queue. + * This occurs when hardware limitations prevent a direct transfer of + * data between the @bio data memory area and the IO device. Use of a + * bounce buffer requires extra copying of data and decreases + * performance. + */ + +DEFINE_EVENT(block_bio, block_bio_bounce, + + TP_PROTO(struct bio *bio), + + TP_ARGS(bio) +); + /** * block_bio_queue - putting new block IO operation in queue * @bio: new block operation From patchwork Mon Jun 29 23:43:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11634219 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4311E6C1 for ; Tue, 30 Jun 2020 14:49:18 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EC6A820663 for ; Tue, 30 Jun 2020 14:49:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EC6A820663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-72-5YZoUNvLPuStjwTKOM5FmQ-1; Tue, 30 Jun 2020 10:49:13 -0400 X-MC-Unique: 5YZoUNvLPuStjwTKOM5FmQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 45F9019200CE; Tue, 30 Jun 2020 14:49:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2BE2C4F6B1; Tue, 30 Jun 2020 14:49:04 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 078136C9CF; Tue, 30 Jun 2020 14:49:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05TNjHBf020552 for ; Mon, 29 Jun 2020 19:45:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id E5D3A2029F79; Mon, 29 Jun 2020 23:45:16 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E1A802029F78 for ; Mon, 29 Jun 2020 23:45:15 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D6A7C1859162 for ; Mon, 29 Jun 2020 23:45:14 +0000 (UTC) Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-29-4ZqqwRjXP_a-NkgEZjhBBg-1; Mon, 29 Jun 2020 19:45:10 -0400 X-MC-Unique: 4ZqqwRjXP_a-NkgEZjhBBg-1 IronPort-SDR: /Pjz6SY4E3qc7oYxvl6N72pqlg7eM5p9EbVBhwFM+k4c/ZsnQ/BzERjl/xF2br2Istge3Pao2Y xhFY+qaWq+pEiQcXTjYVqUe7FVQU96UuuUG2Ch9Eo/oJHbDTVMT1N3O/vSVy9Q2zer/SO65CEb S3ocewY9hurjrimYRFupXQEciKpW/ryaqx+hQJmhyNo242Gy1QMobNKtvh9Pk2jCgwU0qCOVut hRdWBHdKilJC5rRAbjy6Ljjz9Q5Qew/0+vPX9ETZitWGLmTQiGv0ZGj1OTSpM+PQ4XynzsWNsK j3c= X-IronPort-AV: E=Sophos;i="5.75,296,1589212800"; d="scan'208";a="142577125" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 Jun 2020 07:44:06 +0800 IronPort-SDR: uo2VQRKcepD1hShgLhTBEJDoaWXgPw1xVH80m+XDR6mRVq5RbCwlmPDDIrHaujvVkZGdZJJRHj OOy24022NoXAN8x0yKGYgow/YibpATIew= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jun 2020 16:32:25 -0700 IronPort-SDR: yn+fTkYzKIONWd/yKRpIXTVlm4kdhQsPPaJj0Ll+2fNjLbgmv5tqXRTu4wtwdEXU91DTXuFxG3 CVJwlbT8xd2Q== WDCIronportException: Internal Received: from iouring.labspan.wdc.com (HELO iouring.sc.wdc.com) ([10.6.138.107]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Jun 2020 16:44:05 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org, dm-devel@redhat.com Date: Mon, 29 Jun 2020 16:43:08 -0700 Message-Id: <20200629234314.10509-6-chaitanya.kulkarni@wdc.com> In-Reply-To: <20200629234314.10509-1-chaitanya.kulkarni@wdc.com> References: <20200629234314.10509-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Tue, 30 Jun 2020 10:48:45 -0400 Cc: axboe@kernel.dk, paolo.valente@linaro.org, sagi@grimberg.me, snitzer@redhat.com, Chaitanya Kulkarni , fangguoju@gmail.com, rdunlap@infradead.org, rostedt@goodmis.org, ming.lei@redhat.com, mingo@redhat.com, colyli@suse.de, jack@suse.czi, hch@lst.de, agk@redhat.com, bvanassche@acm.org Subject: [dm-devel] [PATCH 05/11] block: get rid of the trace rq insert wrapper X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Get rid of the wrapper for trace_block_rq_insert() and call the function directly. Signed-off-by: Chaitanya Kulkarni --- block/bfq-iosched.c | 4 +++- block/blk-mq-sched.c | 6 ------ block/blk-mq-sched.h | 1 - block/kyber-iosched.c | 4 +++- block/mq-deadline.c | 4 +++- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 50c8f034c01c..e2b9b700ed34 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -125,6 +125,8 @@ #include #include +#include + #include "blk.h" #include "blk-mq.h" #include "blk-mq-tag.h" @@ -5507,7 +5509,7 @@ static void bfq_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq, spin_unlock_irq(&bfqd->lock); - blk_mq_sched_request_inserted(rq); + trace_block_rq_insert(rq); spin_lock_irq(&bfqd->lock); bfqq = bfq_init_rq(rq); diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c index a3cade16ef80..20b6a59fbd5a 100644 --- a/block/blk-mq-sched.c +++ b/block/blk-mq-sched.c @@ -407,12 +407,6 @@ bool blk_mq_sched_try_insert_merge(struct request_queue *q, struct request *rq) } EXPORT_SYMBOL_GPL(blk_mq_sched_try_insert_merge); -void blk_mq_sched_request_inserted(struct request *rq) -{ - trace_block_rq_insert(rq); -} -EXPORT_SYMBOL_GPL(blk_mq_sched_request_inserted); - static bool blk_mq_sched_bypass_insert(struct blk_mq_hw_ctx *hctx, bool has_sched, struct request *rq) diff --git a/block/blk-mq-sched.h b/block/blk-mq-sched.h index 126021fc3a11..04c40c695bf0 100644 --- a/block/blk-mq-sched.h +++ b/block/blk-mq-sched.h @@ -10,7 +10,6 @@ void blk_mq_sched_free_hctx_data(struct request_queue *q, void blk_mq_sched_assign_ioc(struct request *rq); -void blk_mq_sched_request_inserted(struct request *rq); bool blk_mq_sched_try_merge(struct request_queue *q, struct bio *bio, unsigned int nr_segs, struct request **merged_request); bool __blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio, diff --git a/block/kyber-iosched.c b/block/kyber-iosched.c index a38c5ab103d1..e42d78deee90 100644 --- a/block/kyber-iosched.c +++ b/block/kyber-iosched.c @@ -13,6 +13,8 @@ #include #include +#include + #include "blk.h" #include "blk-mq.h" #include "blk-mq-debugfs.h" @@ -602,7 +604,7 @@ static void kyber_insert_requests(struct blk_mq_hw_ctx *hctx, list_move_tail(&rq->queuelist, head); sbitmap_set_bit(&khd->kcq_map[sched_domain], rq->mq_ctx->index_hw[hctx->type]); - blk_mq_sched_request_inserted(rq); + trace_block_rq_insert(rq); spin_unlock(&kcq->lock); } } diff --git a/block/mq-deadline.c b/block/mq-deadline.c index b57470e154c8..f3631a287466 100644 --- a/block/mq-deadline.c +++ b/block/mq-deadline.c @@ -18,6 +18,8 @@ #include #include +#include + #include "blk.h" #include "blk-mq.h" #include "blk-mq-debugfs.h" @@ -496,7 +498,7 @@ static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq, if (blk_mq_sched_try_insert_merge(q, rq)) return; - blk_mq_sched_request_inserted(rq); + trace_block_rq_insert(rq); if (at_head || blk_rq_is_passthrough(rq)) { if (at_head) From patchwork Mon Jun 29 23:43:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11634207 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 175D8138C for ; Tue, 30 Jun 2020 14:49:10 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BE4A420663 for ; Tue, 30 Jun 2020 14:49:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE4A420663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-507-BRv4QE-cOkuY_EhNOzYdCA-1; Tue, 30 Jun 2020 10:49:06 -0400 X-MC-Unique: BRv4QE-cOkuY_EhNOzYdCA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 091AE80466F; Tue, 30 Jun 2020 14:48:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DEC4710013C0; Tue, 30 Jun 2020 14:48:56 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BA2D76C9CB; Tue, 30 Jun 2020 14:48:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05TNiMKV020383 for ; Mon, 29 Jun 2020 19:44:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id C97EA109FE5D; Mon, 29 Jun 2020 23:44:22 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C51D310E38DC for ; Mon, 29 Jun 2020 23:44:20 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1E642858EE2 for ; Mon, 29 Jun 2020 23:44:20 +0000 (UTC) Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-404-NTJ8RtLeMwK6Niz0yc5d7Q-1; Mon, 29 Jun 2020 19:44:16 -0400 X-MC-Unique: NTJ8RtLeMwK6Niz0yc5d7Q-1 IronPort-SDR: lIvAmBWDsKcj8kIqAxpO9BPDoVU7Zbk4nTgM6o2JxTviNhMZe4FW63Onyp471xsZQDsodOGy0S W92Tq6m6lCl426Ozdmak4fNDR4rSc6ONYO7l3T+54B2htTTYmyMbK0xLQUVFLZGluYNHD9ZaxY Hmy8d/WcHEET+8SlU54fW38lGzkSfKkZKEUxQpIkELWqGkjAts1LzXtSmF2v0LBNe8lZ8XMKcP 3liSQEyUarbKOog+zrjx7IxMD2KeLyf8Grz4Plbd51R+cUEQ/cNXIVzMVcSWtUAg4GQf0qEWkh EtI= X-IronPort-AV: E=Sophos;i="5.75,296,1589212800"; d="scan'208";a="145544751" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Jun 2020 07:44:15 +0800 IronPort-SDR: zrWpW3J7jP7+lrpJ24vWGdfHFMXCkljI5c9cV4kWWalJrwQc9Mb3MnzwfA2NAQZZI0Dj6UxHuX +HH0iNYluACAt4DNBQttdE0MuJZeBBbT4= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jun 2020 16:33:07 -0700 IronPort-SDR: QFmmXIwnVwMqHDqonKjxZOGDQQVIf2sH9oQwNx0KXycFd6uadSP94t6PxOe0NRoAWO/UJAx0RJ 8ovtlsScHh/Q== WDCIronportException: Internal Received: from iouring.labspan.wdc.com (HELO iouring.sc.wdc.com) ([10.6.138.107]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Jun 2020 16:44:14 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org, dm-devel@redhat.com Date: Mon, 29 Jun 2020 16:43:09 -0700 Message-Id: <20200629234314.10509-7-chaitanya.kulkarni@wdc.com> In-Reply-To: <20200629234314.10509-1-chaitanya.kulkarni@wdc.com> References: <20200629234314.10509-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Tue, 30 Jun 2020 10:48:45 -0400 Cc: axboe@kernel.dk, paolo.valente@linaro.org, sagi@grimberg.me, snitzer@redhat.com, Chaitanya Kulkarni , fangguoju@gmail.com, rdunlap@infradead.org, rostedt@goodmis.org, ming.lei@redhat.com, mingo@redhat.com, colyli@suse.de, jack@suse.czi, hch@lst.de, agk@redhat.com, bvanassche@acm.org Subject: [dm-devel] [PATCH 06/11] block: remove extra param for trace_block_getrq() X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Remove the extra parameter for trace_block_getrq() since we can derive I/O direction from bio->bi_opf. Signed-off-by: Chaitanya Kulkarni --- block/blk-mq.c | 2 +- include/trace/events/block.h | 14 ++++++-------- kernel/trace/blktrace.c | 13 ++++++------- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index dbb98b2bc868..d66bb299d4ae 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2111,7 +2111,7 @@ blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) goto queue_exit; } - trace_block_getrq(bio, bio->bi_opf); + trace_block_getrq(bio); rq_qos_track(q, rq, bio); diff --git a/include/trace/events/block.h b/include/trace/events/block.h index d7289576f1fd..3d8923062fc4 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h @@ -347,9 +347,9 @@ DEFINE_EVENT(block_bio, block_bio_queue, DECLARE_EVENT_CLASS(block_get_rq, - TP_PROTO(struct bio *bio, int rw), + TP_PROTO(struct bio *bio), - TP_ARGS(bio, rw), + TP_ARGS(bio), TP_STRUCT__entry( __field( dev_t, dev ) @@ -377,22 +377,20 @@ DECLARE_EVENT_CLASS(block_get_rq, /** * block_getrq - get a free request entry in queue for block IO operations * @bio: pending block IO operation (can be %NULL) - * @rw: low bit indicates a read (%0) or a write (%1) * * A request struct for queue has been allocated to handle the * block IO operation @bio. */ DEFINE_EVENT(block_get_rq, block_getrq, - TP_PROTO(struct bio *bio, int rw), + TP_PROTO(struct bio *bio), - TP_ARGS(bio, rw) + TP_ARGS(bio) ); /** * block_sleeprq - waiting to get a free request entry in queue for block IO operation * @bio: pending block IO operation (can be %NULL) - * @rw: low bit indicates a read (%0) or a write (%1) * * In the case where a request struct cannot be provided for queue * the process needs to wait for an request struct to become @@ -401,9 +399,9 @@ DEFINE_EVENT(block_get_rq, block_getrq, */ DEFINE_EVENT(block_get_rq, block_sleeprq, - TP_PROTO(struct bio *bio, int rw), + TP_PROTO(struct bio *bio), - TP_ARGS(bio, rw) + TP_ARGS(bio) ); /** diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 7b72781a591d..1d36e6153ab8 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -949,8 +949,7 @@ static void blk_add_trace_bio_queue(void *ignore, struct bio *bio) blk_add_trace_bio(bio, BLK_TA_QUEUE, 0); } -static void blk_add_trace_getrq(void *ignore, - struct bio *bio, int rw) +static void blk_add_trace_getrq(void *ignore, struct bio *bio) { if (bio) blk_add_trace_bio(bio, BLK_TA_GETRQ, 0); @@ -960,14 +959,14 @@ static void blk_add_trace_getrq(void *ignore, rcu_read_lock(); bt = rcu_dereference(bio_q(bio)->blk_trace); if (bt) - __blk_add_trace(bt, 0, 0, rw, 0, BLK_TA_GETRQ, 0, 0, - NULL, 0); + __blk_add_trace(bt, 0, 0, bio->bi_opf, 0, + BLK_TA_GETRQ, 0, 0, NULL, 0); rcu_read_unlock(); } } -static void blk_add_trace_sleeprq(void *ignore, struct bio *bio, int rw) +static void blk_add_trace_sleeprq(void *ignore, struct bio *bio) { if (bio) blk_add_trace_bio(bio, BLK_TA_SLEEPRQ, 0); @@ -977,8 +976,8 @@ static void blk_add_trace_sleeprq(void *ignore, struct bio *bio, int rw) rcu_read_lock(); bt = rcu_dereference(bio_q(bio)->blk_trace); if (bt) - __blk_add_trace(bt, 0, 0, rw, 0, BLK_TA_SLEEPRQ, - 0, 0, NULL, 0); + __blk_add_trace(bt, 0, 0, bio->bi_opf, 0, + BLK_TA_SLEEPRQ, 0, 0, NULL, 0); rcu_read_unlock(); } } From patchwork Mon Jun 29 23:43:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11634201 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CEE83138C for ; Tue, 30 Jun 2020 14:48:55 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8324D20663 for ; Tue, 30 Jun 2020 14:48:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8324D20663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-500-J-EBBk94MpqJD4MrnBU6OQ-1; Tue, 30 Jun 2020 10:48:52 -0400 X-MC-Unique: J-EBBk94MpqJD4MrnBU6OQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DFFC8107ACF2; Tue, 30 Jun 2020 14:48:47 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9D5277BEBE; Tue, 30 Jun 2020 14:48:47 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 21EA96C9C8; Tue, 30 Jun 2020 14:48:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05TNiTOt020400 for ; Mon, 29 Jun 2020 19:44:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 848E32029F81; Mon, 29 Jun 2020 23:44:29 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8068B2029F79 for ; Mon, 29 Jun 2020 23:44:27 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7A4CF800883 for ; Mon, 29 Jun 2020 23:44:27 +0000 (UTC) Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-220-RrvTTI1tNsi3FkPzgyaa-A-1; Mon, 29 Jun 2020 19:44:24 -0400 X-MC-Unique: RrvTTI1tNsi3FkPzgyaa-A-1 IronPort-SDR: R4vBs+S9TcZPGvJOwx22WZZKzLFfzpSTixO1XiSYEKnn5FjlbmHUjHss/NJBmEWMEW/bmNgxnN p3R4+J5iqMb4fcowCCnXqIR2jUlv/Q+ZYIdRMS5gVrSP11raSiaK78ZYnNqYmuAFHEiOwWpMeO 6E9wrM2Ae91SEfsZSnzLd7zGUibPcJzggwNy2AqMhxAw9wrGSVYn146xOM9qXXGs8J1NXzbvNg khgRB5bbFVLfAbAWGmaRQuYttekDRx+LV32/PmnuaNOpEFl2rkFzaCqhl1XwV+l+GMylkRwMjj zsQ= X-IronPort-AV: E=Sophos;i="5.75,296,1589212800"; d="scan'208";a="141431445" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 Jun 2020 07:44:23 +0800 IronPort-SDR: mQpHWNJ5UMt0+yY7XLkciv4GQKjLD4kjSCTk2BnzSMt0+sZDAcf/ntPeLLVaQP8+r4uhatq/gz q7loFpIxBBlqGO8TQ69iZrmBT7jc2AgWg= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jun 2020 16:32:43 -0700 IronPort-SDR: TMjCv1P8V1EeKz6bnWpEiZmnvuYzuTYBmaPtIh375x1fm74/Pz/7R5PydgzYumXw90ZHscENtH UmSWjd8gVN2A== WDCIronportException: Internal Received: from iouring.labspan.wdc.com (HELO iouring.sc.wdc.com) ([10.6.138.107]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Jun 2020 16:44:22 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org, dm-devel@redhat.com Date: Mon, 29 Jun 2020 16:43:10 -0700 Message-Id: <20200629234314.10509-8-chaitanya.kulkarni@wdc.com> In-Reply-To: <20200629234314.10509-1-chaitanya.kulkarni@wdc.com> References: <20200629234314.10509-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Tue, 30 Jun 2020 10:48:45 -0400 Cc: axboe@kernel.dk, paolo.valente@linaro.org, sagi@grimberg.me, snitzer@redhat.com, Chaitanya Kulkarni , fangguoju@gmail.com, rdunlap@infradead.org, rostedt@goodmis.org, ming.lei@redhat.com, mingo@redhat.com, colyli@suse.de, jack@suse.czi, hch@lst.de, agk@redhat.com, bvanassche@acm.org Subject: [dm-devel] [PATCH 07/11] block: get rid of blk_trace_request_get_cgid() X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Now that we have done cleanup we can safely get rid of the blk_trace_request_get_cgid() and replace it with blk_trace_bio_get_cgid(). Signed-off-by: Chaitanya Kulkarni --- kernel/trace/blktrace.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 1d36e6153ab8..bb864a50307f 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -804,15 +804,6 @@ u64 blk_trace_bio_get_cgid(struct request_queue *q, struct bio *bio) } #endif -static u64 -blk_trace_request_get_cgid(struct request_queue *q, struct request *rq) -{ - if (!rq->bio) - return 0; - /* Use the first bio */ - return blk_trace_bio_get_cgid(q, rq->bio); -} - /* * blktrace probes */ @@ -854,32 +845,32 @@ static void blk_add_trace_rq(struct request *rq, int error, static void blk_add_trace_rq_insert(void *ignore, struct request *rq) { blk_add_trace_rq(rq, 0, blk_rq_bytes(rq), BLK_TA_INSERT, - blk_trace_request_get_cgid(rq->q, rq)); + rq->bio ? blk_trace_bio_get_cgid(rq->q, rq->bio) : 0); } static void blk_add_trace_rq_issue(void *ignore, struct request *rq) { blk_add_trace_rq(rq, 0, blk_rq_bytes(rq), BLK_TA_ISSUE, - blk_trace_request_get_cgid(rq->q, rq)); + rq->bio ? blk_trace_bio_get_cgid(rq->q, rq->bio) : 0); } static void blk_add_trace_rq_merge(void *ignore, struct request *rq) { blk_add_trace_rq(rq, 0, blk_rq_bytes(rq), BLK_TA_BACKMERGE, - blk_trace_request_get_cgid(rq->q, rq)); + rq->bio ? blk_trace_bio_get_cgid(rq->q, rq->bio) : 0); } static void blk_add_trace_rq_requeue(void *ignore, struct request *rq) { blk_add_trace_rq(rq, 0, blk_rq_bytes(rq), BLK_TA_REQUEUE, - blk_trace_request_get_cgid(rq->q, rq)); + rq->bio ? blk_trace_bio_get_cgid(rq->q, rq->bio) : 0); } static void blk_add_trace_rq_complete(void *ignore, struct request *rq, int error, unsigned int nr_bytes) { blk_add_trace_rq(rq, error, nr_bytes, BLK_TA_COMPLETE, - blk_trace_request_get_cgid(rq->q, rq)); + rq->bio ? blk_trace_bio_get_cgid(rq->q, rq->bio) : 0); } /** @@ -1105,7 +1096,8 @@ static void blk_add_trace_rq_remap(void *ignore, __blk_add_trace(bt, blk_rq_pos(rq), blk_rq_bytes(rq), rq_data_dir(rq), 0, BLK_TA_REMAP, 0, - sizeof(r), &r, blk_trace_request_get_cgid(q, rq)); + sizeof(r), &r, + rq->bio ? blk_trace_bio_get_cgid(q, rq->bio) : 0); rcu_read_unlock(); } @@ -1134,8 +1126,8 @@ void blk_add_driver_data(struct request_queue *q, } __blk_add_trace(bt, blk_rq_trace_sector(rq), blk_rq_bytes(rq), 0, 0, - BLK_TA_DRV_DATA, 0, len, data, - blk_trace_request_get_cgid(q, rq)); + BLK_TA_DRV_DATA, 0, len, data, + rq->bio ? blk_trace_bio_get_cgid(q, rq->bio) : 0); rcu_read_unlock(); } EXPORT_SYMBOL_GPL(blk_add_driver_data); From patchwork Mon Jun 29 23:43:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11634205 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 13D59138C for ; Tue, 30 Jun 2020 14:49:07 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BD5B720663 for ; Tue, 30 Jun 2020 14:49:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD5B720663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-28-IBlc3KANPaK1oyO96ZjHKQ-1; Tue, 30 Jun 2020 10:49:03 -0400 X-MC-Unique: IBlc3KANPaK1oyO96ZjHKQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8B99D804666; Tue, 30 Jun 2020 14:48:56 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 70AFA5DC1E; Tue, 30 Jun 2020 14:48:56 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4C6086C9CA; Tue, 30 Jun 2020 14:48:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05TNimfh020454 for ; Mon, 29 Jun 2020 19:44:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3057610F04B; Mon, 29 Jun 2020 23:44:48 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 80F6410FACC for ; Mon, 29 Jun 2020 23:44:40 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6A490185A78B for ; Mon, 29 Jun 2020 23:44:40 +0000 (UTC) Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-261-w3EEPoQMP3CYnXwadpqqIg-1; Mon, 29 Jun 2020 19:44:37 -0400 X-MC-Unique: w3EEPoQMP3CYnXwadpqqIg-1 IronPort-SDR: L/6pY7XOSv8UTVgI2RMyqxpSmb5rqq6Oi6AU2xfUzPyjFgyvtHrxM7O/HnMzey5XSM3G/jwp83 twS1N8vOd8daT3wYuO0izoOCbqY9k7ZdYLQi77bTUiUr4GGjke9PCit7m6N5jgTECSb1wEvO07 8PE4ZGYOWUxIah1MOJTlY/C83OkuztPGHOPiK7gqTs+ljoJ5Le4ZNDACA5qvODVqWRArQhTeqA LbCUE4wqBsGspJVd3o/WyYt1TpWBsbekNYA+0odjVjrz4HuwMQVn9+yFCzQzsc/+OQik3qCz6s w00= X-IronPort-AV: E=Sophos;i="5.75,296,1589212800"; d="scan'208";a="141431451" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 30 Jun 2020 07:44:31 +0800 IronPort-SDR: N+Q3bnzbkbVL0SsZlhKwqEZ5FzzZHbKubGtRj6nlH83AsbxqnLsIC/ykyok1c343ss4F/BPDJJ K6oIu1pBhRaKvrAx4/axGMDPNRZzw1EDo= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jun 2020 16:33:23 -0700 IronPort-SDR: ZSdzI9vxkzz1tOehmS7qpaytmCk5G6bJUtY9juZKJEfzT0tB+0d518YlIGIFXkDRR/2aHlo+9/ 9Lze0F0Ur6GQ== WDCIronportException: Internal Received: from iouring.labspan.wdc.com (HELO iouring.sc.wdc.com) ([10.6.138.107]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Jun 2020 16:44:30 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org, dm-devel@redhat.com Date: Mon, 29 Jun 2020 16:43:11 -0700 Message-Id: <20200629234314.10509-9-chaitanya.kulkarni@wdc.com> In-Reply-To: <20200629234314.10509-1-chaitanya.kulkarni@wdc.com> References: <20200629234314.10509-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Tue, 30 Jun 2020 10:48:45 -0400 Cc: axboe@kernel.dk, paolo.valente@linaro.org, sagi@grimberg.me, snitzer@redhat.com, Chaitanya Kulkarni , fangguoju@gmail.com, rdunlap@infradead.org, rostedt@goodmis.org, ming.lei@redhat.com, mingo@redhat.com, colyli@suse.de, jack@suse.czi, hch@lst.de, agk@redhat.com, bvanassche@acm.org Subject: [dm-devel] [PATCH 08/11] block: fix the comments in the trace event block.h X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com This is purely cleanup patch which fixes the comment in trace event header for block_rq_issue() and block_rq_merge() events. Signed-off-by: Chaitanya Kulkarni --- include/trace/events/block.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/trace/events/block.h b/include/trace/events/block.h index 3d8923062fc4..6a74fb9f4dba 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h @@ -195,7 +195,7 @@ DEFINE_EVENT(block_rq, block_rq_insert, /** * block_rq_issue - issue pending block IO request operation to device driver - * @rq: block IO operation operation request + * @rq: block IO operation request * * Called when block operation request @rq from queue @q is sent to a * device driver for processing. @@ -209,7 +209,7 @@ DEFINE_EVENT(block_rq, block_rq_issue, /** * block_rq_merge - merge request with another one in the elevator - * @rq: block IO operation operation request + * @rq: block IO operation request * * Called when block operation request @rq from queuei is merged to another * request queued in the elevator. From patchwork Mon Jun 29 23:43:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11634215 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1BB02138C for ; Tue, 30 Jun 2020 14:49:15 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C4C9220663 for ; Tue, 30 Jun 2020 14:49:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C4C9220663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-510-VYGlagueNGqeh_JXpxobwA-1; Tue, 30 Jun 2020 10:49:11 -0400 X-MC-Unique: VYGlagueNGqeh_JXpxobwA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BABFE6BF93; Tue, 30 Jun 2020 14:49:00 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9BEEF610F2; Tue, 30 Jun 2020 14:49:00 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 747AE180043A; Tue, 30 Jun 2020 14:49:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05TNj3jn020495 for ; Mon, 29 Jun 2020 19:45:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id E88AA109FE5D; Mon, 29 Jun 2020 23:45:02 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E411C10073AA for ; Mon, 29 Jun 2020 23:45:00 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 185D0858EE9 for ; Mon, 29 Jun 2020 23:45:00 +0000 (UTC) Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-481-u10XA9LkN5-c-XIEvBOAOA-1; Mon, 29 Jun 2020 19:44:58 -0400 X-MC-Unique: u10XA9LkN5-c-XIEvBOAOA-1 IronPort-SDR: dt3esbkeyyb1z/WyNwsLnbgYgXQO7K+4/YKSqvR+ghq8lU13u3Wfvv0sVf3A2bEf9nNhNFBstP v1FUP6F80yPBg9wzvThtGlBj5rnNr3/grpQGPpyttrUjWX4AUvn2YxRil9B3GFrerdcKIxXgi7 vDEz+Tgbfwvz7X31OsstcVRQdpLZJ1f6Ed0uvLP+B2+pIkyPhQdYsJlL99Yuv+662N/g1Kcuwg yKYkjHyCfWc2sjUMGOJ8syyin0bZmQE/sqp5E+RPeHTvqKeguh7g8muWJhdU3gdTJZFAmYpRiH /ns= X-IronPort-AV: E=Sophos;i="5.75,296,1589212800"; d="scan'208";a="145544770" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 Jun 2020 07:44:46 +0800 IronPort-SDR: 8zVmlsDWWvqUsXumrk61YM3F6M48u3knz95r0UNdY3DURGNicXSyiNL8AMwPRnHDMq7hcJfIxt VD0iTPO4A8dWoR3M4ZtpDKy+uZOzb+nAc= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jun 2020 16:33:05 -0700 IronPort-SDR: eJVPUTuujTN8U32pyHeiRa+NyV6u0EjMR7qOqnZBGn5achSWGJo2gq/hQVknIr/jytb05lKxT/ bIdg4XHqyFag== WDCIronportException: Internal Received: from iouring.labspan.wdc.com (HELO iouring.sc.wdc.com) ([10.6.138.107]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Jun 2020 16:44:45 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org, dm-devel@redhat.com Date: Mon, 29 Jun 2020 16:43:12 -0700 Message-Id: <20200629234314.10509-10-chaitanya.kulkarni@wdc.com> In-Reply-To: <20200629234314.10509-1-chaitanya.kulkarni@wdc.com> References: <20200629234314.10509-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Tue, 30 Jun 2020 10:48:45 -0400 Cc: axboe@kernel.dk, paolo.valente@linaro.org, sagi@grimberg.me, snitzer@redhat.com, Chaitanya Kulkarni , fangguoju@gmail.com, rdunlap@infradead.org, rostedt@goodmis.org, ming.lei@redhat.com, mingo@redhat.com, colyli@suse.de, jack@suse.czi, hch@lst.de, agk@redhat.com, bvanassche@acm.org Subject: [dm-devel] [PATCH 09/11] block: remove unsed param in blk_fill_rwbs() X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com The last parameter for the function blk_fill_rwbs() was added in 5782138e47 ("tracing/events: convert block trace points to TRACE_EVENT()") in order to signal read request and use of that parameter was replaced with using switch case REQ_OP_READ with 1b9a9ab78b0 ("blktrace: use op accessors"), but the parameter was never removed. This patch removes unused parameter which also allows us to merge existing trace points in the following patch. Signed-off-by: Chaitanya Kulkarni --- include/linux/blktrace_api.h | 2 +- include/trace/events/bcache.h | 10 +++++----- include/trace/events/block.h | 19 +++++++++---------- kernel/trace/blktrace.c | 2 +- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index 3b6ff5902edc..80123eebf005 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h @@ -120,7 +120,7 @@ struct compat_blk_user_trace_setup { #endif -extern void blk_fill_rwbs(char *rwbs, unsigned int op, int bytes); +extern void blk_fill_rwbs(char *rwbs, unsigned int op); static inline sector_t blk_rq_trace_sector(struct request *rq) { diff --git a/include/trace/events/bcache.h b/include/trace/events/bcache.h index 0bddea663b3b..41415637e92c 100644 --- a/include/trace/events/bcache.h +++ b/include/trace/events/bcache.h @@ -28,7 +28,7 @@ DECLARE_EVENT_CLASS(bcache_request, __entry->sector = bio->bi_iter.bi_sector; __entry->orig_sector = bio->bi_iter.bi_sector - 16; __entry->nr_sector = bio->bi_iter.bi_size >> 9; - blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio->bi_opf); ), TP_printk("%d,%d %s %llu + %u (from %d,%d @ %llu)", @@ -102,7 +102,7 @@ DECLARE_EVENT_CLASS(bcache_bio, __entry->dev = bio_dev(bio); __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio->bi_iter.bi_size >> 9; - blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio->bi_opf); ), TP_printk("%d,%d %s %llu + %u", @@ -137,7 +137,7 @@ TRACE_EVENT(bcache_read, __entry->dev = bio_dev(bio); __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio->bi_iter.bi_size >> 9; - blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio->bi_opf); __entry->cache_hit = hit; __entry->bypass = bypass; ), @@ -168,7 +168,7 @@ TRACE_EVENT(bcache_write, __entry->inode = inode; __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio->bi_iter.bi_size >> 9; - blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio->bi_opf); __entry->writeback = writeback; __entry->bypass = bypass; ), @@ -238,7 +238,7 @@ TRACE_EVENT(bcache_journal_write, __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio->bi_iter.bi_size >> 9; __entry->nr_keys = keys; - blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio->bi_opf); ), TP_printk("%d,%d %s %llu + %u keys %u", diff --git a/include/trace/events/block.h b/include/trace/events/block.h index 6a74fb9f4dba..d191d2cd1070 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h @@ -89,7 +89,7 @@ TRACE_EVENT(block_rq_requeue, __entry->sector = blk_rq_trace_sector(rq); __entry->nr_sector = blk_rq_trace_nr_sectors(rq); - blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq)); + blk_fill_rwbs(__entry->rwbs, rq->cmd_flags); __get_str(cmd)[0] = '\0'; ), @@ -132,7 +132,7 @@ TRACE_EVENT(block_rq_complete, __entry->nr_sector = nr_bytes >> 9; __entry->error = error; - blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, nr_bytes); + blk_fill_rwbs(__entry->rwbs, rq->cmd_flags); __get_str(cmd)[0] = '\0'; ), @@ -165,7 +165,7 @@ DECLARE_EVENT_CLASS(block_rq, __entry->nr_sector = blk_rq_trace_nr_sectors(rq); __entry->bytes = blk_rq_bytes(rq); - blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq)); + blk_fill_rwbs(__entry->rwbs, rq->cmd_flags); __get_str(cmd)[0] = '\0'; memcpy(__entry->comm, current->comm, TASK_COMM_LEN); ), @@ -248,7 +248,7 @@ TRACE_EVENT(block_bio_complete, __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio_sectors(bio); __entry->error = blk_status_to_errno(bio->bi_status); - blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio->bi_opf); ), TP_printk("%d,%d %s %llu + %u [%d]", @@ -275,7 +275,7 @@ DECLARE_EVENT_CLASS(block_bio, __entry->dev = bio_dev(bio); __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio_sectors(bio); - blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio->bi_opf); memcpy(__entry->comm, current->comm, TASK_COMM_LEN); ), @@ -363,8 +363,7 @@ DECLARE_EVENT_CLASS(block_get_rq, __entry->dev = bio ? bio_dev(bio) : 0; __entry->sector = bio ? bio->bi_iter.bi_sector : 0; __entry->nr_sector = bio ? bio_sectors(bio) : 0; - blk_fill_rwbs(__entry->rwbs, - bio ? bio->bi_opf : 0, __entry->nr_sector); + blk_fill_rwbs(__entry->rwbs, bio ? bio->bi_opf : 0); memcpy(__entry->comm, current->comm, TASK_COMM_LEN); ), @@ -492,7 +491,7 @@ TRACE_EVENT(block_split, __entry->dev = bio_dev(bio); __entry->sector = bio->bi_iter.bi_sector; __entry->new_sector = new_sector; - blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio->bi_opf); memcpy(__entry->comm, current->comm, TASK_COMM_LEN); ), @@ -535,7 +534,7 @@ TRACE_EVENT(block_bio_remap, __entry->nr_sector = bio_sectors(bio); __entry->old_dev = dev; __entry->old_sector = from; - blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size); + blk_fill_rwbs(__entry->rwbs, bio->bi_opf); ), TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu", @@ -581,7 +580,7 @@ TRACE_EVENT(block_rq_remap, __entry->old_dev = dev; __entry->old_sector = from; __entry->nr_bios = blk_rq_count_bios(rq); - blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq)); + blk_fill_rwbs(__entry->rwbs, rq->cmd_flags); ), TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu %u", diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index bb864a50307f..62cb6197ce1f 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -1950,7 +1950,7 @@ void blk_trace_remove_sysfs(struct device *dev) #ifdef CONFIG_EVENT_TRACING -void blk_fill_rwbs(char *rwbs, unsigned int op, int bytes) +void blk_fill_rwbs(char *rwbs, unsigned int op) { int i = 0; From patchwork Mon Jun 29 23:43:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11634221 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 50B8A138C for ; Tue, 30 Jun 2020 14:49:18 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 024762072D for ; Tue, 30 Jun 2020 14:49:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 024762072D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-481-UAejvF3CPkWvAVrGRN12-Q-1; Tue, 30 Jun 2020 10:49:15 -0400 X-MC-Unique: UAejvF3CPkWvAVrGRN12-Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 81E9119200D1; Tue, 30 Jun 2020 14:49:00 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 633D82B4B0; Tue, 30 Jun 2020 14:49:00 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3C4AA6C9CB; Tue, 30 Jun 2020 14:49:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05TNj35o020496 for ; Mon, 29 Jun 2020 19:45:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0957E2157F25; Mon, 29 Jun 2020 23:45:03 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 04DAB2166BA3 for ; Mon, 29 Jun 2020 23:45:00 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CD2F2800260 for ; Mon, 29 Jun 2020 23:45:00 +0000 (UTC) Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-1--q9NBEFGMxuBEnncqU1mVw-1; Mon, 29 Jun 2020 19:44:58 -0400 X-MC-Unique: -q9NBEFGMxuBEnncqU1mVw-1 IronPort-SDR: /EC9w4DtCTB0Oq3TD+A6NI7LHVuaop72oHb0g/+ymgRjb4nD1RWgDVrjuTQUqjnlhiDJCZwzAy F9lnyd5ybENGUo5T/91nMSfrtFS6U1pXQtw697/obK55p6xX60qjRB7LvPbytKHP0lP0usV/kg SD1g4XngZnSovlUfafUa0lUyE6kRtMCBIzpRnls5mJmJdkMVUZCQyM1GkfajMNMpdgtwPTfYjl H2m7BXlOab0pJqBE2iFWHFoxtX1Kc956eabF8vvG5fcaDPMV5CjXOB/yF2rBD5/a0kKTaQUFrc UTU= X-IronPort-AV: E=Sophos;i="5.75,296,1589212800"; d="scan'208";a="141220130" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 Jun 2020 07:44:52 +0800 IronPort-SDR: hgHRUhkCMzpLcCNONUOjzEi6tFpV96LSYTjozJ0eLaMcbgEu8+KeuSMQKNX1H5lP1c7eQKSOyU sPkqGHEwcR/pA9H9bA0R5jMhHUnWHUDSY= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jun 2020 16:33:13 -0700 IronPort-SDR: XOE0qzV3gOcUVjTZqV2zR0gAt4486Qd0+ZKTtGC+7TEtI4APUPn2jB3lLbTrA7WSNmPLQxX+9i /fwMiZj37B2w== WDCIronportException: Internal Received: from iouring.labspan.wdc.com (HELO iouring.sc.wdc.com) ([10.6.138.107]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Jun 2020 16:44:52 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org, dm-devel@redhat.com Date: Mon, 29 Jun 2020 16:43:13 -0700 Message-Id: <20200629234314.10509-11-chaitanya.kulkarni@wdc.com> In-Reply-To: <20200629234314.10509-1-chaitanya.kulkarni@wdc.com> References: <20200629234314.10509-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Tue, 30 Jun 2020 10:48:45 -0400 Cc: axboe@kernel.dk, paolo.valente@linaro.org, sagi@grimberg.me, snitzer@redhat.com, Chaitanya Kulkarni , fangguoju@gmail.com, rdunlap@infradead.org, rostedt@goodmis.org, ming.lei@redhat.com, mingo@redhat.com, colyli@suse.de, jack@suse.czi, hch@lst.de, agk@redhat.com, bvanassche@acm.org Subject: [dm-devel] [PATCH 10/11] block: use block_bio class for getrq and sleeprq X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com The only difference in block_get_rq and block_bio was the last param passed __entry->nr_sector & bio->bi_iter.bi_size respectively. Since that is not the case anymore replace block_get_rq class with block_bio for block_getrq and block_sleeprq events, also adjust the code to handle null bio case in block_bio. Signed-off-by: Chaitanya Kulkarni --- include/trace/events/block.h | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/include/trace/events/block.h b/include/trace/events/block.h index d191d2cd1070..21f1daaf012b 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h @@ -272,11 +272,19 @@ DECLARE_EVENT_CLASS(block_bio, ), TP_fast_assign( - __entry->dev = bio_dev(bio); - __entry->sector = bio->bi_iter.bi_sector; - __entry->nr_sector = bio_sectors(bio); - blk_fill_rwbs(__entry->rwbs, bio->bi_opf); - memcpy(__entry->comm, current->comm, TASK_COMM_LEN); + if (bio) { + __entry->dev = bio_dev(bio); + __entry->sector = bio->bi_iter.bi_sector; + __entry->nr_sector = bio_sectors(bio); + blk_fill_rwbs(__entry->rwbs, bio->bi_opf); + memcpy(__entry->comm, current->comm, TASK_COMM_LEN); + } else { + __entry->dev = 0; + __entry->sector = 0; + __entry->nr_sector = 0; + blk_fill_rwbs(__entry->rwbs, 0); + memcpy(__entry->comm, current->comm, TASK_COMM_LEN); + } ), TP_printk("%d,%d %s %llu + %u [%s]", @@ -380,7 +388,7 @@ DECLARE_EVENT_CLASS(block_get_rq, * A request struct for queue has been allocated to handle the * block IO operation @bio. */ -DEFINE_EVENT(block_get_rq, block_getrq, +DEFINE_EVENT(block_bio, block_getrq, TP_PROTO(struct bio *bio), @@ -396,7 +404,7 @@ DEFINE_EVENT(block_get_rq, block_getrq, * available. This tracepoint event is generated each time the * process goes to sleep waiting for request struct become available. */ -DEFINE_EVENT(block_get_rq, block_sleeprq, +DEFINE_EVENT(block_bio, block_sleeprq, TP_PROTO(struct bio *bio), From patchwork Mon Jun 29 23:43:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11634223 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 96CAE174A for ; Tue, 30 Jun 2020 14:49:18 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4C19920663 for ; Tue, 30 Jun 2020 14:49:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4C19920663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-198-blgkOw4KPOmbE0aKqzpBpA-1; Tue, 30 Jun 2020 10:49:14 -0400 X-MC-Unique: blgkOw4KPOmbE0aKqzpBpA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 81227107B276; Tue, 30 Jun 2020 14:49:02 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 67EF25C1B0; Tue, 30 Jun 2020 14:49:02 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 454ED6C9CD; Tue, 30 Jun 2020 14:49:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05TNj7O9020516 for ; Mon, 29 Jun 2020 19:45:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 09BB52156A4F; Mon, 29 Jun 2020 23:45:07 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 057A82156A4E for ; Mon, 29 Jun 2020 23:45:07 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DE389800260 for ; Mon, 29 Jun 2020 23:45:06 +0000 (UTC) Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-409-_PiV6O-HO0WQGdorwWM44g-1; Mon, 29 Jun 2020 19:45:02 -0400 X-MC-Unique: _PiV6O-HO0WQGdorwWM44g-1 IronPort-SDR: RDbrNq5en+/Emd78Yq+QKouObsy8BWeVaMVlxV7sZnPceZD9WWh2OR/SWt/tByHAFHM38QDub0 Uh5fRIsPy0XFl0hmdiLlkfkdCBw/8WbGwl0G392GydJGBYGHtrv6rTQjv9VNq5dFrHrerLC7XH Gu4PXtsN8/FHvbVzunyVch4VxrsX5KhYVsVcSsmFzCUwIyM7sGPGWgSyvzeXX782atMWCqXC3g FKM0ffoKQYQM1FGLxeFWqH2DGziM7BKSdo8KDg+s96yUlqCPCN701nB6uxGmPJlztjy5+djNmw doo= X-IronPort-AV: E=Sophos;i="5.75,296,1589212800"; d="scan'208";a="250451525" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 Jun 2020 07:45:00 +0800 IronPort-SDR: vfrhNK5/BW9+Li0qalWwyoKTIAbV+ZvsF6GSbn8+1xebIf0t1b+jDG01pcbWVQpF+A4emV7M6n PrKPrxSpgs0wExcNSa+8rZ2XIMhFCUUI4= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jun 2020 16:33:20 -0700 IronPort-SDR: 6lJvjQXfWa7Clf3GSzVOBFEGRf7qj96erZRiTrcownPOnxcf3VeOT+CS0b4eeudQVMs5ebyHky 3Yp09SaAptIg== WDCIronportException: Internal Received: from iouring.labspan.wdc.com (HELO iouring.sc.wdc.com) ([10.6.138.107]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Jun 2020 16:44:59 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org, dm-devel@redhat.com Date: Mon, 29 Jun 2020 16:43:14 -0700 Message-Id: <20200629234314.10509-12-chaitanya.kulkarni@wdc.com> In-Reply-To: <20200629234314.10509-1-chaitanya.kulkarni@wdc.com> References: <20200629234314.10509-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Tue, 30 Jun 2020 10:48:45 -0400 Cc: axboe@kernel.dk, paolo.valente@linaro.org, sagi@grimberg.me, snitzer@redhat.com, Chaitanya Kulkarni , fangguoju@gmail.com, rdunlap@infradead.org, rostedt@goodmis.org, ming.lei@redhat.com, mingo@redhat.com, colyli@suse.de, jack@suse.czi, hch@lst.de, agk@redhat.com, bvanassche@acm.org Subject: [dm-devel] [PATCH 11/11] block: remove block_get_rq event class X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Now that there are no users for the block_get_rq event class remove the event class. Signed-off-by: Chaitanya Kulkarni --- include/trace/events/block.h | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/include/trace/events/block.h b/include/trace/events/block.h index 21f1daaf012b..dc1834250baa 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h @@ -353,34 +353,6 @@ DEFINE_EVENT(block_bio, block_bio_queue, TP_ARGS(bio) ); -DECLARE_EVENT_CLASS(block_get_rq, - - TP_PROTO(struct bio *bio), - - TP_ARGS(bio), - - TP_STRUCT__entry( - __field( dev_t, dev ) - __field( sector_t, sector ) - __field( unsigned int, nr_sector ) - __array( char, rwbs, RWBS_LEN ) - __array( char, comm, TASK_COMM_LEN ) - ), - - TP_fast_assign( - __entry->dev = bio ? bio_dev(bio) : 0; - __entry->sector = bio ? bio->bi_iter.bi_sector : 0; - __entry->nr_sector = bio ? bio_sectors(bio) : 0; - blk_fill_rwbs(__entry->rwbs, bio ? bio->bi_opf : 0); - memcpy(__entry->comm, current->comm, TASK_COMM_LEN); - ), - - TP_printk("%d,%d %s %llu + %u [%s]", - MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, - (unsigned long long)__entry->sector, - __entry->nr_sector, __entry->comm) -); - /** * block_getrq - get a free request entry in queue for block IO operations * @bio: pending block IO operation (can be %NULL)