From: "Alan D. Brunelle" <Alan.Brunelle@hp.com>
To: linux-kernel@vger.kernel.org
Cc: Jens Axboe <jens.axboe@oracle.com>
Subject: Re: [RFC][PATCH 1/3] Add flag and sysfs interfaces
Date: Wed, 23 Apr 2008 15:12:14 -0400 [thread overview]
Message-ID: <480F8A0E.8070206@hp.com> (raw)
In-Reply-To: <480F8936.5030406@hp.com>
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: 0001-Added-QUEUE_FLAG_NOMERGES-and-sysfs-interfaces.patch --]
[-- Type: text/x-patch, Size: 2656 bytes --]
Signed-off-by: Alan D. Brunelle <alan.brunelle@hp.com>
---
block/blk-sysfs.c | 27 +++++++++++++++++++++++++++
include/linux/blkdev.h | 2 ++
2 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 54d0db1..32d917c 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -135,6 +135,26 @@ static ssize_t queue_max_hw_sectors_show(struct request_queue *q, char *page)
return queue_var_show(max_hw_sectors_kb, (page));
}
+static ssize_t queue_nomerges_show(struct request_queue *q, char *page)
+{
+ int nm = test_bit(QUEUE_FLAG_NOMERGES, &q->queue_flags);
+ return queue_var_show(nm, page);
+}
+
+static ssize_t queue_nomerges_store(struct request_queue *q, const char *page,
+ size_t count)
+{
+ unsigned long nm;
+ ssize_t ret = queue_var_store(&nm, page, count);
+
+ if (nm)
+ set_bit(QUEUE_FLAG_NOMERGES, &q->queue_flags);
+ else
+ clear_bit(QUEUE_FLAG_NOMERGES, &q->queue_flags);
+
+ return ret;
+}
+
static struct queue_sysfs_entry queue_requests_entry = {
.attr = {.name = "nr_requests", .mode = S_IRUGO | S_IWUSR },
@@ -170,6 +190,12 @@ static struct queue_sysfs_entry queue_hw_sector_size_entry = {
.show = queue_hw_sector_size_show,
};
+static struct queue_sysfs_entry queue_nomerges_entry = {
+ .attr = {.name = "nomerges", .mode = S_IRUGO | S_IWUSR },
+ .show = queue_nomerges_show,
+ .store = queue_nomerges_store,
+};
+
static struct attribute *default_attrs[] = {
&queue_requests_entry.attr,
&queue_ra_entry.attr,
@@ -177,6 +203,7 @@ static struct attribute *default_attrs[] = {
&queue_max_sectors_entry.attr,
&queue_iosched_entry.attr,
&queue_hw_sector_size_entry.attr,
+ &queue_nomerges_entry.attr,
NULL,
};
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 6f79d40..ee577f9 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -405,6 +405,7 @@ struct request_queue
#define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */
#define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */
#define QUEUE_FLAG_BIDI 9 /* queue supports bidi requests */
+#define QUEUE_FLAG_NOMERGES 10 /* disable merge attempts */
enum {
/*
@@ -449,6 +450,7 @@ enum {
#define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags)
#define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags)
#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags)
+#define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags)
#define blk_queue_flushing(q) ((q)->ordseq)
#define blk_fs_request(rq) ((rq)->cmd_type == REQ_TYPE_FS)
--
1.5.2.5
next prev parent reply other threads:[~2008-04-23 19:12 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-23 19:08 [RFC][PATCH 0/3] Skip I/O merges when disabled Alan D. Brunelle
2008-04-23 19:12 ` Alan D. Brunelle [this message]
2008-04-23 19:14 ` [RFC][PATCH 2/3] Have __make_request skip " Alan D. Brunelle
2008-04-23 19:15 ` [RFC][PATCH 3/3] Do not use rqhash when merges disabled Alan D. Brunelle
2008-04-24 0:37 ` Aaron Carroll
2008-04-24 0:59 ` Alan D. Brunelle
2008-04-24 2:07 ` Aaron Carroll
2008-04-24 7:09 ` [RFC][PATCH 0/3] Skip I/O merges when disabled Jens Axboe
2008-04-24 12:09 ` Alan D. Brunelle
2008-04-25 8:38 ` Jens Axboe
2008-04-25 11:17 ` Alan D. Brunelle
2008-04-25 11:25 ` Jens Axboe
2008-04-25 12:06 ` Aaron Carroll
2008-04-25 12:14 ` Jens Axboe
2008-04-25 12:17 ` Alan D. Brunelle
2008-04-28 16:36 ` Alan D. Brunelle
2008-04-29 7:37 ` Jens Axboe
2008-04-24 20:38 ` Alan D. Brunelle
2008-04-24 13:29 ` Andi Kleen
2008-04-24 13:59 ` Jens Axboe
2008-04-24 14:13 ` Alan D. Brunelle
2008-04-24 15:05 ` Jens Axboe
2008-04-24 22:04 ` Carl Henrik Lunde
2008-04-25 7:13 ` Andi Kleen
2008-04-24 14:15 ` Andi Kleen
2008-04-24 15:04 ` Jens Axboe
2008-04-24 15:53 ` David Collier-Brown
2008-04-24 16:29 ` Alan D. Brunelle
2008-04-24 13:31 ` Alan D. Brunelle
2008-04-24 13:43 ` Alan D. Brunelle
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=480F8A0E.8070206@hp.com \
--to=alan.brunelle@hp.com \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
/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