From patchwork Tue Mar 14 21:03:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 9624501 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 7FA0C604CC for ; Tue, 14 Mar 2017 21:04:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71F4D285CF for ; Tue, 14 Mar 2017 21:04:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66D03285DC; Tue, 14 Mar 2017 21:04:38 +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 4E16E285CF for ; Tue, 14 Mar 2017 21:04:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753225AbdCNVEe (ORCPT ); Tue, 14 Mar 2017 17:04:34 -0400 Received: from mail-pf0-f177.google.com ([209.85.192.177]:36020 "EHLO mail-pf0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753034AbdCNVEb (ORCPT ); Tue, 14 Mar 2017 17:04:31 -0400 Received: by mail-pf0-f177.google.com with SMTP id o126so75584444pfb.3 for ; Tue, 14 Mar 2017 14:04:30 -0700 (PDT) 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=T1kdpuRjG8IeW5cZgSZxE3KIxajhDHnpWOtRmsbXX5s=; b=YVBMNAq9UvojI/+7UPg7hlBV/1ssZk8QL+om4wd+f1K/TrNv4rRZuX/2Vatgb6C7J1 FhqN0tNSbGpg0nPj1f8GeKZ955Rngo12ihit2800kQetFJqlEzlP6vJjzbEVngnYreA3 NXBtp5EotwLxdDKjZBvQVIXj+B9KYIrjLifMX+K5IyYdXaltUiwptu2PF0o1aDjYVbXI YY8NuAHzvFb1LXFrG5MrjTQF0kDM9+AAonnTb5iJo68ujAaRafadF0YCSSBH0O08SDJa qh8uTIkH8OCaSIQVOMzxzNu9WYGzTjQoG+0uCLvcTzSN5tl7NkHGBdLynJc3zIYhE3sd K0Kw== 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=T1kdpuRjG8IeW5cZgSZxE3KIxajhDHnpWOtRmsbXX5s=; b=bK/75qY/b5dvi5RTxpqrM8bwzkfEzDYh1vIc2S90jTWH+xFnjmEYanEl3wu0GOUI41 W0F6sB/WS2Up/eyMiPt1EzSPuy6U9cYyN7+xbeRGmP564zd0on2gio7KmuV2pHOWzGvk ZZmpq/pOspu9YZRxOs1ruVn4RVQntlnMRJss/fGsitTt9IgCpa6C4cHqVR6iG/ue7KOx nkNlL7GMfl3ZW1K+tuyVqmGQrmjk8ikkhWapVkG5ywOEFs+2vI8a9ftmayUtpdNOH59r TaGy5gjEFhkbLipt8raI+z80LHW4kvIee0bY2oc/vTv3ZFZnQFR+g9oa0xMzV83FzCDd tA+g== X-Gm-Message-State: AMke39lkaLaYhiBfV234Y6yc9DR3I6viF9s5H6aHruoaJoLb6jOczuhlbzYNU4aPFEqntmJt X-Received: by 10.99.119.196 with SMTP id s187mr45068179pgc.225.1489525469744; Tue, 14 Mar 2017 14:04:29 -0700 (PDT) Received: from vader.thefacebook.com ([2620:10d:c090:200::6:9a2a]) by smtp.gmail.com with ESMTPSA id 80sm40404273pgd.39.2017.03.14.14.04.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Mar 2017 14:04:29 -0700 (PDT) From: Omar Sandoval To: linux-block@vger.kernel.org Cc: kernel-team@fb.com Subject: [PATCH 1/4] block: tear out blk-stat debugfs/sysfs entries Date: Tue, 14 Mar 2017 14:03:28 -0700 Message-Id: X-Mailer: git-send-email 2.12.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 These made sense when there was a single stats buffer for the request queue, but that's going away. Signed-off-by: Omar Sandoval --- block/blk-mq-debugfs.c | 55 -------------------------------------------------- block/blk-sysfs.c | 26 ------------------------ 2 files changed, 81 deletions(-) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index f6d917977b33..18672225c417 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -322,60 +322,6 @@ static const struct file_operations hctx_io_poll_fops = { .release = single_release, }; -static void print_stat(struct seq_file *m, struct blk_rq_stat *stat) -{ - seq_printf(m, "samples=%d, mean=%lld, min=%llu, max=%llu", - stat->nr_samples, stat->mean, stat->min, stat->max); -} - -static int hctx_stats_show(struct seq_file *m, void *v) -{ - struct blk_mq_hw_ctx *hctx = m->private; - struct blk_rq_stat stat[2]; - - blk_stat_init(&stat[BLK_STAT_READ]); - blk_stat_init(&stat[BLK_STAT_WRITE]); - - blk_hctx_stat_get(hctx, stat); - - seq_puts(m, "read: "); - print_stat(m, &stat[BLK_STAT_READ]); - seq_puts(m, "\n"); - - seq_puts(m, "write: "); - print_stat(m, &stat[BLK_STAT_WRITE]); - seq_puts(m, "\n"); - return 0; -} - -static int hctx_stats_open(struct inode *inode, struct file *file) -{ - return single_open(file, hctx_stats_show, inode->i_private); -} - -static ssize_t hctx_stats_write(struct file *file, const char __user *buf, - size_t count, loff_t *ppos) -{ - struct seq_file *m = file->private_data; - struct blk_mq_hw_ctx *hctx = m->private; - struct blk_mq_ctx *ctx; - int i; - - hctx_for_each_ctx(hctx, ctx, i) { - blk_stat_init(&ctx->stat[BLK_STAT_READ]); - blk_stat_init(&ctx->stat[BLK_STAT_WRITE]); - } - return count; -} - -static const struct file_operations hctx_stats_fops = { - .open = hctx_stats_open, - .read = seq_read, - .write = hctx_stats_write, - .llseek = seq_lseek, - .release = single_release, -}; - static int hctx_dispatched_show(struct seq_file *m, void *v) { struct blk_mq_hw_ctx *hctx = m->private; @@ -646,7 +592,6 @@ static const struct blk_mq_debugfs_attr blk_mq_debugfs_hctx_attrs[] = { {"sched_tags", 0400, &hctx_sched_tags_fops}, {"sched_tags_bitmap", 0400, &hctx_sched_tags_bitmap_fops}, {"io_poll", 0600, &hctx_io_poll_fops}, - {"stats", 0600, &hctx_stats_fops}, {"dispatched", 0600, &hctx_dispatched_fops}, {"queued", 0600, &hctx_queued_fops}, {"run", 0600, &hctx_run_fops}, diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index c44b321335f3..6e1cf622af21 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -503,26 +503,6 @@ static ssize_t queue_dax_show(struct request_queue *q, char *page) return queue_var_show(blk_queue_dax(q), page); } -static ssize_t print_stat(char *page, struct blk_rq_stat *stat, const char *pre) -{ - return sprintf(page, "%s samples=%llu, mean=%lld, min=%lld, max=%lld\n", - pre, (long long) stat->nr_samples, - (long long) stat->mean, (long long) stat->min, - (long long) stat->max); -} - -static ssize_t queue_stats_show(struct request_queue *q, char *page) -{ - struct blk_rq_stat stat[2]; - ssize_t ret; - - blk_queue_stat_get(q, stat); - - ret = print_stat(page, &stat[BLK_STAT_READ], "read :"); - ret += print_stat(page + ret, &stat[BLK_STAT_WRITE], "write:"); - return ret; -} - static struct queue_sysfs_entry queue_requests_entry = { .attr = {.name = "nr_requests", .mode = S_IRUGO | S_IWUSR }, .show = queue_requests_show, @@ -691,11 +671,6 @@ static struct queue_sysfs_entry queue_dax_entry = { .show = queue_dax_show, }; -static struct queue_sysfs_entry queue_stats_entry = { - .attr = {.name = "stats", .mode = S_IRUGO }, - .show = queue_stats_show, -}; - static struct queue_sysfs_entry queue_wb_lat_entry = { .attr = {.name = "wbt_lat_usec", .mode = S_IRUGO | S_IWUSR }, .show = queue_wb_lat_show, @@ -733,7 +708,6 @@ static struct attribute *default_attrs[] = { &queue_poll_entry.attr, &queue_wc_entry.attr, &queue_dax_entry.attr, - &queue_stats_entry.attr, &queue_wb_lat_entry.attr, &queue_poll_delay_entry.attr, NULL,