Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: jonathan.derrick@intel.com (Jon Derrick)
Subject: [PATCH 1/2] Block: Disable polling stats when iostats are disabled
Date: Tue,  8 Mar 2016 10:34:53 -0700	[thread overview]
Message-ID: <1457458494-10550-2-git-send-email-jonathan.derrick@intel.com> (raw)
In-Reply-To: <1457458494-10550-1-git-send-email-jonathan.derrick@intel.com>

Extends iostats to encompass polling statistics to save a few cycles
when disabled.

Signed-off-by: Jon Derrick <jonathan.derrick at intel.com>
---
 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;
 		}
-- 
1.8.3.1

  reply	other threads:[~2016-03-08 17:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-08 17:34 [PATCH 0/2] Some performance fixes for fastpath Jon Derrick
2016-03-08 17:34 ` Jon Derrick [this message]
2016-03-08 17:38   ` [PATCH 1/2] Block: Disable polling stats when iostats are disabled Sagi Grimberg
2016-03-08 17:58     ` Jon Derrick
2016-03-08 17:40   ` Jens Axboe
2016-03-08 18:02     ` Jon Derrick
2016-03-08 17:34 ` [PATCH 2/2] NVMe: Remove unused sq_head read in completion path Jon Derrick
2016-03-08 17:40   ` Sagi Grimberg
2016-03-08 17:41   ` Jens Axboe
2016-03-09  7:54   ` Johannes Thumshirn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1457458494-10550-2-git-send-email-jonathan.derrick@intel.com \
    --to=jonathan.derrick@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox