From patchwork Thu Mar 8 23:27:28 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: 10269401 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 621816016D for ; Thu, 8 Mar 2018 23:28:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40EEC29BED for ; Thu, 8 Mar 2018 23:28:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F37029BDC; Thu, 8 Mar 2018 23:28:05 +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 46C9429CFD for ; Thu, 8 Mar 2018 23:27:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750836AbeCHX1a (ORCPT ); Thu, 8 Mar 2018 18:27:30 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:4806 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750824AbeCHX1a (ORCPT ); Thu, 8 Mar 2018 18:27:30 -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=1520551651; x=1552087651; h=from:to:cc:subject:date:message-id; bh=vb2t5K1UUcUysBopQVOs69pAqHieUjqQH/zylDhd4Vs=; b=HC6ChNOW+d/To2bRTvT5TKpc8qr2NAgxlMekp2KXyI3wJTaJQNbvEB7M 1FIarqlzSVudrXvaheAryGD5VPUQaMRb/MDss3tGyQO4j0iMbfHIUoADA 0X8lLyBZOknUlHDK3uaJPfusQAdLEBl8+gU5QqTI+RXg5+gYbkMVqvSPg HvBWajqfx5WQKlw0OSDkt1TiO3PQ4UvXdKeS97t6g4Wh02kF77SKlt/VJ L9B4K1u7Q7rZSzJWF0ygInE1A6LytDtQNWARqRPjWnUW8TdmWy+pkf0ed Avgqiob6xj9QuF2YZzuoTqu1R3Vb+CsALO3ph8Wi20NfCt1Kl7N5nVa+5 w==; X-IronPort-AV: E=Sophos;i="5.47,443,1515427200"; d="scan'208";a="73772847" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 09 Mar 2018 07:27:30 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 08 Mar 2018 15:21:18 -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; 08 Mar 2018 15:27:29 -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: Thu, 8 Mar 2018 15:27:28 -0800 Message-Id: <20180308232728.8810-1-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.16.2 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 bd21d5b9f65f..162e09c02ae7 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -350,6 +350,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; @@ -366,7 +373,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)