From: jonathan.derrick@intel.com (Jon Derrick)
Subject: [PATCH 2/2] block: add forced polling sysfs controls
Date: Thu, 31 Mar 2016 14:19:14 -0600 [thread overview]
Message-ID: <1459455554-2794-3-git-send-email-jonathan.derrick@intel.com> (raw)
In-Reply-To: <1459455554-2794-1-git-send-email-jonathan.derrick@intel.com>
This patch adds io polling force controls to sysfs. Setting this knob
forces direct-io to always poll, even if the io does not specify the
HIPRI flag.
Signed-off-by: Jon Derrick <jonathan.derrick at intel.com>
---
block/blk-sysfs.c | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index dd93763..e3af748 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -347,6 +347,37 @@ static ssize_t queue_poll_store(struct request_queue *q, const char *page,
return ret;
}
+static ssize_t queue_poll_force_show(struct request_queue *q, char *page)
+{
+ return queue_var_show(test_bit(QUEUE_FLAG_POLL_FORCE, &q->queue_flags),
+ page);
+}
+
+static ssize_t queue_poll_force_store(struct request_queue *q, const char *page,
+ size_t count)
+{
+ unsigned long poll_force_on;
+ ssize_t ret;
+
+ if (!q->mq_ops || !q->mq_ops->poll ||
+ !test_bit(QUEUE_FLAG_POLL, &q->queue_flags))
+ return -EINVAL;
+
+ ret = queue_var_store(&poll_force_on, page, count);
+ if (ret < 0)
+ return ret;
+
+ spin_lock_irq(q->queue_lock);
+ if (poll_force_on)
+ queue_flag_set(QUEUE_FLAG_POLL_FORCE, q);
+ else
+ queue_flag_clear(QUEUE_FLAG_POLL_FORCE, q);
+ spin_unlock_irq(q->queue_lock);
+
+ return ret;
+}
+
+
static struct queue_sysfs_entry queue_requests_entry = {
.attr = {.name = "nr_requests", .mode = S_IRUGO | S_IWUSR },
.show = queue_requests_show,
@@ -478,6 +509,12 @@ static struct queue_sysfs_entry queue_poll_entry = {
.store = queue_poll_store,
};
+static struct queue_sysfs_entry queue_poll_force_entry = {
+ .attr = {.name = "io_poll_force", .mode = S_IRUGO | S_IWUSR },
+ .show = queue_poll_force_show,
+ .store = queue_poll_force_store,
+};
+
static struct attribute *default_attrs[] = {
&queue_requests_entry.attr,
&queue_ra_entry.attr,
@@ -503,6 +540,7 @@ static struct attribute *default_attrs[] = {
&queue_iostats_entry.attr,
&queue_random_entry.attr,
&queue_poll_entry.attr,
+ &queue_poll_force_entry.attr,
NULL,
};
--
2.5.0
next prev parent reply other threads:[~2016-03-31 20:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-31 20:19 [PATCH 0/2] Block: Give option to force io polling Jon Derrick
2016-03-31 20:19 ` [PATCH 1/2] block: add queue flag to always poll Jon Derrick
2016-05-05 21:23 ` Jeff Moyer
2016-05-05 21:34 ` Jon Derrick
2016-03-31 20:19 ` Jon Derrick [this message]
2016-04-05 12:38 ` [PATCH 0/2] Block: Give option to force io polling Christoph Hellwig
2016-04-05 15:54 ` Keith Busch
2016-04-05 17:27 ` Christoph Hellwig
2016-04-05 18:07 ` Stephen Bates
2016-05-05 19:44 ` Stephen Bates
2016-05-08 9:02 ` hch
2016-05-09 14:53 ` Stephen Bates
2016-05-12 7:08 ` hch
2016-05-12 17:27 ` Stephen Bates
2016-05-12 17:34 ` Derrick, Jonathan
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=1459455554-2794-3-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