From patchwork Tue Feb 2 05:25:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12060647 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64C3AC433E0 for ; Tue, 2 Feb 2021 05:27:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 30E5664EDC for ; Tue, 2 Feb 2021 05:27:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231443AbhBBF1H (ORCPT ); Tue, 2 Feb 2021 00:27:07 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:41766 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230168AbhBBF1G (ORCPT ); Tue, 2 Feb 2021 00:27:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612244553; x=1643780553; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JGFz/l9SNyabiClwCUzw4MbPVEOCBtgfVIZqtJS4V7c=; b=NRvCB8cxRHEkHWMxSdggrPT1hU5YLfI6x2ziEWNcIJ8w3+TzFSuw3ZdT AyLjYSCA8CtvgSXgMi0DdLDty026ROFPvFZlGd1YId/B5AwSX82idLmXa lI1x4BTFAOdZtu/TxW+ZE/9PXo4y1cssZFN3ib6IYPQipqZUPCPTYYYA4 gCxj1bnTRz+81byOcjmJTBxJld/EAFrZeDOyDg6JiGdKgN0cL+TTyaqo1 KfFiIC8XCoPtzfvbWgallBMLVpRzYYii8F//3kuRvZ9WdcdX8rO2QNPz0 h+2z3vKRwg2ibxLE3hG4U6o0SF4d8o98pobxp/5nBkrO4Pb2KxeHVtSHd A==; IronPort-SDR: RqTRx4fNhnXj++3+kyoHKB1vB6/lRAfT05Yw3DfOTcqyc4ZJrMaZ7LQfYe2sa9Ra77XeXGiUA9 Sf15CLcegtKWhiezgOXm7z4MzZyjPC3LnvgEfdlNW7BYk1KKes3Xyd2itGn7gZiTVHs9MYILRU CD3hPOWy/IeHu6AfpcDlzOtkuaeBWGrPuR9Kd+VekZgAcrXABiC/7MEpqjxqsFsBctkFlVoaMk /jgRKz+uWQDrrYuhF7o8+ld6nfZ/6SLRmfhqSQMjQVSd2VyGnOclW/4j7o0gF6FSle0aHnqQrs J3Q= X-IronPort-AV: E=Sophos;i="5.79,394,1602518400"; d="scan'208";a="262961055" 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; 02 Feb 2021 13:40:53 +0800 IronPort-SDR: qNqveAhquyGHtCGwgUbL6a/5T6K164MmslKpCA0eyBC9DGzw2AAowo2r4zRF358FIE4a5IG6fG CEHBBi58YOeC5pd0l+iwqIwzDjzc/f0ePyU3N2xhoI8Z9KP2ZLEG0cGDWoADrHNAPwCPubCEVo ul8In8MQXtawa8rKy5858z5RToEHxOsIv5EheaztVJgvGepuEE8hK1zyUhtaALRcDdm0XgFXoZ hlABEDHb53Nnf/L6GxtGBGvoatqJAqqh2ucWtNekt4SF7OElh5AM9Th0N7VmOHPUghzuQ7Bqs+ jliVdlO7SHwR1x2LZ8pW5soj Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 21:08:08 -0800 IronPort-SDR: dn3vYelDjbf8zLNjYMaNnDX5g7cf/G6pO0vdeUhnLZWpCAXseBjQXhUi7a8wmU0vXKRk37CWEp x+BXbU2aNbWReBipV/ebXqZUynDiiNpUDo8CLRw8A7yOmuwl3DuiAO5aaDad85iu3F+qmMJimC yfhLqjXiN7rU4riovmrnYR/ao00ehwDlemsSM+Bt7ufnxJqoZFLaE3CjtBoKnsIP40DyMtqWlM B3At0OI+skKCaR2zI9OuvTlKdCtuxpRL+nP/KxUVHx5uzcBJZibR1vdNlo+qhvh/C6DW+G4itD 3JA= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 01 Feb 2021 21:25:59 -0800 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: paolo.valente@linaro.org, axboe@kernel.dk, rostedt@goodmis.org, mingo@redhat.com, chaitanya.kulkarni@wdc.com, johannes.thumshirn@wdc.com, damien.lemoal@wdc.com, bvanassche@acm.org, dongli.zhang@oracle.com, akpm@linux-foundation.org, aravind.ramesh@wdc.com, joshi.k@samsung.com, niklas.cassel@wdc.com, hare@suse.de, colyli@suse.de, tj@kernel.org, rdunlap@infradead.org, jack@suse.cz, hch@lst.de Subject: [PATCH 1/7] block: remove superfluous param in blk_fill_rwbs() Date: Mon, 1 Feb 2021 21:25:30 -0800 Message-Id: <20210202052544.4108-2-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210202052544.4108-1-chaitanya.kulkarni@wdc.com> References: <20210202052544.4108-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org 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. Remove the unused parameter and adjust the respective call sites. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Damien Le Moal Reviewed-by: Johannes Thumshirn --- include/linux/blktrace_api.h | 2 +- include/trace/events/bcache.h | 10 +++++----- include/trace/events/block.h | 16 ++++++++-------- kernel/trace/blktrace.c | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index 05556573b896..11484f1d19a1 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h @@ -119,7 +119,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 e41c611d6d3b..899fdacf57b9 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 0d782663a005..879cba8bdfca 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'; ), @@ -133,7 +133,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'; ), @@ -166,7 +166,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); ), @@ -249,7 +249,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]", @@ -276,7 +276,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); ), @@ -433,7 +433,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); ), @@ -474,7 +474,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", @@ -518,7 +518,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 9e9ee4945043..8a2591c7aa41 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -1867,7 +1867,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 Tue Feb 2 05:25:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12060661 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E786BC433E0 for ; Tue, 2 Feb 2021 05:33:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ADDD764E94 for ; Tue, 2 Feb 2021 05:33:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230347AbhBBFd1 (ORCPT ); Tue, 2 Feb 2021 00:33:27 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:42122 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231648AbhBBFdQ (ORCPT ); Tue, 2 Feb 2021 00:33:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612245111; x=1643781111; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dic+HnxA2At3onZOZ03Gimr1Nue7Lho32Ioi8MGn8ZA=; b=eds1kKwtPiA586V0RYezYEva2Nw86eBnpQWNBrNH5DKtz9X1z/ctASht Ej+Zmk5hQHTUa/biPHFUCHSGpLh71x7h1CuiD22QqttXmXSkfHEN6s9ki MVyzEtdKlGvOdT62b4Y7wO6oFJMTE2Da7Qb3WGUWfOKRzSrd95xgMEbBH QfCk5iTT4lJkVqThrrSsZS+SKznecjBzztEzetQfJJxb83WIVU8GuWhIM c1t6NSXvMqjqeeduNMhUP4CNGtuzpuBRarJDzsZa01Nby1njHjkcIzZl8 pP5JXYOVqId77C5Dz1KtUQCFE6gFYCK+HwYZwFO0uuITPKl+uuN/bbbZr w==; IronPort-SDR: +R/YqXslUDNQfCdXa0TJP5Ufdf5EmTeydtKw0/g4JATdPE81AbVtk7CVXrd39ERbo5Vl+0FXT3 yDbO77tXmKAaJJDXcBLkJ5o1HtA7lUXbZWhqqSsduscxbHzNEtEoU6rbyUH7edulkTwRPH+HBz sC1zexPMIObTi9jdZ8cSwtxevcQ5Y6VsSh1roum61haZLkdP0LsFfulbNw8AJ4C+Re3l7tXDJZ eiTuIAONGX1bY8gH96emXwFqlHKyJlvwhe1RfTtk3h3T0NI7KSuIvjW9yLQuXIBSSaJeAuy88X Few= X-IronPort-AV: E=Sophos;i="5.79,394,1602518400"; d="scan'208";a="262961072" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 02 Feb 2021 13:41:07 +0800 IronPort-SDR: hcUkR5BRLx9IpLKhOu7eA0bJCZwE+5eYkeZDgCfIiPDcXyKerD0XIF3icqiC+n2e6y0r+hcNYj YxtFl+R5mpmFZ312sTSpmX/QEskO5NR4UUAxeUetfbawTxmmNnKvIE1jp/QyN7EBGUkO12gO7t IsEgsg3Ins5JRQPguC6nR0ScSmOsxZv9ybhxHSxAKNUSVZXD5AvmiShPulweEooNQAWqYiRhTB SKyk4E8JJlJg1UYNTcA3aWYzrV3fMr1YzApLfhMOdGFg7QoidAYeEnktNmCSgZccP9zAV/pBeB EQVfxD6pipgJ2QklOPtGnSm9 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 21:10:17 -0800 IronPort-SDR: Ike+Y8s0my+1O7dm1Z5gM3faq1CcqIKSvVjQWGpHzYcZJjh3beQMFPU6vr/i5+tghTL6yNpiEw WERdRewCtHFT0XEelqXgVcFg/d/7gf/GWYi8USa2QNVxUx5o7BMLoLeCq677gi/gggAjDms8Km l72Ldt5FJHzlwO4yZKszE35B/qi+BV7LvnwPK5sIHNFg7m2HDDw53pjJG+EOGXICOm9JnF63qN oLHE84mErGsZUlv+nVKERA34HpSy2xDsAuuUJ6dlj8+plQqs2HroOkrKPTkbcNKFRjhYo+8CSe 13o= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 01 Feb 2021 21:26:08 -0800 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: paolo.valente@linaro.org, axboe@kernel.dk, rostedt@goodmis.org, mingo@redhat.com, chaitanya.kulkarni@wdc.com, johannes.thumshirn@wdc.com, damien.lemoal@wdc.com, bvanassche@acm.org, dongli.zhang@oracle.com, akpm@linux-foundation.org, aravind.ramesh@wdc.com, joshi.k@samsung.com, niklas.cassel@wdc.com, hare@suse.de, colyli@suse.de, tj@kernel.org, rdunlap@infradead.org, jack@suse.cz, hch@lst.de Subject: [PATCH 2/7] blktrace: add blk_fill_rwbs documentation comment Date: Mon, 1 Feb 2021 21:25:31 -0800 Message-Id: <20210202052544.4108-3-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210202052544.4108-1-chaitanya.kulkarni@wdc.com> References: <20210202052544.4108-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org blk_fill_rwbs() is an expoted function, add kernel style documentation comment. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Damien Le Moal Reviewed-by: Johannes Thumshirn --- kernel/trace/blktrace.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 8a2591c7aa41..1a931afcf5c4 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -1867,6 +1867,16 @@ void blk_trace_remove_sysfs(struct device *dev) #ifdef CONFIG_EVENT_TRACING +/** + * blk_fill_rwbs - Fill the buffer rwbs by mapping op to character string. + * @rwbs buffer to be filled + * @op: REQ_OP_XXX for the tracepoint + * + * Description: + * Maps the REQ_OP_XXX to character and fills the buffer provided by the + * caller with resulting string. + * + **/ void blk_fill_rwbs(char *rwbs, unsigned int op) { int i = 0; From patchwork Tue Feb 2 05:25:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12060649 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D991C433DB for ; Tue, 2 Feb 2021 05:27:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3C61664EDA for ; Tue, 2 Feb 2021 05:27:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231420AbhBBF1b (ORCPT ); Tue, 2 Feb 2021 00:27:31 -0500 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:13882 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230168AbhBBF1X (ORCPT ); Tue, 2 Feb 2021 00:27:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612243643; x=1643779643; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/yKFFxZIFPH4ommScjtAVEoptJgXEFRq8F+7i4VsxOI=; b=f4orAnxnXRupSZoiHnStvKswjo3hrocwnagCcsMe/QU05vlQqarecwQF Ak/IxRdEK8RSehVy/w10a+BkYw2Fk3uRcKbUzuRY2ThWquaHirvc/e3GR NRS6d1hzlWNZ959mq5P6IdDiQMKK1Xh2DL4ogPh/dcNhRvBl5wVv0iYMA LRNtWGR79Q6WMa3Hv4BTON1IROx/F4kya0bWEnS6PRpu9qe8eG1dhX2S3 s1RQ/Te+z5LSPQR7QT2QDlQhFg9MIuzALG/y+dH3KuUxx0vBSA2Hw/nVs oUFKf4vAmdl62aQK8kgHOQQwZAUmqTqc7O0NRBX0baAIvyHVXXiHGxTrS A==; IronPort-SDR: bWPu0AOfeKVOK2wQH9I4ZNMiqL4tDnmhHmUvGWTZZjWk26dP1QipvDEoHM1NWvDM6b0p7SNckJ SXHMM10aZwHdoHgSLNDhaSh9pRyJtssRqZcGSrSt2wG384V3x84kYzCTQeo0dtZEQkqAndP7FU 9Q/wuID82SH/AP2zZI7SHqDATk2pxowu7Db/YPn6O2caiapYCBXnP0exWRyWyhUO5KcbIdHiOA iPBDtQMoJZRr9vBPEhBRoKuEUp4Wf8VgVQ2cGeCQVGJQQz1ndrR/p4yycgO+UhrylDNEMCAypZ O9g= X-IronPort-AV: E=Sophos;i="5.79,394,1602518400"; d="scan'208";a="158884299" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 02 Feb 2021 13:26:18 +0800 IronPort-SDR: YyntR9IJibbVgIV1mVlg8fMulMuhQWZBh3r+qig+mi3A0Zu6M5dGHH9oTpmPhqxDpFEo+C8s6i M/kp4C/8yPQwBf9yo2Uv4L6Yf5blGfi00iOp1Cafw9ufrHGGslGSngQmXFqi44hjpowafRlFmB ag4CLK10Rn22ydaWjZRlTGKhTz0TVqUZQXiBqv2JgYWgaWMN/iHCX78dx746WTrswZ6W8glhTd HuZ5BA8qZjPAwdeOnPM1T3zm7sXZov+WYg81ULwWM/8XB+dpiM31npQUYDnDTY4yomnzETQEDI hfM/Gouia13f5WxsYs9mtJhE Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 21:10:27 -0800 IronPort-SDR: HQIKAYe7ZMeNrvb22D7JqTzM+Npk6/Lbj/bJ0dgIyjqN+/cHiHPS/E6/zxxJFthnRH+KGWaBST a1nMVwd4RSux8gGCtlKP5JULEUj/Ch8RtPsvEncUuZLlUMJCNo/Ejn0D90SEoAHWmR9gnymYmc fKKd3xuNcAKUK5rX+/rmM5CsOe5vOdy8GTJNBPDRMs2X4TsfReYN2I/PO8eowyepcPR+Mr8rga HJsH7uI24JoLKV5sl3KZn90mHGiRwSbH56Zv1IcLeIAwfHDqWC25wOhpboGzXyU+aMHcys8R1z Ucg= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 01 Feb 2021 21:26:18 -0800 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: paolo.valente@linaro.org, axboe@kernel.dk, rostedt@goodmis.org, mingo@redhat.com, chaitanya.kulkarni@wdc.com, johannes.thumshirn@wdc.com, damien.lemoal@wdc.com, bvanassche@acm.org, dongli.zhang@oracle.com, akpm@linux-foundation.org, aravind.ramesh@wdc.com, joshi.k@samsung.com, niklas.cassel@wdc.com, hare@suse.de, colyli@suse.de, tj@kernel.org, rdunlap@infradead.org, jack@suse.cz, hch@lst.de Subject: [PATCH 3/7] blktrace: fix blk_rq_issue documentation Date: Mon, 1 Feb 2021 21:25:32 -0800 Message-Id: <20210202052544.4108-4-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210202052544.4108-1-chaitanya.kulkarni@wdc.com> References: <20210202052544.4108-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org The commit 881245dcff29 ("Add DocBook documentation for the block tracepoints.") added the comment for blk_rq_issue() tracepoint. Remove the duplicate word from the tracepoint documentation. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Damien Le Moal Reviewed-by: Johannes Thumshirn X-Patchwork-Id: 12060655 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76CFAC433DB for ; Tue, 2 Feb 2021 05:32:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3571864ED9 for ; Tue, 2 Feb 2021 05:32:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231509AbhBBF1e (ORCPT ); Tue, 2 Feb 2021 00:27:34 -0500 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:41972 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230347AbhBBF1d (ORCPT ); Tue, 2 Feb 2021 00:27:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612243652; x=1643779652; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=d0/IH7i+oVuHvN9VVrN5674v1nvrYU6Nas++JivtJic=; b=O76Dg56y/cIU9icbaAnhelPM5E1Ha6guWPg2Q7mIghZGAdm/Br8elFyx /QJO1MXaRE2f4kRoRVYywa6qO28CyaHQrU1e4lKEw4g7CebpaMSB8soQU YhS58n4tNcmMqXYEibI7Xmeb2qQthjRVU1M/vPyMnswPXA6JZfnsaPYpo uk5bKnYtc2VrCDnPxQV9PQ3sCKXwGLyK2EPKcV0amOVZy0pU6ap1+k3av AhUcQvmigZ7l5SFvmXRGDQ3WI4InyN6Q75Wlnmq0cmVa1AkqFOFpww4Tx 5G6KH6vBbmjkxEpwB1s3LNc3sExxSOF2FaKbew3PV28mdZDT/5tYVcBSb Q==; IronPort-SDR: a291amdiaVzdOvHv6OWWj5Qx+/f8VDLXjyymjDtpx8VBTWMvj6RQrlkR/Yyt5U3FsmZAAQQ/bh DHlMcnufIoU0pG0xraULO/NXA6RoFqCfHSLXHDVYks+YUM0CG5XRqtpCO1rWUDVmotT1tao3uB lv+KrkWC1nKGaQTw+UYOSx6z02psnJCcHLgdTOpQXUoJ0/EvovyNI5090YQFBe1O1gLTHTWQX4 uTZRhIbc4HIIalCm0FkjOixP1fnvPQV1nodtjfDcyfH/0SvBwTA74HJtLko/ah5bCRsvY9APs0 2CA= X-IronPort-AV: E=Sophos;i="5.79,394,1602518400"; d="scan'208";a="158885018" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 02 Feb 2021 13:26:27 +0800 IronPort-SDR: +m+bZKbAQLSXLcbjmDXizpS2lqtITOBoizaQkRyosKJWD1fihuPGcKDnqcF5afHe6wu+aOR7xI QPSerl/FM0ZIUQMHDCpMVG5Or8naXzWrZiEFvNVgEXvAY5LMOUmBBI1pupZZIMIRe82A5vdYA7 KO0/dgDVLWFB9ERtKehn9kMJfsyqNsIoP+ydDf9Wun4LEOiGW7qMWlRoU0t4US8f1mLndwXe3N DHYKyLhXrfHev0VokbMsx6lGlVdrWoeshcXF61Nbwe07aKufZC81PUFlHkQuH4LjbxagEj/5TH hzdsp8Zrs7NguqsgnGfz8pvx Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 21:08:36 -0800 IronPort-SDR: NQNQgZQJDOrFIQ6Rfm/gl2rVyUkLtKWboGqCVWLyw7mtNwrJznJw9ERbVj829ykdRaxMjlfskA Drpp5eKUeH0Z4dFzFKLgiaV2UbpdSpV1rexMGQg85u2Np7/IvCj+TrVSKYxcMJ1T0LICPaRVWM AqrV6Yx9yYMMUm+SI78b+So3BEaUhzEsI2c3EYxn2x0V7UfG+2q1zx4Yc73v7o3fQKB7W8mF5f Yb+PVaQAfaZaDaNIYcoMMM9ExugSj07ZsqbM5sjiRoLZX2fTRcDvhva9LOyw9bTp6Y7PbVkMOa 1t4= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 01 Feb 2021 21:26:27 -0800 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: paolo.valente@linaro.org, axboe@kernel.dk, rostedt@goodmis.org, mingo@redhat.com, chaitanya.kulkarni@wdc.com, johannes.thumshirn@wdc.com, damien.lemoal@wdc.com, bvanassche@acm.org, dongli.zhang@oracle.com, akpm@linux-foundation.org, aravind.ramesh@wdc.com, joshi.k@samsung.com, niklas.cassel@wdc.com, hare@suse.de, colyli@suse.de, tj@kernel.org, rdunlap@infradead.org, jack@suse.cz, hch@lst.de Subject: [PATCH 4/7] blktrace: fix blk_rq_merge documentation Date: Mon, 1 Feb 2021 21:25:33 -0800 Message-Id: <20210202052544.4108-5-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210202052544.4108-1-chaitanya.kulkarni@wdc.com> References: <20210202052544.4108-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org The commit f3bdc62fd82e ("blktrace: Provide event for request merging") added the comment for blk_rq_merge() tracepoint. Remove the duplicate word from the tracepoint documentation. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Damien Le Moal Reviewed-by: Johannes Thumshirn --- include/trace/events/block.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/trace/events/block.h b/include/trace/events/block.h index 004cfe34ef37..cc5ab96a7471 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h @@ -210,7 +210,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 queue @q is merged to another * request queued in the elevator. From patchwork Tue Feb 2 05:25:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12060665 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54D12C43381 for ; Tue, 2 Feb 2021 05:33:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1C31B64EE4 for ; Tue, 2 Feb 2021 05:33:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231513AbhBBFdb (ORCPT ); Tue, 2 Feb 2021 00:33:31 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:3786 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231641AbhBBFdQ (ORCPT ); Tue, 2 Feb 2021 00:33:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612243995; x=1643779995; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Yfp9aj/5CTvO1j61/h0dSyXCmGTMl9jVFfTSlsUW1j4=; b=fWumtGQIP+mZzl8gkGdFRDgoTtioERjwnXjuXhWNvzgbZLDMrv1a0fYr LY0SsK03xktuOQXzhCtSBhH7NYXbPL3voIJ3ApkV9jTzYBoNTiezTqpZH 2S03pPd+abDzreKDGqAEOi3vO3NHrQq/A05Ufw39b9tgH/akeGzE1xLSi nJtj1/glpjsO0jWGTwfawq3Gpoq9symeP8N5JlMgQSrBYTeM0dYPWT7ql Hj5RxK7CEqAuulZ00QJ2GptVK/jD5XmuEjl3PKl5w9JI4VPsj8QS1sgd7 pJa8XWlKPaFi06O7v32/j/eVvKdZNaV+SGt3ickey5MF7lZhRbJiKYXxO Q==; IronPort-SDR: 1NxpUWKbSddQyHOC3R0sjAYJSb2uqlvXFoKsg+IcJIqgVKRh0NYKIV4etcH502QoNWaS9XGhB1 zBJyvc8rzwEZgBV5OG/7APVYBvWpcoIl3XbhzybvLFfw6vbx27yyVuG2H47M4kD4DRKtlLOBXJ +7utu/BVs5+xFDC9g71N/GNyQnC+GD9ZO2NoNyZu+Id1dVfoGRdH7nGUTJlh5foiiasMKS9Xn0 nVKyuvo99PIkYfGJgRDMP7648yTuBqGGsBaQAKgyhxPg5Xv4MkDT74oAAmM+Co5N4aOMkLu732 PUg= X-IronPort-AV: E=Sophos;i="5.79,394,1602518400"; d="scan'208";a="160066376" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 02 Feb 2021 13:26:36 +0800 IronPort-SDR: /d+0Z9/Gbq1sCc/ynMrBJr3Sk+Mf5GGL6HSpt/OjeW9M1Wsx9yuYKdHgyGcRhppORpdgb+Z3wa Z4RmZ4e/UaNa8NLmmlLjS0od1S03t5h1u/oSS6H/ZAWQaxNUFq2FiNskKImpaAnXWExDjdmQNf N6ih24CHMee3qwMu0pBknhNQjJGFt8t/7l8vDDL4q8b3lBx/2S3REJlvOpzmYHt6+bq2KIDHYt VXyFcNCkqmKDOZqzUVQmfd6aAQHwQW3ty2PDN/IqqwWuVbhDicKPnwi+Uk40MA2yZozQo7DKT2 pWYoYJ99O354ZYt4aUo3gMLI Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 21:10:45 -0800 IronPort-SDR: W91Ht6lWVMJYIOpMvPjqI5z4yl2vOcmfBWdskU+FV2+JqRX9RqZXUMgcBXqGtmqoGZNsoaEYA8 /b4WBzXC1aRD304BtFfh+xwFlGXpeWqBFXJ1XAeFCh3MtkmZrwLYLHcv65FFCRlsU3EIrSxdHq UNaBZIOBQqjdJfjVkQwUp8VSsZVEA9EAKIy3Qt5wP1DQ7vjftqEM3ZKI3xX+oJn8pg5vIhE5DK Lj/klGpwqtnHcmFXJLBBOX2MinRC16BAMq/xW00zw7bBB6sPMBnO1Ca4AkpauELuZKoqOpbPJ1 14M= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 01 Feb 2021 21:26:35 -0800 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: paolo.valente@linaro.org, axboe@kernel.dk, rostedt@goodmis.org, mingo@redhat.com, chaitanya.kulkarni@wdc.com, johannes.thumshirn@wdc.com, damien.lemoal@wdc.com, bvanassche@acm.org, dongli.zhang@oracle.com, akpm@linux-foundation.org, aravind.ramesh@wdc.com, joshi.k@samsung.com, niklas.cassel@wdc.com, hare@suse.de, colyli@suse.de, tj@kernel.org, rdunlap@infradead.org, jack@suse.cz, hch@lst.de Subject: [PATCH 5/7] block: get rid of the trace rq insert wrapper Date: Mon, 1 Feb 2021 21:25:34 -0800 Message-Id: <20210202052544.4108-6-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210202052544.4108-1-chaitanya.kulkarni@wdc.com> References: <20210202052544.4108-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Get rid of the wrapper for trace_block_rq_insert() and call the function directly. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Damien Le Moal Reviewed-by: Johannes Thumshirn --- 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 +++- kernel/trace/blktrace.c | 1 + 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index dfa87e360d71..da5e1f620625 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" @@ -5621,7 +5623,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 deff4e826e23..ddb65e9e6fd9 100644 --- a/block/blk-mq-sched.c +++ b/block/blk-mq-sched.c @@ -384,12 +384,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 0476360f05f1..5b18ab915c65 100644 --- a/block/blk-mq-sched.h +++ b/block/blk-mq-sched.h @@ -7,7 +7,6 @@ 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 c25c41d0d061..f13da10953bf 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) diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 1a931afcf5c4..259635217a53 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -852,6 +852,7 @@ 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)); } +EXPORT_TRACEPOINT_SYMBOL_GPL(block_rq_insert); static void blk_add_trace_rq_merge(void *ignore, struct request *rq) { From patchwork Tue Feb 2 05:25:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12060657 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FFA0C433E0 for ; Tue, 2 Feb 2021 05:32:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4F9FC64E94 for ; Tue, 2 Feb 2021 05:32:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231540AbhBBFci (ORCPT ); Tue, 2 Feb 2021 00:32:38 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:26499 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231546AbhBBFcf (ORCPT ); Tue, 2 Feb 2021 00:32:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612243955; x=1643779955; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LyeFeoshqjgI2rNYAGq0Im5Ns+zauYn+vP0jM5YnlNY=; b=SMyvCvFE7Ty/dCdsNCdlGcW+Y6njUx1j4ub7XKGsM1fuLCy64TTKfLFM HhzjOsQWVaEZGXCnL9hXQhk75hO/6az/20SjAi04zP5uC/KfWsWLP4n+I 5A9XJQQ5r/A7i0PRhAKkrcnVnnkElJyiCa8Ic7+qTrVm96saxgQ1I75ZN nE5gvPEaRdwzM9pdRXehUJoTb0MWGiXAR99I9oafYCzPK4/52dqMFJS9a NJJ22GvRF7wTbBdtfgDkC/8CoOiGLvI+UQ/c9C2HsrMESSlc11F4U+T6i w2eW4iUXfqkcTuNs7b4gbv4fkufwGuXgKlQrFYoiSDDsuQnZfLNIS9d7F A==; IronPort-SDR: nY8rvhWT0oGzlerd0zPIf4fnfuVEyOwByMCHnNMvtRJxz59NB2thAX18kbTBGMBnTqQ+aUgQGt 5tzreLc6K/fnF3cVeml0grc8RBYAR/Tgmh/tkhykrTwvG6dFgl635oJeobfYsdpSrO9UZ0fsBl Boluw43bl9Het8znkWYuM8colRqr8IT6wIQuu3hCAUrPyRWvk2+YKVWhseq0+cmO3oxqYbavXw MDi5Qqzw0SzvAc27nW5Z57uKBMs2iALjyUQexnL4JMLBmt/soNtL+/XY7a/PPtwQjFvTebfwVS v4s= X-IronPort-AV: E=Sophos;i="5.79,394,1602518400"; d="scan'208";a="160066381" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 02 Feb 2021 13:26:45 +0800 IronPort-SDR: ZKei8qLMMz1bjOZSyKMoluIfRiLyvhrw7oDlmfYr9OtvBkjCIYgrFk1dcNkQKzQO/xbAQXhupP 22Nz+P8n+68AO2pvXyKuc2ZkfMXxSMVTblLra4lnmeZXSk2oDMLZquUmgyb8sdo+fFy9wP/oWJ sEF2w7rkg2/u4J21w3aQFRw7PKIVq4yoT2/m7fHM/4kQF1bjoXQUFpKiEpCaz/MRYWnk8jL0qJ Q6B38PktqmdcUtwRnlDzL+EsgVCaYd00BvDupr+Rxxe09aqqHoSfd8hMH3CRx0wrGR2npzsga1 4IrTHrho8+3++kdYmMcq6koW Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 21:08:53 -0800 IronPort-SDR: 0UYPYdsDr63rqvEu2+LgsgDTpJCr8bvzuMHdsu/GvXD5vaSRzRSXzRhRlLCWYDv2NGGIIgA7Rb NtgdBtL3eEfhas4E98fF4WR+cJXhCYwmUbzIYhLYoSynO6gzEkD98PdvbLiJmGzPWYP5XlBzKC 9DFIqHaVCl0kymljw/5bYIkweveIa+EtEOFjC4vOK+THLt4HqTmBIk3duzhy/YoqT9Lj8AUEU1 QqrdGjByyb6Gkqq2D72xl4wgTxoNXpOPlyaFRm8w/bUDpOEBDsO3SyG9jaqjbg5Sqis84vL769 +u4= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 01 Feb 2021 21:26:44 -0800 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: paolo.valente@linaro.org, axboe@kernel.dk, rostedt@goodmis.org, mingo@redhat.com, chaitanya.kulkarni@wdc.com, johannes.thumshirn@wdc.com, damien.lemoal@wdc.com, bvanassche@acm.org, dongli.zhang@oracle.com, akpm@linux-foundation.org, aravind.ramesh@wdc.com, joshi.k@samsung.com, niklas.cassel@wdc.com, hare@suse.de, colyli@suse.de, tj@kernel.org, rdunlap@infradead.org, jack@suse.cz, hch@lst.de Subject: [PATCH 6/7] null_blk: allow disacrd on non-membacked mode Date: Mon, 1 Feb 2021 21:25:35 -0800 Message-Id: <20210202052544.4108-7-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210202052544.4108-1-chaitanya.kulkarni@wdc.com> References: <20210202052544.4108-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org null blk driver supports REQ_OP_DISACRD in membacked mode. When testing special requests having REQ_OP_DISCARD support is helpful to validate the special request path when mixed with read-write. Consider module parameter when setting the queue discard flag when device is not memory backed. This is needed to test the tracepoint related to REQ_OP_DISCARD. Signed-off-by: Chaitanya Kulkarni --- # modprobe -r null_blk # gitlog -7 4ac4d49e1028 (HEAD -> for-next) null_blk: add module param queue bounce limit 468e3617dae8 null_blk: allow disacrd on non-membacked mode bdc96efe9681 block: get rid of the trace rq insert wrapper 73bf523a7ce4 blktrace: fix blk_rq_merge documentation 6016632555da blktrace: fix blk_rq_issue documentation 58b5d7103a94 blktrace: add blk_fill_rwbs documentation comment 534f321f57dd block: remove superfluous param in blk_fill_rwbs() Test to exercise module parameter vs configfs discard param, set up nullb0 such a way that it errors out in both cases for module param discard :- for discard in 0 1 do modprobe -r null_blk i=0 echo "Module param discard ${discard}" modprobe null_blk nr_devices=0 discard=${discard} # Create dev 0 no discard NULLB_DIR=config/nullb/nullb${i} mkdir config/nullb/nullb${i} echo 1 > config/nullb/nullb${i}/memory_backed echo 512 > config/nullb/nullb${i}/blocksize echo 2048 > config/nullb/nullb${i}/size echo 1 > config/nullb/nullb${i}/power echo -n "$nullb${i} membacked : "; cat /sys/kernel/config/nullb/nullb${i}/memory_backed echo -n "$nullb${i} discard : "; cat /sys/kernel/config/nullb/nullb${i}/discard # Create dev 1 with discard i=1 NULLB_DIR=config/nullb/nullb${i} mkdir config/nullb/nullb${i} echo 1 > config/nullb/nullb${i}/memory_backed echo 512 > config/nullb/nullb${i}/blocksize echo 2048 > config/nullb/nullb${i}/size echo 1 > config/nullb/nullb${i}/discard echo 1 > config/nullb/nullb${i}/power echo -n "$nullb${i} membacked : "; cat /sys/kernel/config/nullb/nullb${i}/memory_backed echo -n "$nullb${i} discard : "; cat /sys/kernel/config/nullb/nullb${i}/discard # should fail blkdiscard -o 0 -l 1024 /dev/nullb0 # should pass blkdiscard -o 0 -l 1024 /dev/nullb1 echo 0 > config/nullb/nullb0/power echo 0 > config/nullb/nullb1/power rmdir config/nullb/nullb* modprobe -r null_blk modprobe null_blk # should fail blkdiscard -o 0 -l 1024 /dev/nullb0 modprobe -r null_blk modprobe null_blk discard=1 # should pass blkdiscard -o 0 -l 1024 /dev/nullb0 modprobe -r null_blk echo "--------------------------" done modprobe -r null_blk modprobe null_blk blkdiscard -o 0 -l 1024 /dev/nullb0 modprobe -r null_blk modprobe null_blk discard=1 blkdiscard -o 0 -l 1024 /dev/nullb0 modprobe -r null_blk # ./discard_module_param_test.sh Module param discard 0 0 membacked : 1 0 discard : 0 1 membacked : 1 1 discard : 1 blkdiscard: /dev/nullb0: BLKDISCARD ioctl failed: Operation not supported blkdiscard: /dev/nullb0: BLKDISCARD ioctl failed: Operation not supported -------------------------- Module param discard 1 0 membacked : 1 0 discard : 0 1 membacked : 1 1 discard : 1 blkdiscard: /dev/nullb0: BLKDISCARD ioctl failed: Operation not supported blkdiscard: /dev/nullb0: BLKDISCARD ioctl failed: Operation not supported -------------------------- blkdiscard: /dev/nullb0: BLKDISCARD ioctl failed: Operation not supported --- drivers/block/null_blk/main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c index d6c821d48090..6e6cbb953a12 100644 --- a/drivers/block/null_blk/main.c +++ b/drivers/block/null_blk/main.c @@ -172,6 +172,10 @@ static bool g_shared_tag_bitmap; module_param_named(shared_tag_bitmap, g_shared_tag_bitmap, bool, 0444); MODULE_PARM_DESC(shared_tag_bitmap, "Use shared tag bitmap for all submission queues for blk-mq"); +static bool g_discard; +module_param_named(discard, g_discard, bool, 0444); +MODULE_PARM_DESC(discard, "Enable queue discard (default: false)"); + static int g_irqmode = NULL_IRQ_SOFTIRQ; static int null_set_irqmode(const char *str, const struct kernel_param *kp) @@ -1588,14 +1592,11 @@ static void null_del_dev(struct nullb *nullb) static void null_config_discard(struct nullb *nullb) { - if (nullb->dev->discard == false) + if (nullb->dev->memory_backed && nullb->dev->discard == false) return; - if (!nullb->dev->memory_backed) { - nullb->dev->discard = false; - pr_info("discard option is ignored without memory backing\n"); + if (!nullb->dev->memory_backed && !g_discard) return; - } if (nullb->dev->zoned) { nullb->dev->discard = false; From patchwork Tue Feb 2 05:25:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12060671 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91654C4332B for ; Tue, 2 Feb 2021 05:33:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6163464EDA for ; Tue, 2 Feb 2021 05:33:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231545AbhBBFdi (ORCPT ); Tue, 2 Feb 2021 00:33:38 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:35937 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231658AbhBBFdQ (ORCPT ); Tue, 2 Feb 2021 00:33:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612245111; x=1643781111; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=534Tr8xkWdxVXk3uHPFEyMGR+GwOeZelBohwBeP7J9M=; b=reJs50xW3sQSAd0i+AG1HMvcs5RBj8paN/HGm+zP9wbrGlBHlpUhu8/o IrJRfI45Vou3QUsI+2Z2BGmGfuEg1BV6O0Xw6Z+nboYg/ze5ol0AmpkMg NwAP9nm0kwzakEa7mPq8fGh+xYAlE6RvfW0Alkd4SdVdd08TLxQykmXDh VkPj/UEKNbnoi9aS4kOsL2Ft+XpyQdnoYTnE2alz/Hovv2I70NtITMumN ZhJNHWCBj4+0o9iri2yIn5flu2dlEPzyk56PwEeL+EkdJaVHp+BOi3DLm fc8juBGL3QmXWl7hSBBNR2PloNuzVwF5mhhBvvwbHTXRULF8B0hgCyMXV Q==; IronPort-SDR: ThXKPgNDbnn1O06bIPaPD1WXyQ4Tc7HhJEbnW/6OBrIOG3jLJtvTJdkeXOvrY2BIfUdVM2y5h+ VQdss8+i6wwNDNc4i4r0wxueH3t9MNnX4iQ82SPOG2RQrVV7euVnk5KQ1B251ms/p2WWhJp79m m+HLD0JFMSo8GUYOLtYcLt2Ch1/QLWsgw/6JRnCCzpp1npE5CHe0gCpYKa5a2mfReRdSfnpbDD 8ii6k5OQ2ccrTkMdiQRK0UOuP235m1NqXrfL2caeTQTmZX/7v4DdBMYrvRQafLhwzkNWOsYNYl Njs= X-IronPort-AV: E=Sophos;i="5.79,394,1602518400"; d="scan'208";a="262961121" 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; 02 Feb 2021 13:42:14 +0800 IronPort-SDR: Bp2r/mbHMHWYRrbUd/Jy6sc0bwVI0RpTfy4x6LO6/eQHlq+T3hvPdcX1m5dc9gNzbgQUlJbTBZ L6uJE6x1NxPn3AFvFb7GKNHpl08AHJ9sA4dTkgl/ZvUHxvS6zoo0KM+EftcN2YMURRBUMV/Twb DqV8FYVSLkqkK8X5VvYqp2yO3p7BBmnPRNOmhw5xfKLlVF/ZpJtYcyzsmEnpJfG9Rw3Y88wO5w eiuH7WpVmEtPIYlG39lt+Tv2E0fgE3iPRm2EvC2E8IOFniadjNPXdJz1pdYcV47f4HILdlTbVN Eg6q0yZkWoC6PIzYc1Z+ffVl Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 21:09:02 -0800 IronPort-SDR: Rm64QLFYwCQQ6Wos4vSN9JJU+lhBhRdNGTzJSjH+ZV+DaripW8WiiDRxDspvA/e04m0NN7I+cG qqYHWw6y02pPti6iV4np8ANamGIQLvhZJ+vOY4rBmDDu2q1EjWEGSBeGeTarsGblE8tm0J+C+o HtRvhkA2DIT3Q2EItJaRUM9BemB0ByIowkGBfeQoQb5gQQA2PmV3uiXDULVwdY3oubGjsHG1e5 zqe2MXAOLTRXsdX8UOBSC9fxtSSN2MsGuKgGCGmGPxCocQndF14zNteYaxCACVyVtGZ++snfQ9 96U= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 01 Feb 2021 21:26:53 -0800 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: paolo.valente@linaro.org, axboe@kernel.dk, rostedt@goodmis.org, mingo@redhat.com, chaitanya.kulkarni@wdc.com, johannes.thumshirn@wdc.com, damien.lemoal@wdc.com, bvanassche@acm.org, dongli.zhang@oracle.com, akpm@linux-foundation.org, aravind.ramesh@wdc.com, joshi.k@samsung.com, niklas.cassel@wdc.com, hare@suse.de, colyli@suse.de, tj@kernel.org, rdunlap@infradead.org, jack@suse.cz, hch@lst.de Subject: [PATCH 7/7] null_blk: add module param queue bounce limit Date: Mon, 1 Feb 2021 21:25:36 -0800 Message-Id: <20210202052544.4108-8-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210202052544.4108-1-chaitanya.kulkarni@wdc.com> References: <20210202052544.4108-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org This patch adds a new module parameter to set the queue bounce limit. Various queue limits parameters are usually present in the sysfs. This is needed for testing purpose only so instead of poluting the sysfs space just update the null_blk drivers. This is needed especially for blktrace bounce related tracepoint testing. Signed-off-by: Chaitanya Kulkarni --- # modprobe null_blk bounce_pfn=0x1000 # for bs in 512 1024 2048 4096 8192 > do > dd if=/dev/zero of=/dev/nullb0 bs=${bs} count=1 oflag=direct > done # ~/blktrace/blktrace -a write -d /dev/nullb0 -o -| ~/blktrace/blkparse -i - # # # With null_blk bounce # modprobe null_blk bounce_pfn=0x1000 # 252,0 34 1 0.000000000 4390 Q WS 0 + 1 [dd] 252,0 34 2 0.000010139 4390 B WS 0 + 1 [dd] 252,0 34 3 0.000018996 4390 G WS 0 + 1 [dd] 252,0 34 4 0.000024576 4390 I WS 0 + 1 [dd] 252,0 34 5 0.000065152 829 D WS 0 + 1 [kworker/34:1H] 252,0 34 6 0.000092303 182 C WS 0 + 1 [0] 252,0 34 7 0.000098164 182 C WS 0 + 1 [0] 252,0 27 1 0.004573597 4391 Q WS 0 + 2 [dd] 252,0 27 2 0.004580891 4391 B WS 0 + 2 [dd] 252,0 27 3 0.004589687 4391 G WS 0 + 2 [dd] 252,0 27 4 0.004594356 4391 I WS 0 + 2 [dd] 252,0 27 5 0.004619473 1049 D WS 0 + 2 [kworker/27:1H] 252,0 27 6 0.004634411 147 C WS 0 + 2 [0] 252,0 27 7 0.004638609 147 C WS 0 + 2 [0] 252,0 29 1 0.014589610 4394 Q WS 0 + 8 [dd] 252,0 29 2 0.014595792 4394 B WS 0 + 8 [dd] 252,0 29 3 0.014599028 4394 G WS 0 + 8 [dd] 252,0 29 4 0.014601713 4394 I WS 0 + 8 [dd] 252,0 29 5 0.014621330 807 D WS 0 + 8 [kworker/29:1H] 252,0 29 6 0.014633813 157 C WS 0 + 8 [0] 252,0 29 7 0.014637660 157 C WS 0 + 8 [0] 252,0 30 1 0.009147174 4392 Q WS 0 + 4 [dd] 252,0 30 2 0.009154377 4392 B WS 0 + 4 [dd] 252,0 30 3 0.009163064 4392 G WS 0 + 4 [dd] 252,0 30 4 0.009167161 4392 I WS 0 + 4 [dd] 252,0 30 5 0.009191437 1084 D WS 0 + 4 [kworker/30:1H] 252,0 30 6 0.009206084 162 C WS 0 + 4 [0] 252,0 30 7 0.009210863 162 C WS 0 + 4 [0] 252,0 30 8 0.018510473 4395 Q WS 0 + 16 [dd] 252,0 30 9 0.018517767 4395 B WS 0 + 16 [dd] 252,0 30 10 0.018521213 4395 G WS 0 + 16 [dd] 252,0 30 11 0.018524229 4395 I WS 0 + 16 [dd] 252,0 30 12 0.018544026 1084 D WS 0 + 16 [kworker/30:1H] 252,0 30 13 0.018555127 162 C WS 0 + 16 [0] 252,0 30 14 0.018558333 162 C WS 0 + 16 [0] # # Without null_blk bounce 252,0 38 1 0.000000000 4744 Q WS 0 + 1 [dd] 252,0 38 2 0.000014768 4744 G WS 0 + 1 [dd] 252,0 38 3 0.000021771 4744 I WS 0 + 1 [dd] 252,0 38 4 0.000062557 914 D WS 0 + 1 [kworker/38:1H] 252,0 38 5 0.000089768 202 C WS 0 + 1 [0] 252,0 32 1 0.018453947 4749 Q WS 0 + 16 [dd] 252,0 32 2 0.018466080 4749 G WS 0 + 16 [dd] 252,0 32 3 0.018470619 4749 I WS 0 + 16 [dd] 252,0 32 4 0.018495195 514 D WS 0 + 16 [kworker/32:1H] 252,0 32 5 0.018509942 172 C WS 0 + 16 [0] 252,0 55 1 0.005000087 4745 Q WS 0 + 2 [dd] 252,0 55 2 0.005005637 4745 G WS 0 + 2 [dd] 252,0 55 3 0.005008453 4745 I WS 0 + 2 [dd] 252,0 55 4 0.005029352 1082 D WS 0 + 2 [kworker/55:1H] 252,0 55 5 0.005041915 287 C WS 0 + 2 [0] 252,0 31 1 0.014158231 4748 Q WS 0 + 8 [dd] 252,0 31 2 0.014164173 4748 G WS 0 + 8 [dd] 252,0 31 3 0.014167308 4748 I WS 0 + 8 [dd] 252,0 31 4 0.014188759 1151 D WS 0 + 8 [kworker/31:1H] 252,0 31 5 0.014203015 167 C WS 0 + 8 [0] 252,0 58 1 0.010016655 4747 D WS 0 + 4 [systemd-udevd] 252,0 60 1 0.009982571 4746 Q WS 0 + 4 [dd] 252,0 60 2 0.009993942 4746 G WS 0 + 4 [dd] 252,0 60 3 0.009998661 4746 I WS 0 + 4 [dd] 252,0 60 4 0.010136269 0 C WS 0 + 4 [0] --- drivers/block/null_blk/main.c | 20 +++++++++++++++++++- drivers/block/null_blk/null_blk.h | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c index 6e6cbb953a12..8ddf2ba961f7 100644 --- a/drivers/block/null_blk/main.c +++ b/drivers/block/null_blk/main.c @@ -156,6 +156,10 @@ static int g_max_sectors; module_param_named(max_sectors, g_max_sectors, int, 0444); MODULE_PARM_DESC(max_sectors, "Maximum size of a command (in 512B sectors)"); +static unsigned int g_bounce_pfn; +module_param_named(bounce_pfn, g_bounce_pfn, int, 0444); +MODULE_PARM_DESC(bounce_pfn, "Queue Bounce limit (default: 0)"); + static unsigned int nr_devices = 1; module_param(nr_devices, uint, 0444); MODULE_PARM_DESC(nr_devices, "Number of devices to register"); @@ -354,6 +358,7 @@ NULLB_DEVICE_ATTR(submit_queues, uint, nullb_apply_submit_queues); NULLB_DEVICE_ATTR(home_node, uint, NULL); NULLB_DEVICE_ATTR(queue_mode, uint, NULL); NULLB_DEVICE_ATTR(blocksize, uint, NULL); +NULLB_DEVICE_ATTR(bounce_pfn, uint, NULL); NULLB_DEVICE_ATTR(max_sectors, uint, NULL); NULLB_DEVICE_ATTR(irqmode, uint, NULL); NULLB_DEVICE_ATTR(hw_queue_depth, uint, NULL); @@ -472,6 +477,7 @@ static struct configfs_attribute *nullb_device_attrs[] = { &nullb_device_attr_home_node, &nullb_device_attr_queue_mode, &nullb_device_attr_blocksize, + &nullb_device_attr_bounce_pfn, &nullb_device_attr_max_sectors, &nullb_device_attr_irqmode, &nullb_device_attr_hw_queue_depth, @@ -543,7 +549,7 @@ nullb_group_drop_item(struct config_group *group, struct config_item *item) static ssize_t memb_group_features_show(struct config_item *item, char *page) { return snprintf(page, PAGE_SIZE, - "memory_backed,discard,bandwidth,cache,badblocks,zoned,zone_size,zone_capacity,zone_nr_conv,zone_max_open,zone_max_active,blocksize,max_sectors\n"); + "memory_backed,discard,bounce_pfn,bandwidth,cache,badblocks,zoned,zone_size,zone_capacity,zone_nr_conv\n"); } CONFIGFS_ATTR_RO(memb_group_, features); @@ -1610,6 +1616,17 @@ static void null_config_discard(struct nullb *nullb) blk_queue_flag_set(QUEUE_FLAG_DISCARD, nullb->q); } +static void null_config_bounce_pfn(struct nullb *nullb) +{ + if (nullb->dev->memory_backed && nullb->dev->bounce_pfn == false) + return; + + if (!nullb->dev->memory_backed && !g_bounce_pfn) + return; + + blk_queue_bounce_limit(nullb->q, nullb->dev->bounce_pfn); +} + static const struct block_device_operations null_bio_ops = { .owner = THIS_MODULE, .submit_bio = null_submit_bio, @@ -1882,6 +1899,7 @@ static int null_add_dev(struct nullb_device *dev) blk_queue_max_hw_sectors(nullb->q, dev->max_sectors); null_config_discard(nullb); + null_config_bounce_pfn(nullb); sprintf(nullb->disk_name, "nullb%d", nullb->index); diff --git a/drivers/block/null_blk/null_blk.h b/drivers/block/null_blk/null_blk.h index 83504f3cc9d6..cd55f99118bf 100644 --- a/drivers/block/null_blk/null_blk.h +++ b/drivers/block/null_blk/null_blk.h @@ -86,6 +86,7 @@ struct nullb_device { unsigned int queue_mode; /* block interface */ unsigned int blocksize; /* block size */ unsigned int max_sectors; /* Max sectors per command */ + unsigned int bounce_pfn; /* bounce page frame number */ unsigned int irqmode; /* IRQ completion handler */ unsigned int hw_queue_depth; /* queue depth */ unsigned int index; /* index of the disk, only valid with a disk */