* [PATCH v3 0/2] block:row: Adding support for urgent requests handling @ 2012-12-11 13:43 Tanya Brokhman 2012-12-11 13:43 ` Tanya Brokhman 2012-12-11 13:43 ` Tanya Brokhman 0 siblings, 2 replies; 5+ messages in thread From: Tanya Brokhman @ 2012-12-11 13:43 UTC (permalink / raw) To: jaxboe Cc: linux-arm-msm, philippedeswert, jengelh, jh80.chung, tgih.jun, arnd.bergmann, venkat, linux-mmc, Tanya Brokhman This patch set add support for handling urgent requests by the ROW algorith. It depends on 2 previosly uploaded patch sets: 1. ROW scheduling Algorithm 2. Adding support for urgent requests handling (in block layer) Tanya Brokhman (2): row: Adding support for reinsert already dispatched req row: Add support for urgent request handling block/row-iosched.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 75 insertions(+), 1 deletions(-) -- 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 [flat|nested] 5+ messages in thread
* [PATCH v3 1/2] row: Adding support for reinsert already dispatched req 2012-12-11 13:43 [PATCH v3 0/2] block:row: Adding support for urgent requests handling Tanya Brokhman @ 2012-12-11 13:43 ` Tanya Brokhman 2012-12-11 13:43 ` Tanya Brokhman 1 sibling, 0 replies; 5+ messages in thread From: Tanya Brokhman @ 2012-12-11 13:43 UTC (permalink / raw) To: jaxboe Cc: linux-arm-msm, philippedeswert, jengelh, jh80.chung, tgih.jun, arnd.bergmann, venkat, linux-mmc, Tanya Brokhman, open list 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> --- v3: Update error handling when row queue is not set for a request v2: Nothing changed. Resend v1: Initial version diff --git a/block/row-iosched.c b/block/row-iosched.c index 1f50180..b3204d6 100644 --- a/block/row-iosched.c +++ b/block/row-iosched.c @@ -274,7 +274,39 @@ static void row_add_request(struct request_queue *q, row_log_rowq(rd, rqueue->prio, "added request"); } -/* +/** + * row_reinsert_req() - Reinsert request back to the scheduler + * @q: requests 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 */ + if (rqueue->prio >= ROWQ_MAX_PRIO) { + pr_err("\n\nROW BUG: row_reinsert_req() rqueue->prio = %d\n", + rqueue->prio); + blk_dump_rq_flags(rq, ""); + return -EIO; + } + + 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 @@ -664,6 +696,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] 5+ messages in thread
* [PATCH v3 1/2] row: Adding support for reinsert already dispatched req @ 2012-12-11 13:43 ` Tanya Brokhman 0 siblings, 0 replies; 5+ messages in thread From: Tanya Brokhman @ 2012-12-11 13:43 UTC (permalink / raw) To: jaxboe Cc: linux-arm-msm, philippedeswert, jengelh, jh80.chung, tgih.jun, arnd.bergmann, venkat, linux-mmc, Tanya Brokhman, open list 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> --- v3: Update error handling when row queue is not set for a request v2: Nothing changed. Resend v1: Initial version diff --git a/block/row-iosched.c b/block/row-iosched.c index 1f50180..b3204d6 100644 --- a/block/row-iosched.c +++ b/block/row-iosched.c @@ -274,7 +274,39 @@ static void row_add_request(struct request_queue *q, row_log_rowq(rd, rqueue->prio, "added request"); } -/* +/** + * row_reinsert_req() - Reinsert request back to the scheduler + * @q: requests 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 */ + if (rqueue->prio >= ROWQ_MAX_PRIO) { + pr_err("\n\nROW BUG: row_reinsert_req() rqueue->prio = %d\n", + rqueue->prio); + blk_dump_rq_flags(rq, ""); + return -EIO; + } + + 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 @@ -664,6 +696,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] 5+ messages in thread
* [PATCH/RESEND v3 2/2] row: Add support for urgent request handling 2012-12-11 13:43 [PATCH v3 0/2] block:row: Adding support for urgent requests handling Tanya Brokhman @ 2012-12-11 13:43 ` Tanya Brokhman 2012-12-11 13:43 ` Tanya Brokhman 1 sibling, 0 replies; 5+ messages in thread From: Tanya Brokhman @ 2012-12-11 13:43 UTC (permalink / raw) To: jaxboe Cc: linux-arm-msm, philippedeswert, jengelh, jh80.chung, tgih.jun, arnd.bergmann, venkat, linux-mmc, Tanya Brokhman, open list This patch add support for handling urgent requests. ROW queue can be marked as "urgent". If an urgent queue was un-served in a previous dispatch cycle and a request was added to it - it will trigger issuing urgent request to the device driver. Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org> diff --git a/block/row-iosched.c b/block/row-iosched.c index b3204d6..41cc028 100644 --- a/block/row-iosched.c +++ b/block/row-iosched.c @@ -58,6 +58,17 @@ static const bool queue_idling_enabled[] = { false, /* ROWQ_PRIO_LOW_SWRITE */ }; +/* Flags indicating whether the queue can notify on urgent requests */ +static const bool urgent_queues[] = { + true, /* ROWQ_PRIO_HIGH_READ */ + true, /* ROWQ_PRIO_REG_READ */ + false, /* ROWQ_PRIO_HIGH_SWRITE */ + false, /* ROWQ_PRIO_REG_SWRITE */ + false, /* ROWQ_PRIO_REG_WRITE */ + false, /* ROWQ_PRIO_LOW_READ */ + false, /* ROWQ_PRIO_LOW_SWRITE */ +}; + /* Default values for row queues quantums in each dispatch cycle */ static const int queue_quantum[] = { 100, /* ROWQ_PRIO_HIGH_READ */ @@ -271,7 +282,13 @@ static void row_add_request(struct request_queue *q, rqueue->idle_data.last_insert_time = ktime_get(); } - row_log_rowq(rd, rqueue->prio, "added request"); + if (urgent_queues[rqueue->prio] && + row_rowq_unserved(rd, rqueue->prio)) { + row_log_rowq(rd, rqueue->prio, + "added urgent req curr_queue = %d", + rd->curr_queue); + } else + row_log_rowq(rd, rqueue->prio, "added request"); } /** @@ -306,6 +323,29 @@ static int row_reinsert_req(struct request_queue *q, return 0; } +/* + * row_urgent_pending() - Return TRUE if there is an urgent + * request on scheduler + * @q: requests queue + * + */ +static bool row_urgent_pending(struct request_queue *q) +{ + struct row_data *rd = q->elevator->elevator_data; + int i; + + for (i = 0; i < ROWQ_MAX_PRIO; i++) + if (urgent_queues[i] && row_rowq_unserved(rd, i) && + !list_empty(&rd->row_queues[i].rqueue.fifo)) { + row_log_rowq(rd, i, + "Urgent request pending (curr=%i)", + rd->curr_queue); + return true; + } + + return false; +} + /** * row_remove_request() - Remove given request from scheduler * @q: requests queue @@ -697,6 +737,7 @@ static struct elevator_type iosched_row = { .elevator_dispatch_fn = row_dispatch_requests, .elevator_add_req_fn = row_add_request, .elevator_reinsert_req_fn = row_reinsert_req, + .elevator_is_urgent_fn = row_urgent_pending, .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] 5+ messages in thread
* [PATCH/RESEND v3 2/2] row: Add support for urgent request handling @ 2012-12-11 13:43 ` Tanya Brokhman 0 siblings, 0 replies; 5+ messages in thread From: Tanya Brokhman @ 2012-12-11 13:43 UTC (permalink / raw) To: jaxboe Cc: linux-arm-msm, philippedeswert, jengelh, jh80.chung, tgih.jun, arnd.bergmann, venkat, linux-mmc, Tanya Brokhman, open list This patch add support for handling urgent requests. ROW queue can be marked as "urgent". If an urgent queue was un-served in a previous dispatch cycle and a request was added to it - it will trigger issuing urgent request to the device driver. Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org> diff --git a/block/row-iosched.c b/block/row-iosched.c index b3204d6..41cc028 100644 --- a/block/row-iosched.c +++ b/block/row-iosched.c @@ -58,6 +58,17 @@ static const bool queue_idling_enabled[] = { false, /* ROWQ_PRIO_LOW_SWRITE */ }; +/* Flags indicating whether the queue can notify on urgent requests */ +static const bool urgent_queues[] = { + true, /* ROWQ_PRIO_HIGH_READ */ + true, /* ROWQ_PRIO_REG_READ */ + false, /* ROWQ_PRIO_HIGH_SWRITE */ + false, /* ROWQ_PRIO_REG_SWRITE */ + false, /* ROWQ_PRIO_REG_WRITE */ + false, /* ROWQ_PRIO_LOW_READ */ + false, /* ROWQ_PRIO_LOW_SWRITE */ +}; + /* Default values for row queues quantums in each dispatch cycle */ static const int queue_quantum[] = { 100, /* ROWQ_PRIO_HIGH_READ */ @@ -271,7 +282,13 @@ static void row_add_request(struct request_queue *q, rqueue->idle_data.last_insert_time = ktime_get(); } - row_log_rowq(rd, rqueue->prio, "added request"); + if (urgent_queues[rqueue->prio] && + row_rowq_unserved(rd, rqueue->prio)) { + row_log_rowq(rd, rqueue->prio, + "added urgent req curr_queue = %d", + rd->curr_queue); + } else + row_log_rowq(rd, rqueue->prio, "added request"); } /** @@ -306,6 +323,29 @@ static int row_reinsert_req(struct request_queue *q, return 0; } +/* + * row_urgent_pending() - Return TRUE if there is an urgent + * request on scheduler + * @q: requests queue + * + */ +static bool row_urgent_pending(struct request_queue *q) +{ + struct row_data *rd = q->elevator->elevator_data; + int i; + + for (i = 0; i < ROWQ_MAX_PRIO; i++) + if (urgent_queues[i] && row_rowq_unserved(rd, i) && + !list_empty(&rd->row_queues[i].rqueue.fifo)) { + row_log_rowq(rd, i, + "Urgent request pending (curr=%i)", + rd->curr_queue); + return true; + } + + return false; +} + /** * row_remove_request() - Remove given request from scheduler * @q: requests queue @@ -697,6 +737,7 @@ static struct elevator_type iosched_row = { .elevator_dispatch_fn = row_dispatch_requests, .elevator_add_req_fn = row_add_request, .elevator_reinsert_req_fn = row_reinsert_req, + .elevator_is_urgent_fn = row_urgent_pending, .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] 5+ messages in thread
end of thread, other threads:[~2012-12-11 13:43 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-12-11 13:43 [PATCH v3 0/2] block:row: Adding support for urgent requests handling Tanya Brokhman 2012-12-11 13:43 ` [PATCH v3 1/2] row: Adding support for reinsert already dispatched req Tanya Brokhman 2012-12-11 13:43 ` Tanya Brokhman 2012-12-11 13:43 ` [PATCH/RESEND v3 2/2] row: Add support for urgent request handling Tanya Brokhman 2012-12-11 13:43 ` Tanya Brokhman
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.