From patchwork Wed Mar 29 21:32:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9652633 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 F2314602BE for ; Wed, 29 Mar 2017 21:32:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E2F492845F for ; Wed, 29 Mar 2017 21:32:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D776B2856A; Wed, 29 Mar 2017 21:32:58 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI 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 1F1F02845F for ; Wed, 29 Mar 2017 21:32:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932659AbdC2Vc4 (ORCPT ); Wed, 29 Mar 2017 17:32:56 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:58787 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932651AbdC2Vcw (ORCPT ); Wed, 29 Mar 2017 17:32:52 -0400 X-IronPort-AV: E=Sophos;i="5.35,258,1483977600"; d="scan'208";a="109171457" Received: from mail-sn1nam01lp0119.outbound.protection.outlook.com (HELO NAM01-SN1-obe.outbound.protection.outlook.com) ([207.46.163.119]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2017 05:32:40 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Ku9cTwVkw9K0hxDVMHIfLE/VA7Oq5hYs0U3kfY7Hxxg=; b=LKnceWDZ/FreuaGQ+8QuDuEiCQO/oDM/40K8rrIMZ5HlsCxDT9KMqcPozMLJqJFgIciOrBCKtKPXb9HCsRjqi411qCLeBUUoIqZBDNdW9aonoB6l/7+YqaM5Y3Tn39DWUpbUB7N1gdmH7texoW4hb1MOjgq4ZbAJqYmWBvNKtOc= Received: from DM5PR04CA0030.namprd04.prod.outlook.com (10.171.152.144) by BN1PR04MB108.namprd04.prod.outlook.com (10.255.199.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.991.14; Wed, 29 Mar 2017 21:32:37 +0000 Received: from CO1NAM04FT032.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4d::203) by DM5PR04CA0030.outlook.office365.com (2603:10b6:3:12b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.10 via Frontend Transport; Wed, 29 Mar 2017 21:32:37 +0000 Authentication-Results: spf=pass (sender IP is 74.221.232.54) smtp.mailfrom=sandisk.com; suse.de; dkim=none (message not signed) header.d=none;suse.de; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 74.221.232.54 as permitted sender) receiver=protection.outlook.com; client-ip=74.221.232.54; helo=sacsmgep14.sandisk.com; Received: from sacsmgep14.sandisk.com (74.221.232.54) by CO1NAM04FT032.mail.protection.outlook.com (10.152.90.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1005.5 via Frontend Transport; Wed, 29 Mar 2017 21:32:36 +0000 X-AuditID: ac1c2133-9afff7000000c960-06-58dc27f29d79 Received: from SACHUBIP02.sdcorp.global.sandisk.com (Unknown_Domain [172.28.1.254]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 8D.49.51552.2F72CD85; Wed, 29 Mar 2017 14:32:36 -0700 (PDT) Received: from ULS-OP-MBXIP03.sdcorp.global.sandisk.com ([fe80::f9ec:1e1b:1439:62d8]) by SACHUBIP02.sdcorp.global.sandisk.com ([10.181.10.104]) with mapi id 14.03.0319.002; Wed, 29 Mar 2017 14:32:34 -0700 From: Bart Van Assche To: Jens Axboe CC: Omar Sandoval , Hannes Reinecke , "linux-block@vger.kernel.org" Subject: [PATCH] blk-mq: Export queue state through /sys/kernel/debug/block/*/state Thread-Topic: [PATCH] blk-mq: Export queue state through /sys/kernel/debug/block/*/state Thread-Index: AdKo0/nVtJn1gkVCSh6dLDGavgYbNA== Date: Wed, 29 Mar 2017 21:32:33 +0000 Message-ID: <1D08B61A9CF0974AA09887BE32D889DA12BA96@ULS-OP-MBXIP03.sdcorp.global.sandisk.com> Accept-Language: en-US, nl-NL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.181.8.64] MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrALMWRmVeSWpSXmKPExsWyRobxn+4X9TsRBk86VS3+7znGZrFn0SQm i723tC0O37vK4sDiMbH5HbvH5tPVHp83yQUwR3HZpKTmZJalFunbJXBlNJ89y1TQplbRsNKk gbFdoYuRg0NCwERiwzTbLkYuDiGBJUwSi66fZYVwLjFKrJ31hbGLkZODTcBIYvaEPSwgtoiA rMT33a/ZQIqYBRoZJVZ2nWcFSQgLhEpsX36bGaIoSqJhwwuoBj2J/U8OMYHYLAKqEi8/7AUb yisQK9E3+xmYzQg0dPH0FrAaZgFxiVtP5oPZEgICEkv2nGeGsEUlXj7+xwpxtbzE9dN2EOU6 Egt2f2KDsLUlli18zQwxXlDi5MwnLBMYhWchmToLScssJC2zkLQsYGRZxShWnJhcnJueWmBo olecmJeSWZytl5yfu4kRHA+KxjsY/21wP8QowMGoxMNbsfZ2hBBrYllxZe4hRgkOZiURXq1P QCHelMTKqtSi/Pii0pzU4kOM0hwsSuK8MbOnRggJpCeWpGanphakFsFkmTg4pRoYa89+VeaY I3qj8UOt7Z8UwfAzhzfbyTHei+lK/lfqfPipzSqOXIEm/gdz9ntV/rSc8m123ss5T0yvTuNT NrFSSTi7wdVN8padVtwqnqmJJpoSb6ZoOcw4neW97KhP/z+307+DP4X4399+8eo7jkPX8xx4 ipg+nP9/xu+EsvClOfl7CmrcZFQVlViKMxINtZiLihMBBo7e/IMCAAA= X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:74.221.232.54; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39450400003)(39840400002)(39860400002)(39400400002)(39410400002)(39850400002)(2980300002)(438002)(189002)(199003)(9170700003)(54356999)(189998001)(106466001)(102836003)(6116002)(23726003)(50986999)(3846002)(47776003)(50466002)(2906002)(53936002)(86362001)(55846006)(6916009)(8746002)(33656002)(46406003)(97756001)(81166006)(8676002)(8936002)(305945005)(4326008)(7696004)(5660300001)(38730400002)(7736002)(55016002)(356003)(2900100001)(2920100001)(54906002)(2930100002); DIR:OUT; SFP:1102; SCL:1; SRVR:BN1PR04MB108; H:sacsmgep14.sandisk.com; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM04FT032; 1:G2PZ9TRW0KBaPpT3R/dqYLTZG/rlItRxfSH2KNaXJfopYAEMxZ8kYtyaNoX2oAOj9P8vCAVLnBLMv3oRNeY19eYBIKcTNb3eg2tdBEYOKjzWcAuSvF3sXiwSsUJl897HE47qCllQRZCSpKcVEj8lP+mgM0M1krVr8E0ywKycoYNQ8eL+VAqnlOOLn/8JEsxIeRx447nbldNepcyXAzE5Vt4KL60ob6MM/GOgLcQD0lVYG1JHKbBUcEsldkzS9jdykqcYHkAtNrFpc27kMYpxgdZtk2aJJN28Py3nIq+xjy+LQ/5PEymSBsPVJ+sbAzqSBjVzy0T25U29yvmhSE3Ic5N2C6pcbGMSST3rNdn/SrfvsyTXkFOCpG3UtZFBux6yk5Z5I5S2uHUQ1Uzq71zIcDSVlMhFpmhOLtG7yNfLO27hrub1j3n6uojIRuKXxgFcREmsvrroodPaTgGqMF1+zckntFXbrqtzZoANkwqg9nRnJFjIuK+XBtyXKjq2r2sZMGYrYxzRbb8vxyFfhVziU5QKQgAM+JYq0iqHrOq2bzVq5EHm7phrJt0zQcVVsrLv3QG3rVu9tRj9Agbi62++VQ== X-MS-Office365-Filtering-Correlation-Id: 3fd2e52e-f487-4a6a-d73e-08d476eb1eab X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081)(201702281549075); SRVR:BN1PR04MB108; X-Microsoft-Exchange-Diagnostics: 1; BN1PR04MB108; 3:l5B07VYO8J8a3dz4ebT1WHcM0BVsJSoNzHcpksIy+fa1xuqD/+9ONjRllYH9UO6VVZBOhOYct9G91Ydt0EP7wTRAuR/hc4If83EwcXX/yGdp8/WFbCxTfRkwjt5GK47Vn7rqXkas9N332+c3ZW4wuYN8WcuTwfEQX2lOTHP+rbJ5um8L01NWnKODunuoaoHJJ7OfnntAzUeX6B8lEw4TGCqcDsjXuiKnsbbQM940kLYP2HENDuhMK2zKEAmXEFJZwi3Vz1V4pzLLPOOFLBuHgnRZP2Ft3fvAo0Of9qIAZNiuMg7GXfXfZwNqINOs/CO04lV3ks3hjoTaI1XQXBq7XxV1mA8tMGCOzzTni6sjxIHFGuUjrg4Al81lAA6ceMlcdp53zAASpIy/I7qb0ZdNzntkwEWaJDQqUhXUzxg3Ja9NLzF+QgOoRRSqbDAtlF/0Ndd8tTStOVC/A6i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jCtxSlQmfvVby9iaN2bvoX1WR+LtIKWaVIKPqJy1iqpoLO30Sx9NWvJ35COaotyvKmp7aoskoqeEaMXeIWzByE6jAE6wtSo8bqMBNn0L8adJ+IiNezKyuBOGkbzlUymsHGCISI0v1it7FIPhNQPkK0hvSPApJZDZt14uEIhEYXY25SFnqlNKdG8wQzhYgBsygDxLcz1/LdcuqWK6WUiohv0NxRLnwQthXovXzWJlDofd0se3aLOrhnYkppWbr6LDVMmcMFgCUBmnxBK4v1XtBu/RY38xbAhDLT6sGHnG1ECwFhc9B5Zss8SKqDfSMmquo8lkYBJjUdggsKvNd36GfwBREb7JZjv87l+mWMeF3A44iWlG8 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(13023025)(5005006)(13024025)(13018025)(13016025)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123558025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406075)(20161123564025)(20161123555025)(20161123562025)(6072148); SRVR:BN1PR04MB108; BCL:0; PCL:0; RULEID:; SRVR:BN1PR04MB108; X-Microsoft-Exchange-Diagnostics: 1; BN1PR04MB108; 4:0ZzAG86c3hYD8SwmBSGxbv/WtuecWKEoTBWtnz7Bn2aYSnskGNfJRHp4bJP63e7PaxVv3PoKTo76B2AssDVwMPs0RJ4HEGvPw2vMNJP5ZS6aJ+kyoG2JO/SnLG7uOyKM29QHN4eWQPKN7AJ/R6+J4KFWTEPwGP5Xj3XhqqVcB4gIuQS5DBF52sPbIsgQX7L71/o3Cqj0Gobp8Udwzz5ITz/MQW3hbB8jLjSlgLYcCVUkMgi8AAPgijtn9zQTDn9nqiAhCjYSXGLuzg9GahVUD8O4RfW27DlMSjjJha05uW75eMerNcbg0xscwD9rdwxH/JLYzvF4TC7GfndTRF2BTZHMqK9rrPH6kRsEDKina4Rj1X44XhKonv6ed714onwM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HYC94IDeOv2e5+B5shBgmXn5UaafEYTaqVhYrnExEPwnck?= =?us-ascii?Q?OBvdAFlRudcWtUXd9E4c8ISkSprsafs4j4SzeZC6Fp08fKtHYsvjfPFLJ+XM?= =?us-ascii?Q?m+PVKgc7JzOzqdHNH6AWNvxVnLy5T0W3qbvcoWa9KwNm8czfrXW6izFVo0SA?= =?us-ascii?Q?EbtAOBafDljVbF/+7fiI33c4tv0I0Hr7Q7M9I21zikuTBoqo/SDutsSYtDft?= =?us-ascii?Q?zAZHcG5n1KpAd3x3/hjR9PnR9qiS+c012eIuvvfiOsBuVCn3a1S8XwnE1t4q?= =?us-ascii?Q?cuEtO23C+b7nA1Adz2OwyIjEA1ULROsJYHJmc7UmAaLn7RC4oMBkVht13WYD?= =?us-ascii?Q?G8ycQVyPEfWoZFiwXL9X3r3bmlUtGX2PBvS/QhkfQk9ELs0q39O9O11AQWJT?= =?us-ascii?Q?S8Eza8VYZYDb43SC1BlKrtxz52bslSfzcPS98mvDoQfgx/Zf5leUpPW2Rrh4?= =?us-ascii?Q?FLTXbaH8rwgmPrUU2D3vM6Up0vxWbYbiIW3U0aCzv1X9jSfA/MEWcm3leQKN?= =?us-ascii?Q?+cJeS21+2m/wNEf51+9tMptZmP2VSCufwJ1U4TJJWpTXlsQPJtEbK+0ke4bR?= =?us-ascii?Q?YfHy3l1khx8NzWa2AbqhXTA1hxMVyFa1OE5fcN9pNk4ac6J4dGcaLb9GNM3R?= =?us-ascii?Q?SI50AcUtdPuwPG6Cl4dLeLi96LFSjTduSDM4IaJplOmus5VWaPzjXdh54d59?= =?us-ascii?Q?uSunqISfT1P39/e44kGBEI/46omQINlFL9AhUN5+wH31gn0aemoQALEHoom/?= =?us-ascii?Q?dtMk10kVidfl9T5pQsJOqpjwa5Xc1b?= X-Microsoft-Exchange-Diagnostics: 1; BN1PR04MB108; 6:QmXEmJsQCjUIX2+8XX3/HYye16sZITUlEzf+16rVZppQWcFxF7P69kYlGWGzi62qErQbmCz+QFKgY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GLKRIKIwH9DaJ4pxh6uCjHwOfaR83eveiakRnFDrE3yIWpCbIp2RWL8H81AdrFvsemTX3BGShK4e+eKQM3uHnE/u0wndWOKdy7C6+NKi/TIm1fZsjpRkw2yyeNgmz+fPN8Gg/u+MdW8DJI= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2017 21:32:36.7396 (UTC) X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=b61c8803-16f3-4c35-9b17-6f65f441df86; Ip=[74.221.232.54]; Helo=[sacsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR04MB108 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 Make it possible to check whether or not a block layer queue has been stopped. Make it possible to start and to run a blk-mq queue from user space. Signed-off-by: Bart Van Assche Cc: Omar Sandoval Cc: Hannes Reinecke --- Changes compared to v1: - Constified blk_queue_flag_name. - Left out QUEUE_FLAG_VIRT because it is a synonym of QUEUE_FLAG_NONROT. - Check array size before reading from blk_queue_flag_name[]. - Add functionality to restart a block layer queue. --- block/blk-mq-debugfs.c | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index 4b3f962a9c7a..f8b97d6306af 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -43,6 +43,100 @@ static int blk_mq_debugfs_seq_open(struct inode *inode, struct file *file, return ret; } +static const char *const blk_queue_flag_name[] = { + [QUEUE_FLAG_QUEUED] = "QUEUED", + [QUEUE_FLAG_STOPPED] = "STOPPED", + [QUEUE_FLAG_SYNCFULL] = "SYNCFULL", + [QUEUE_FLAG_ASYNCFULL] = "ASYNCFULL", + [QUEUE_FLAG_DYING] = "DYING", + [QUEUE_FLAG_BYPASS] = "BYPASS", + [QUEUE_FLAG_BIDI] = "BIDI", + [QUEUE_FLAG_NOMERGES] = "NOMERGES", + [QUEUE_FLAG_SAME_COMP] = "SAME_COMP", + [QUEUE_FLAG_FAIL_IO] = "FAIL_IO", + [QUEUE_FLAG_STACKABLE] = "STACKABLE", + [QUEUE_FLAG_NONROT] = "NONROT", + [QUEUE_FLAG_IO_STAT] = "IO_STAT", + [QUEUE_FLAG_DISCARD] = "DISCARD", + [QUEUE_FLAG_NOXMERGES] = "NOXMERGES", + [QUEUE_FLAG_ADD_RANDOM] = "ADD_RANDOM", + [QUEUE_FLAG_SECERASE] = "SECERASE", + [QUEUE_FLAG_SAME_FORCE] = "SAME_FORCE", + [QUEUE_FLAG_DEAD] = "DEAD", + [QUEUE_FLAG_INIT_DONE] = "INIT_DONE", + [QUEUE_FLAG_NO_SG_MERGE] = "NO_SG_MERGE", + [QUEUE_FLAG_POLL] = "POLL", + [QUEUE_FLAG_WC] = "WC", + [QUEUE_FLAG_FUA] = "FUA", + [QUEUE_FLAG_FLUSH_NQ] = "FLUSH_NQ", + [QUEUE_FLAG_DAX] = "DAX", + [QUEUE_FLAG_STATS] = "STATS", + [QUEUE_FLAG_RESTART] = "RESTART", + [QUEUE_FLAG_POLL_STATS] = "POLL_STATS", +}; + +static int blk_queue_flags_show(struct seq_file *m, void *v) +{ + struct request_queue *q = m->private; + bool sep = false; + int i; + + for (i = 0; i < sizeof(q->queue_flags) * BITS_PER_BYTE; i++) { + if (!(q->queue_flags & BIT(i))) + continue; + if (sep) + seq_puts(m, " "); + sep = true; + if (i < ARRAY_SIZE(blk_queue_flag_name) && + blk_queue_flag_name[i]) + seq_puts(m, blk_queue_flag_name[i]); + else + seq_printf(m, "%d", i); + } + seq_puts(m, "\n"); + return 0; +} + +static ssize_t blk_queue_flags_store(struct file *file, const char __user *ubuf, + size_t len, loff_t *offp) +{ + struct request_queue *q = file_inode(file)->i_private; + char op[16] = { }, *s; + + len = min(len, sizeof(op) - 1); + if (copy_from_user(op, ubuf, len)) + return -EFAULT; + s = op; + strsep(&s, " \t\n"); /* strip trailing whitespace */ + if (strcmp(op, "run") == 0) { + blk_mq_run_hw_queues(q, true); + } else if (strcmp(op, "start") == 0) { + blk_mq_start_stopped_hw_queues(q, true); + } else { + pr_err("%s: unsupported operation %s\n", __func__, op); + return -EINVAL; + } + return len; +} + +static int blk_queue_flags_open(struct inode *inode, struct file *file) +{ + return single_open(file, blk_queue_flags_show, inode->i_private); +} + +static const struct file_operations blk_queue_flags_fops = { + .open = blk_queue_flags_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, + .write = blk_queue_flags_store, +}; + +static const struct blk_mq_debugfs_attr blk_queue_attrs[] = { + {"state", 0600, &blk_queue_flags_fops}, + {}, +}; + static void print_stat(struct seq_file *m, struct blk_rq_stat *stat) { if (stat->nr_samples) { @@ -735,6 +829,9 @@ int blk_mq_debugfs_register_hctxs(struct request_queue *q) if (!q->debugfs_dir) return -ENOENT; + if (!debugfs_create_files(q->debugfs_dir, q, blk_queue_attrs)) + goto err; + q->mq_debugfs_dir = debugfs_create_dir("mq", q->debugfs_dir); if (!q->mq_debugfs_dir) goto err;