linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC/PATCH v2 1/2] block:row: Adding support for reinsert already dispatched req
@ 2012-11-01 12:41 tlinder
  0 siblings, 0 replies; only message in thread
From: tlinder @ 2012-11-01 12:41 UTC (permalink / raw)
  To: linux-mmc
  Cc: linux-arm-msm, philippedeswert, jengelh, jh80.chung, tgih.jun,
	arnd.bergmann, Tatyana Brokhman, open list

From: Tatyana Brokhman <tlinder@codeaurora.org>

Add support for reinserting already dispatched request back to the
schedulers internal data structures.
The request will be reinserted back to the queue (head) it was
dispatched from as if it was never dispatched.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>

diff --git a/block/row-iosched.c b/block/row-iosched.c
index b7965c6..62789a4 100644
--- a/block/row-iosched.c
+++ b/block/row-iosched.c
@@ -273,6 +273,33 @@ static void row_add_request(struct request_queue *q,
 }
 
 /*
+ * row_reinsert_req() - Reinsert request back to the scheduler
+ * @q:	dispatch queue
+ * @rq:	request to add
+ *
+ * Reinsert the given request back to the queue it was
+ * dispatched from as if it was never dispatched.
+ *
+ * Returns 0 on success, error code otherwise
+ */
+static int row_reinsert_req(struct request_queue *q,
+			    struct request *rq)
+{
+	struct row_data    *rd = q->elevator->elevator_data;
+	struct row_queue   *rqueue = RQ_ROWQ(rq);
+
+	/* Verify rqueue is legitimate */
+	BUG_ON(rqueue != &rd->row_queues[rqueue->prio].rqueue);
+
+	list_add(&rq->queuelist, &rqueue->fifo);
+	rd->nr_reqs[rq_data_dir(rq)]++;
+
+	row_log_rowq(rd, rqueue->prio, "request reinserted");
+
+	return 0;
+}
+
+/**
  * row_remove_request() -  Remove given request from scheduler
  * @q:	requests queue
  * @rq:	request to remove
@@ -656,6 +683,7 @@ static struct elevator_type iosched_row = {
 		.elevator_merge_req_fn		= row_merged_requests,
 		.elevator_dispatch_fn		= row_dispatch_requests,
 		.elevator_add_req_fn		= row_add_request,
+		.elevator_reinsert_req_fn	= row_reinsert_req,
 		.elevator_former_req_fn		= elv_rb_former_request,
 		.elevator_latter_req_fn		= elv_rb_latter_request,
 		.elevator_set_req_fn		= row_set_request,
-- 
1.7.6
--
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. 
Is a member of Code Aurora Forum, hosted by the Linux Foundation


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-11-01 12:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-01 12:41 [RFC/PATCH v2 1/2] block:row: Adding support for reinsert already dispatched req tlinder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).