public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: linux-kernel@vger.kernel.org
Cc: nickpiggin@yahoo.com.au
Subject: [PATCH 4/7] elevator: introduce a way to reuse rq for internal FIFO handling
Date: Wed, 12 Jul 2006 10:05:19 +0200	[thread overview]
Message-ID: <20060712080519.GE13920@suse.de> (raw)
In-Reply-To: <20060712080319.GA13920@suse.de>

[PATCH] elevator: introduce a way to reuse rq for internal FIFO handling

The io schedulers can use this instead of having to allocate space for
it themselves.

Signed-off-by: Jens Axboe <axboe@suse.de>
---
 include/linux/elevator.h |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index 38f0f0d..6e1c903 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -167,4 +167,16 @@ enum {
 #define rq_end_sector(rq)	((rq)->sector + (rq)->nr_sectors)
 #define rb_entry_rq(node)	rb_entry((node), struct request, rb_node)
 
+/*
+ * Hack to reuse the donelist list_head as the fifo time holder while
+ * the request is in the io scheduler. Saves an unsigned long in rq.
+ */
+#define rq_fifo_time(rq)	((unsigned long) (rq)->donelist.next)
+#define rq_set_fifo_time(rq,exp)	((rq)->donelist.next = (void *) (exp))
+#define rq_entry_fifo(ptr)	list_entry((ptr), struct request, queuelist)
+#define rq_fifo_clear(rq)	do {		\
+	list_del_init(&(rq)->queuelist);	\
+	INIT_LIST_HEAD(&(rq)->donelist);	\
+	} while (0)
+ 
 #endif
-- 
1.4.1.ged0e0

-- 
Jens Axboe


  parent reply	other threads:[~2006-07-12  8:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-12  8:03 [PATCHSET] 0/7 IO scheduler abstractions Jens Axboe
2006-07-12  8:04 ` [PATCH 1/7] elevator: move the backmerging logic into the elevator core Jens Axboe
2006-07-12  8:04 ` [PATCH 2/7] rbtree: fixed reversed RB_EMPTY_NODE and rb_next/prev Jens Axboe
2006-07-12  8:04 ` [PATCH 3/7] elevator: abstract out the rbtree sort handling Jens Axboe
2006-07-12  8:05 ` Jens Axboe [this message]
2006-07-12  8:05 ` [PATCH 5/7] deadline-iosched: remove elevator private drq request type Jens Axboe
2006-07-12  8:06 ` [PATCH 6/7] cfq-iosched: convert to using the FIFO elevator defines Jens Axboe
2006-07-12  8:06 ` [PATCH 7/7] as-iosched: reuse rq for fifo Jens Axboe

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=20060712080519.GE13920@suse.de \
    --to=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    /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