From patchwork Wed Jan 25 16:06:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 9537371 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 0A81F6042C for ; Wed, 25 Jan 2017 16:07:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF7DF27D5E for ; Wed, 25 Jan 2017 16:07:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E3DFB28047; Wed, 25 Jan 2017 16:07:30 +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 6963027E22 for ; Wed, 25 Jan 2017 16:07:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751467AbdAYQH3 (ORCPT ); Wed, 25 Jan 2017 11:07:29 -0500 Received: from mail-pg0-f43.google.com ([74.125.83.43]:36119 "EHLO mail-pg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751375AbdAYQH1 (ORCPT ); Wed, 25 Jan 2017 11:07:27 -0500 Received: by mail-pg0-f43.google.com with SMTP id 3so6991250pgj.3 for ; Wed, 25 Jan 2017 08:07:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=In/ExvsJ98bPOz9pKPNUr/gPwQ9ZjCEPY1eVL1+74pw=; b=U32i6HpNMMXEmHrGmxNB7h4JZDuENqjtovbBaVx0EJ8s+APrrNzzoVBPsX+EkyptWo utZnrK05qBp+Uv0sBGLo39+oN0ForPMhOdVkRwY4O0NaDpwkNKUra771hpaojKIXz3wH EQ3ah8JzyFIusrfPgo6SBEcNfv0DXEEzw987VbysgMoGt3IhzFByMIhCrnxF1sT9t3nB XV4zAHLiDJlf/2a4oujKfcByD4GU+msq993g8S8oInVM6yqFcaXD6j033pl3tpjGLZeo t9D+P/A+eGo9i3yYnwnWxxzQpDZHoP1r90Oe+jEIMrMdZxxkcmZlEbk78Vu+GOcoh6tS +sAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=In/ExvsJ98bPOz9pKPNUr/gPwQ9ZjCEPY1eVL1+74pw=; b=oT3KcYmg9b/525KMp52qu8Htl5Xl9ccgsEN4nU4g833/r/HGCHe3pgUIfR26mw8Vof 16nBWzNHTskWuD9u/b/1GoyUDNZkrX+LKrZYTBPYjzQck/oP+EqG4b/YYfqWWib/XbRp giG17KzObYAG0/d9hlZv9Ml9y0k/RjtSYYUbZ3jileMw8qZym2KCT8KnoVExC3jIA5H7 3zUSnBHfHQKQDgrLChMq8s1pYrC2RVUydzdZklJ7HOGX9OnczpBeorkLuOQrbgzjYp+3 n/sGwhriN6Rv/MxguYX8SZjBjNL+aye6e6ssGI64eK0K2kYpAUycmufU9M+49U8NXeuw vHGA== X-Gm-Message-State: AIkVDXK0TWGEcrlb/sduaMzO80P1U/P6Av5tLFsMDcoHkatgYclxCIR4nK7JA/XrBLX5PnGQ X-Received: by 10.98.42.151 with SMTP id q145mr26746656pfq.175.1485360446520; Wed, 25 Jan 2017 08:07:26 -0800 (PST) Received: from localhost.localdomain ([2601:602:8801:8110:e6a7:a0ff:fe0b:c9a8]) by smtp.gmail.com with ESMTPSA id d68sm2270588pfj.92.2017.01.25.08.07.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jan 2017 08:07:25 -0800 (PST) From: Omar Sandoval To: Jens Axboe , linux-block@vger.kernel.org Cc: kernel-team@fb.com Subject: [PATCH v2 06/10] blk-mq: export software queue pending map to debugfs Date: Wed, 25 Jan 2017 08:06:45 -0800 Message-Id: <7d7f0b56d453193f821f7f22fca3e2d4174017ae.1485360145.git.osandov@fb.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: 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 From: Omar Sandoval This is useful for debugging problems where we've gotten stuck with requests in the software queues. Reviewed-by: Hannes Reinecke Signed-off-by: Omar Sandoval --- block/blk-mq-debugfs.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index ee947f2f605b..857bdadc6b1f 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -134,6 +134,26 @@ static const struct file_operations hctx_dispatch_fops = { .release = seq_release, }; +static int hctx_ctx_map_show(struct seq_file *m, void *v) +{ + struct blk_mq_hw_ctx *hctx = m->private; + + sbitmap_bitmap_show(&hctx->ctx_map, m); + return 0; +} + +static int hctx_ctx_map_open(struct inode *inode, struct file *file) +{ + return single_open(file, hctx_ctx_map_show, inode->i_private); +} + +static const struct file_operations hctx_ctx_map_fops = { + .open = hctx_ctx_map_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + static void *ctx_rq_list_start(struct seq_file *m, loff_t *pos) { struct blk_mq_ctx *ctx = m->private; @@ -179,6 +199,7 @@ static const struct blk_mq_debugfs_attr blk_mq_debugfs_hctx_attrs[] = { {"state", 0400, &hctx_state_fops}, {"flags", 0400, &hctx_flags_fops}, {"dispatch", 0400, &hctx_dispatch_fops}, + {"ctx_map", 0400, &hctx_ctx_map_fops}, }; static const struct blk_mq_debugfs_attr blk_mq_debugfs_ctx_attrs[] = {