From patchwork Tue Oct 30 18:32:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 10661407 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A6F281932 for ; Tue, 30 Oct 2018 18:34:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B1BEE2986B for ; Tue, 30 Oct 2018 18:34:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A65A7299B9; Tue, 30 Oct 2018 18:34:28 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,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 538C52986B for ; Tue, 30 Oct 2018 18:34:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726984AbeJaD1o (ORCPT ); Tue, 30 Oct 2018 23:27:44 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:54682 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728213AbeJaD1o (ORCPT ); Tue, 30 Oct 2018 23:27:44 -0400 Received: by mail-it1-f193.google.com with SMTP id d6so9363304itl.4 for ; Tue, 30 Oct 2018 11:33:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FDKGBdEnPJqmZMVEkJWhACz2yqqeabrzsupMLOYAhO4=; b=sAQt6ArmCG29q2FC2N3AEPWxQsxpU9ESDqTKtgWldkMW2zejie424VUyRdwDv7/jyk GyqYFEYz4ONd0OYnjasEn/TFB6hImfM5yLp0uRFa9aLHzTAnwfAloAjbv9XSQuHSEtpi Ao3wpVsOXf+CPjgybmvDgJUbd6fUHHKIWo/qqzzt0lK/C5TAEf693/Jnutc5CUDF3TtE oM2KFZpex+B94D1hHl+W/JBGdFdn7V9ZLHp3gW8ElWLMBn3kR57HI+LSyIaYqEtIZqAr GuZr6MvIyKcjcS2MFzlVIeh+kiOBxOFZvDMyvgkKuv62C4Y3FaavZy8s5pjh7iMzVqIL bhvg== 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; bh=FDKGBdEnPJqmZMVEkJWhACz2yqqeabrzsupMLOYAhO4=; b=XD5vxsU1iwmcAXdYpSohpedhu3ocAgEnImZ794OPudT3H11PcaKB0IsfcccIKg7OcX t5kA5piEXsDBWCkTpmAeSiyIrbpudXPiLRebQTWrFO28mvCJM/b0bBSiQsc7daaC5/mI FKCU+pTnJZcU5N5U01bPMxxLbHMUg98bvuNKYTDc5ti6Aa6zqfi59c7viRQ7SjCJhFwP haqqAgmWsjAeclHQpd3KfdGGGK04p+mmEYfh3w5bBSL/kL/qSjw6i6gZTbF+MA1MnS5y rdCouAtvTB4pKBw8vd7LqowoHYaGwCMpcftP7VGihwZmoswMrpuFoBSdnBPUxFl6xh3f RQfA== X-Gm-Message-State: AGRZ1gKWCf7hRYCW9I5WGYBaAVDqHpjVMwyqHXW9xqKR4Vrn0GBwFenm LOz9r1rFHNeIJ1jZz9bk1RKnqU/9jwc= X-Google-Smtp-Source: AJdET5di1MfVvmB6Hq618QWR7jsFmPGD/4Vc9jDMrIk7h9M2KWLd68t9oDSc56+f1ChmvsHRFM89Ag== X-Received: by 2002:a24:4f51:: with SMTP id c78-v6mr22872itb.56.1540924388040; Tue, 30 Oct 2018 11:33:08 -0700 (PDT) Received: from localhost.localdomain ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id o20-v6sm4895739itc.34.2018.10.30.11.33.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Oct 2018 11:33:06 -0700 (PDT) From: Jens Axboe To: linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Jens Axboe Subject: [PATCH 06/16] blk-mq: add 'type' attribute to the sysfs hctx directory Date: Tue, 30 Oct 2018 12:32:42 -0600 Message-Id: <20181030183252.17857-7-axboe@kernel.dk> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181030183252.17857-1-axboe@kernel.dk> References: <20181030183252.17857-1-axboe@kernel.dk> 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 It can be useful for a user to verify what type a given hardware queue is, expose this information in sysfs. Reviewed-by: Hannes Reinecke Reviewed-by: Bart Van Assche Signed-off-by: Jens Axboe Reviewed-by: Sagi Grimberg --- block/blk-mq-sysfs.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/block/blk-mq-sysfs.c b/block/blk-mq-sysfs.c index aafb44224c89..2d737f9e7ba7 100644 --- a/block/blk-mq-sysfs.c +++ b/block/blk-mq-sysfs.c @@ -161,6 +161,11 @@ static ssize_t blk_mq_hw_sysfs_cpus_show(struct blk_mq_hw_ctx *hctx, char *page) return ret; } +static ssize_t blk_mq_hw_sysfs_type_show(struct blk_mq_hw_ctx *hctx, char *page) +{ + return sprintf(page, "%u\n", hctx->type); +} + static struct attribute *default_ctx_attrs[] = { NULL, }; @@ -177,11 +182,16 @@ static struct blk_mq_hw_ctx_sysfs_entry blk_mq_hw_sysfs_cpus = { .attr = {.name = "cpu_list", .mode = 0444 }, .show = blk_mq_hw_sysfs_cpus_show, }; +static struct blk_mq_hw_ctx_sysfs_entry blk_mq_hw_sysfs_type = { + .attr = {.name = "type", .mode = 0444 }, + .show = blk_mq_hw_sysfs_type_show, +}; static struct attribute *default_hw_ctx_attrs[] = { &blk_mq_hw_sysfs_nr_tags.attr, &blk_mq_hw_sysfs_nr_reserved_tags.attr, &blk_mq_hw_sysfs_cpus.attr, + &blk_mq_hw_sysfs_type.attr, NULL, };