From patchwork Tue Mar 8 17:34:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Derrick X-Patchwork-Id: 8536391 X-Patchwork-Delegate: axboe@kernel.dk Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id ED1419F372 for ; Tue, 8 Mar 2016 17:35:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 19DFA200EC for ; Tue, 8 Mar 2016 17:35:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3864420107 for ; Tue, 8 Mar 2016 17:35:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752985AbcCHRfh (ORCPT ); Tue, 8 Mar 2016 12:35:37 -0500 Received: from mga04.intel.com ([192.55.52.120]:48044 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751601AbcCHRfg (ORCPT ); Tue, 8 Mar 2016 12:35:36 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP; 08 Mar 2016 09:35:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,557,1449561600"; d="scan'208";a="932355157" Received: from nsgse-neoncity01.lm.intel.com (HELO nsgse-neoncity01.localdomain) ([10.232.118.5]) by fmsmga002.fm.intel.com with ESMTP; 08 Mar 2016 09:35:35 -0800 From: Jon Derrick To: axboe@fb.com Cc: Jon Derrick , linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, keith.busch@intel.com, hch@infradead.org, stephen.bates@microsemi.com Subject: [PATCH 1/2] Block: Disable polling stats when iostats are disabled Date: Tue, 8 Mar 2016 10:34:53 -0700 Message-Id: <1457458494-10550-2-git-send-email-jonathan.derrick@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1457458494-10550-1-git-send-email-jonathan.derrick@intel.com> References: <1457458494-10550-1-git-send-email-jonathan.derrick@intel.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Extends iostats to encompass polling statistics to save a few cycles when disabled. Signed-off-by: Jon Derrick --- block/blk-core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index ab51685..354d03b 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -3350,13 +3350,16 @@ bool blk_poll(struct request_queue *q, blk_qc_t cookie) while (!need_resched()) { unsigned int queue_num = blk_qc_t_to_queue_num(cookie); struct blk_mq_hw_ctx *hctx = q->queue_hw_ctx[queue_num]; + int io_stat = blk_queue_io_stat(q); int ret; - hctx->poll_invoked++; + if (io_stat) + hctx->poll_invoked++; ret = q->mq_ops->poll(hctx, blk_qc_t_to_tag(cookie)); if (ret > 0) { - hctx->poll_success++; + if (io_stat) + hctx->poll_success++; set_current_state(TASK_RUNNING); return true; }