From patchwork Wed Feb 7 01:15:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10204383 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2FDA16037E for ; Wed, 7 Feb 2018 01:15:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 206B628D8B for ; Wed, 7 Feb 2018 01:15:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1443F28D98; Wed, 7 Feb 2018 01:15:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7FFF628D8B for ; Wed, 7 Feb 2018 01:15:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932218AbeBGBPv (ORCPT ); Tue, 6 Feb 2018 20:15:51 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:10240 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932154AbeBGBPv (ORCPT ); Tue, 6 Feb 2018 20:15:51 -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=1517966151; x=1549502151; h=from:to:cc:subject:date:message-id; bh=MX3LgoAUe47yUy5URnNhC+OWjFJuuVxmeaMvTdhDwvQ=; b=UMCnLCeBIigSd9vM1IriOZoNlO5f2kMTiHVf3tAn0mKSOsrss+yarbgO MzU8RBcx5FUJMM51cLyOn4u3kEpvJeAGieNU+5+87AKpB+D6vERMbz46e 5C/n+683sz4l8G2+wnskp0Ng+Oa6a1FTETP8cAJmIgkX5aK/styPiDljW PvVbyJW0UO2kJfxCB2s7s2GH3zZssXr0qKz7XMnL6EA3ptUdMKM3BcP0R rG1I8rC20wThIHl+dFrNK2F9Hfnp+LK7Ko5Hjg2/NzfE38a/QauF1x+YW HMTV4jhHmIo3KyrnfLzNyKzX2yVTDpLiYWm2k0osfK1lIHbCqqhuNd4e0 w==; X-IronPort-AV: E=Sophos;i="5.46,471,1511798400"; d="scan'208";a="173720553" 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; 07 Feb 2018 09:15:51 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 06 Feb 2018 17:10:12 -0800 Received: from thinkpad-bart.sdcorp.global.sandisk.com (HELO thinkpad-bart.int.fusionio.com) ([10.11.171.236]) by uls-op-cesaip02.wdc.com with ESMTP; 06 Feb 2018 17:15:50 -0800 From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Bart Van Assche , Tejun Heo Subject: [PATCH] blk-mq-debugfs: Show more request state information Date: Tue, 6 Feb 2018 17:15:50 -0800 Message-Id: <20180207011550.26510-1-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.16.1 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since commit 634f9e4631a8 ("blk-mq: remove REQ_ATOM_COMPLETE usages from blk-mq") blk_rq_is_complete() only reports whether or not a request has completed for legacy queues. Hence modify the blk-mq-debugfs code such that it shows the blk-mq request state again. Fixes: 634f9e4631a8 ("blk-mq: remove REQ_ATOM_COMPLETE usages from blk-mq") Signed-off-by: Bart Van Assche Cc: Tejun Heo --- block/blk-mq-debugfs.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index 43084d64aa41..c62a3704515b 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -294,6 +294,13 @@ static const char *const rqf_name[] = { }; #undef RQF_NAME +static const char *blk_mq_rq_state_name[4] = { + [MQ_RQ_IDLE] = "idle", + [MQ_RQ_IN_FLIGHT] = "in_flight", + [MQ_RQ_COMPLETE] = "complete", + [3] = "(?)", +}; + int __blk_mq_debugfs_rq_show(struct seq_file *m, struct request *rq) { const struct blk_mq_ops *const mq_ops = rq->q->mq_ops; @@ -310,7 +317,7 @@ int __blk_mq_debugfs_rq_show(struct seq_file *m, struct request *rq) seq_puts(m, ", .rq_flags="); blk_flags_show(m, (__force unsigned int)rq->rq_flags, rqf_name, ARRAY_SIZE(rqf_name)); - seq_printf(m, ", complete=%d", blk_rq_is_complete(rq)); + seq_printf(m, ", .state=%s", blk_mq_rq_state_name[blk_mq_rq_state(rq)]); seq_printf(m, ", .tag=%d, .internal_tag=%d", rq->tag, rq->internal_tag); if (mq_ops->show_rq)