From patchwork Tue Sep 13 18:23:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Bates X-Patchwork-Id: 9329819 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 852F46089F for ; Tue, 13 Sep 2016 18:46:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7ADDD295A4 for ; Tue, 13 Sep 2016 18:46:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6FF22295A6; Tue, 13 Sep 2016 18:46:41 +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,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 EF569295A4 for ; Tue, 13 Sep 2016 18:46:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758962AbcIMSqk (ORCPT ); Tue, 13 Sep 2016 14:46:40 -0400 Received: from gateway34.websitewelcome.com ([192.185.149.72]:39121 "EHLO gateway34.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759595AbcIMSqj (ORCPT ); Tue, 13 Sep 2016 14:46:39 -0400 X-Greylist: delayed 1389 seconds by postgrey-1.27 at vger.kernel.org; Tue, 13 Sep 2016 14:46:39 EDT Received: from cm6.websitewelcome.com (cm6.websitewelcome.com [108.167.139.19]) by gateway34.websitewelcome.com (Postfix) with ESMTP id 77706891DD791 for ; Tue, 13 Sep 2016 13:23:21 -0500 (CDT) Received: from estate.websitewelcome.com ([192.185.83.90]) by cm6.websitewelcome.com with id j6PL1t00R1wvuag016PMpu; Tue, 13 Sep 2016 13:23:21 -0500 Received: from lambic.deltatee.com ([207.54.116.65]:55842 helo=cgy1-donard.priv.deltatee.com) by estate.websitewelcome.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-SHA256:128) (Exim 4.86_1) (envelope-from ) id 1bjsMZ-000W8f-N0; Tue, 13 Sep 2016 13:23:20 -0500 From: Stephen Bates To: linux-block@vger.kernel.org Cc: axboe@kernel.dk, hch@lst.de Subject: [PATCH 2/2] Enable zeroing of io_poll statistics Date: Tue, 13 Sep 2016 12:23:16 -0600 Message-Id: <1473790996-27038-3-git-send-email-sbates@raithlin.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1473790996-27038-1-git-send-email-sbates@raithlin.com> References: <1473790996-27038-1-git-send-email-sbates@raithlin.com> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - estate.websitewelcome.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - raithlin.com X-BWhitelist: no X-Source-IP: 207.54.116.65 X-Exim-ID: 1bjsMZ-000W8f-N0 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: lambic.deltatee.com (cgy1-donard.priv.deltatee.com) [207.54.116.65]:55842 X-Source-Auth: sbates@raithlin.com X-Email-Count: 15 X-Source-Cap: cmFpdGhsaW47c2NvdHQ7ZXN0YXRlLndlYnNpdGV3ZWxjb21lLmNvbQ== 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 Allow the io_poll statistics to be zeroed to make for easier logging of polling event. Signed-off-by: Stephen Bates --- block/blk-mq-sysfs.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/block/blk-mq-sysfs.c b/block/blk-mq-sysfs.c index ea8c3f5..ac5160e 100644 --- a/block/blk-mq-sysfs.c +++ b/block/blk-mq-sysfs.c @@ -181,6 +181,14 @@ static ssize_t blk_mq_hw_sysfs_poll_show(struct blk_mq_hw_ctx *hctx, char *page) hctx->poll_success); } +static ssize_t blk_mq_hw_sysfs_poll_store(struct blk_mq_hw_ctx *hctx, + const char *page, size_t size) +{ + hctx->poll_considered = hctx->poll_invoked = hctx->poll_success = 0; + + return size; +} + static ssize_t blk_mq_hw_sysfs_queued_show(struct blk_mq_hw_ctx *hctx, char *page) { @@ -303,8 +311,9 @@ static struct blk_mq_hw_ctx_sysfs_entry blk_mq_hw_sysfs_cpus = { .show = blk_mq_hw_sysfs_cpus_show, }; static struct blk_mq_hw_ctx_sysfs_entry blk_mq_hw_sysfs_poll = { - .attr = {.name = "io_poll", .mode = S_IRUGO }, + .attr = {.name = "io_poll", .mode = S_IWUSR | S_IRUGO }, .show = blk_mq_hw_sysfs_poll_show, + .store = blk_mq_hw_sysfs_poll_store, }; static struct attribute *default_hw_ctx_attrs[] = {