blob: fd2217b8e7d1078880a4415f3be3ed32b9a1860d [file] [log] [blame]
Tatyana Brokhman16349062012-09-20 10:46:10 +03001/*
2 * ROW (Read Over Write) I/O scheduler.
3 *
Tatyana Brokhmanbd56be32013-01-13 22:04:59 +02004 * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
Tatyana Brokhman16349062012-09-20 10:46:10 +03005 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 and
8 * only version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16/* See Documentation/block/row-iosched.txt */
17
18#include <linux/kernel.h>
19#include <linux/fs.h>
20#include <linux/blkdev.h>
21#include <linux/elevator.h>
22#include <linux/bio.h>
23#include <linux/module.h>
24#include <linux/slab.h>
25#include <linux/init.h>
26#include <linux/compiler.h>
27#include <linux/blktrace_api.h>
28#include <linux/jiffies.h>
29
30/*
31 * enum row_queue_prio - Priorities of the ROW queues
32 *
33 * This enum defines the priorities (and the number of queues)
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +020034 * the requests will be distributed to. The higher priority -
35 * the bigger is the "bus time" (or the dispatch quantum) given
36 * to that queue.
Tatyana Brokhman16349062012-09-20 10:46:10 +030037 * ROWQ_PRIO_HIGH_READ - is the higher priority queue.
38 *
39 */
40enum row_queue_prio {
41 ROWQ_PRIO_HIGH_READ = 0,
Tatyana Brokhman16349062012-09-20 10:46:10 +030042 ROWQ_PRIO_HIGH_SWRITE,
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +020043 ROWQ_PRIO_REG_READ,
Tatyana Brokhman16349062012-09-20 10:46:10 +030044 ROWQ_PRIO_REG_SWRITE,
45 ROWQ_PRIO_REG_WRITE,
46 ROWQ_PRIO_LOW_READ,
47 ROWQ_PRIO_LOW_SWRITE,
48 ROWQ_MAX_PRIO,
49};
50
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +020051/*
52 * The following indexes define the distribution of ROW queues according to
53 * priorities. Each index defines the first queue in that priority group.
54 */
55#define ROWQ_HIGH_PRIO_IDX ROWQ_PRIO_HIGH_READ
56#define ROWQ_REG_PRIO_IDX ROWQ_PRIO_REG_READ
57#define ROWQ_LOW_PRIO_IDX ROWQ_PRIO_LOW_READ
58
Tatyana Brokhman9375bcc2013-01-12 16:23:18 +020059/**
60 * struct row_queue_params - ROW queue parameters
61 * @idling_enabled: Flag indicating whether idling is enable on
62 * the queue
63 * @quantum: Number of requests to be dispatched from this queue
64 * in a dispatch cycle
65 * @is_urgent: Flags indicating whether the queue can notify on
66 * urgent requests
67 *
68 */
69struct row_queue_params {
70 bool idling_enabled;
71 int quantum;
72 bool is_urgent;
Tatyana Brokhman16349062012-09-20 10:46:10 +030073};
74
Tatyana Brokhman9375bcc2013-01-12 16:23:18 +020075/*
76 * This array holds the default values of the different configurables
77 * for each ROW queue. Each row of the array holds the following values:
78 * {idling_enabled, quantum, is_urgent}
79 * Each row corresponds to a queue with the same index (according to
80 * enum row_queue_prio)
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +020081 * Note: The quantums are valid inside their priority type. For example:
82 * For every 10 high priority read requests, 1 high priority sync
83 * write will be dispatched.
84 * For every 100 regular read requests 1 regular write request will
85 * be dispatched.
Tatyana Brokhman9375bcc2013-01-12 16:23:18 +020086 */
87static const struct row_queue_params row_queues_def[] = {
88/* idling_enabled, quantum, is_urgent */
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +020089 {true, 10, true}, /* ROWQ_PRIO_HIGH_READ */
90 {false, 1, true}, /* ROWQ_PRIO_HIGH_SWRITE */
Tatyana Brokhman9375bcc2013-01-12 16:23:18 +020091 {true, 100, true}, /* ROWQ_PRIO_REG_READ */
Tatyana Brokhman9375bcc2013-01-12 16:23:18 +020092 {false, 1, false}, /* ROWQ_PRIO_REG_SWRITE */
93 {false, 1, false}, /* ROWQ_PRIO_REG_WRITE */
94 {false, 1, false}, /* ROWQ_PRIO_LOW_READ */
95 {false, 1, false} /* ROWQ_PRIO_LOW_SWRITE */
Tatyana Brokhman16349062012-09-20 10:46:10 +030096};
97
Tatyana Brokhmanbfb04f62012-12-06 13:17:19 +020098/* Default values for idling on read queues (in msec) */
99#define ROW_IDLE_TIME_MSEC 5
100#define ROW_READ_FREQ_MSEC 20
Tatyana Brokhman16349062012-09-20 10:46:10 +0300101
102/**
103 * struct rowq_idling_data - parameters for idling on the queue
Tatyana Brokhmanbfb04f62012-12-06 13:17:19 +0200104 * @last_insert_time: time the last request was inserted
105 * to the queue
Tatyana Brokhman16349062012-09-20 10:46:10 +0300106 * @begin_idling: flag indicating wether we should idle
107 *
108 */
109struct rowq_idling_data {
Tatyana Brokhmanbfb04f62012-12-06 13:17:19 +0200110 ktime_t last_insert_time;
Tatyana Brokhman16349062012-09-20 10:46:10 +0300111 bool begin_idling;
112};
113
114/**
115 * struct row_queue - requests grouping structure
116 * @rdata: parent row_data structure
117 * @fifo: fifo of requests
118 * @prio: queue priority (enum row_queue_prio)
119 * @nr_dispatched: number of requests already dispatched in
120 * the current dispatch cycle
Tatyana Brokhmanbd56be32013-01-13 22:04:59 +0200121 * @nr_req: number of requests in queue
Tatyana Brokhman8a970bc2013-01-12 16:21:12 +0200122 * @dispatch quantum: number of requests this queue may
123 * dispatch in a dispatch cycle
Tatyana Brokhman16349062012-09-20 10:46:10 +0300124 * @idle_data: data for idling on queues
125 *
126 */
127struct row_queue {
128 struct row_data *rdata;
129 struct list_head fifo;
130 enum row_queue_prio prio;
131
132 unsigned int nr_dispatched;
Tatyana Brokhman16349062012-09-20 10:46:10 +0300133
Tatyana Brokhmanbd56be32013-01-13 22:04:59 +0200134 unsigned int nr_req;
Tatyana Brokhman8a970bc2013-01-12 16:21:12 +0200135 int disp_quantum;
Tatyana Brokhmanbd56be32013-01-13 22:04:59 +0200136
Tatyana Brokhman16349062012-09-20 10:46:10 +0300137 /* used only for READ queues */
138 struct rowq_idling_data idle_data;
139};
140
141/**
142 * struct idling_data - data for idling on empty rqueue
Tatyana Brokhmanbfb04f62012-12-06 13:17:19 +0200143 * @idle_time: idling duration (jiffies)
Tatyana Brokhman16349062012-09-20 10:46:10 +0300144 * @freq: min time between two requests that
145 * triger idling (msec)
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200146 * @idle_wq: work queue to add the idling task to
Tatyana Brokhman16349062012-09-20 10:46:10 +0300147 * @idle_work: pointer to struct delayed_work
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200148 * @idling_queue_idx: index of the queues we're idling on
Tatyana Brokhman16349062012-09-20 10:46:10 +0300149 *
150 */
151struct idling_data {
152 unsigned long idle_time;
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200153 s64 freq;
Tatyana Brokhman16349062012-09-20 10:46:10 +0300154
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200155 struct workqueue_struct *idle_wq;
Tatyana Brokhman16349062012-09-20 10:46:10 +0300156 struct delayed_work idle_work;
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200157 enum row_queue_prio idling_queue_idx;
Tatyana Brokhman16349062012-09-20 10:46:10 +0300158};
159
160/**
161 * struct row_queue - Per block device rqueue structure
162 * @dispatch_queue: dispatch rqueue
Tatyana Brokhman8a970bc2013-01-12 16:21:12 +0200163 * @row_queues: array of priority request queues
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200164 * @rd_idle_data: data for idling after READ request
Tatyana Brokhman16349062012-09-20 10:46:10 +0300165 * @nr_reqs: nr_reqs[0] holds the number of all READ requests in
166 * scheduler, nr_reqs[1] holds the number of all WRITE
167 * requests in scheduler
168 * @cycle_flags: used for marking unserved queueus
169 *
170 */
171struct row_data {
172 struct request_queue *dispatch_queue;
173
Tatyana Brokhman8a970bc2013-01-12 16:21:12 +0200174 struct row_queue row_queues[ROWQ_MAX_PRIO];
Tatyana Brokhman16349062012-09-20 10:46:10 +0300175
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200176 struct idling_data rd_idle_data;
Tatyana Brokhman16349062012-09-20 10:46:10 +0300177 unsigned int nr_reqs[2];
178
179 unsigned int cycle_flags;
180};
181
182#define RQ_ROWQ(rq) ((struct row_queue *) ((rq)->elv.priv[0]))
183
184#define row_log(q, fmt, args...) \
185 blk_add_trace_msg(q, "%s():" fmt , __func__, ##args)
186#define row_log_rowq(rdata, rowq_id, fmt, args...) \
187 blk_add_trace_msg(rdata->dispatch_queue, "rowq%d " fmt, \
188 rowq_id, ##args)
189
190static inline void row_mark_rowq_unserved(struct row_data *rd,
191 enum row_queue_prio qnum)
192{
193 rd->cycle_flags |= (1 << qnum);
194}
195
196static inline void row_clear_rowq_unserved(struct row_data *rd,
197 enum row_queue_prio qnum)
198{
199 rd->cycle_flags &= ~(1 << qnum);
200}
201
202static inline int row_rowq_unserved(struct row_data *rd,
203 enum row_queue_prio qnum)
204{
205 return rd->cycle_flags & (1 << qnum);
206}
207
Tatyana Brokhmanbd56be32013-01-13 22:04:59 +0200208static inline void __maybe_unused row_dump_queues_stat(struct row_data *rd)
209{
210 int i;
211
Tatyana Brokhman8a970bc2013-01-12 16:21:12 +0200212 row_log(rd->dispatch_queue, " Queues status:");
Tatyana Brokhmanbd56be32013-01-13 22:04:59 +0200213 for (i = 0; i < ROWQ_MAX_PRIO; i++)
214 row_log(rd->dispatch_queue,
215 "queue%d: dispatched= %d, nr_req=%d", i,
216 rd->row_queues[i].nr_dispatched,
217 rd->row_queues[i].nr_req);
218}
219
Tatyana Brokhman16349062012-09-20 10:46:10 +0300220/******************** Static helper functions ***********************/
221/*
222 * kick_queue() - Wake up device driver queue thread
223 * @work: pointer to struct work_struct
224 *
225 * This is a idling delayed work function. It's purpose is to wake up the
226 * device driver in order for it to start fetching requests.
227 *
228 */
229static void kick_queue(struct work_struct *work)
230{
231 struct delayed_work *idle_work = to_delayed_work(work);
232 struct idling_data *read_data =
233 container_of(idle_work, struct idling_data, idle_work);
234 struct row_data *rd =
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200235 container_of(read_data, struct row_data, rd_idle_data);
Tatyana Brokhman16349062012-09-20 10:46:10 +0300236
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200237 row_log_rowq(rd, rd->rd_idle_data.idling_queue_idx,
238 "Performing delayed work");
Tatyana Brokhman16349062012-09-20 10:46:10 +0300239 /* Mark idling process as done */
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200240 rd->row_queues[rd->rd_idle_data.idling_queue_idx].
241 idle_data.begin_idling = false;
242 rd->rd_idle_data.idling_queue_idx = ROWQ_MAX_PRIO;
Tatyana Brokhman16349062012-09-20 10:46:10 +0300243
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200244 if (!rd->nr_reqs[READ] && !rd->nr_reqs[WRITE])
Tatyana Brokhman16349062012-09-20 10:46:10 +0300245 row_log(rd->dispatch_queue, "No requests in scheduler");
246 else {
247 spin_lock_irq(rd->dispatch_queue->queue_lock);
248 __blk_run_queue(rd->dispatch_queue);
249 spin_unlock_irq(rd->dispatch_queue->queue_lock);
250 }
251}
252
Tatyana Brokhman16349062012-09-20 10:46:10 +0300253/******************* Elevator callback functions *********************/
254
255/*
256 * row_add_request() - Add request to the scheduler
257 * @q: requests queue
258 * @rq: request to add
259 *
260 */
261static void row_add_request(struct request_queue *q,
262 struct request *rq)
263{
264 struct row_data *rd = (struct row_data *)q->elevator->elevator_data;
265 struct row_queue *rqueue = RQ_ROWQ(rq);
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200266 s64 diff_ms;
Tatyana Brokhman16349062012-09-20 10:46:10 +0300267
268 list_add_tail(&rq->queuelist, &rqueue->fifo);
269 rd->nr_reqs[rq_data_dir(rq)]++;
Tatyana Brokhmanbd56be32013-01-13 22:04:59 +0200270 rqueue->nr_req++;
Tatyana Brokhman16349062012-09-20 10:46:10 +0300271 rq_set_fifo_time(rq, jiffies); /* for statistics*/
272
Tatyana Brokhman9375bcc2013-01-12 16:23:18 +0200273 if (row_queues_def[rqueue->prio].idling_enabled) {
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200274 if (rd->rd_idle_data.idling_queue_idx == rqueue->prio &&
275 delayed_work_pending(&rd->rd_idle_data.idle_work)) {
Tatyana Brokhman16349062012-09-20 10:46:10 +0300276 (void)cancel_delayed_work(
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200277 &rd->rd_idle_data.idle_work);
278 row_log_rowq(rd, rqueue->prio,
279 "Canceled delayed work on %d",
280 rd->rd_idle_data.idling_queue_idx);
281 rd->rd_idle_data.idling_queue_idx = ROWQ_MAX_PRIO;
282 }
283 diff_ms = ktime_to_ms(ktime_sub(ktime_get(),
284 rqueue->idle_data.last_insert_time));
285 if (unlikely(diff_ms < 0)) {
286 pr_err("ROW BUG: %s diff_ms < 0", __func__);
287 rqueue->idle_data.begin_idling = false;
288 return;
289 }
290 if (diff_ms < rd->rd_idle_data.freq) {
Tatyana Brokhman16349062012-09-20 10:46:10 +0300291 rqueue->idle_data.begin_idling = true;
292 row_log_rowq(rd, rqueue->prio, "Enable idling");
Tatyana Brokhmanbfb04f62012-12-06 13:17:19 +0200293 } else {
Tatyana Brokhman16349062012-09-20 10:46:10 +0300294 rqueue->idle_data.begin_idling = false;
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200295 row_log_rowq(rd, rqueue->prio, "Disable idling (%ldms)",
296 (long)diff_ms);
Tatyana Brokhmanbfb04f62012-12-06 13:17:19 +0200297 }
Tatyana Brokhman16349062012-09-20 10:46:10 +0300298
Tatyana Brokhmanbfb04f62012-12-06 13:17:19 +0200299 rqueue->idle_data.last_insert_time = ktime_get();
Tatyana Brokhman16349062012-09-20 10:46:10 +0300300 }
Tatyana Brokhman9375bcc2013-01-12 16:23:18 +0200301 if (row_queues_def[rqueue->prio].is_urgent &&
Tatyana Brokhman0ef81432012-12-20 19:23:58 +0200302 row_rowq_unserved(rd, rqueue->prio)) {
303 row_log_rowq(rd, rqueue->prio,
Tatyana Brokhmanbd56be32013-01-13 22:04:59 +0200304 "added urgent request (total on queue=%d)",
305 rqueue->nr_req);
Tatyana Brokhman0ef81432012-12-20 19:23:58 +0200306 } else
Tatyana Brokhmanbd56be32013-01-13 22:04:59 +0200307 row_log_rowq(rd, rqueue->prio,
308 "added request (total on queue=%d)", rqueue->nr_req);
Tatyana Brokhman16349062012-09-20 10:46:10 +0300309}
310
Tatyana Brokhmanb7bf9ac2012-10-30 08:33:06 +0200311/**
312 * row_reinsert_req() - Reinsert request back to the scheduler
313 * @q: requests queue
314 * @rq: request to add
315 *
316 * Reinsert the given request back to the queue it was
317 * dispatched from as if it was never dispatched.
318 *
319 * Returns 0 on success, error code otherwise
320 */
321static int row_reinsert_req(struct request_queue *q,
322 struct request *rq)
323{
324 struct row_data *rd = q->elevator->elevator_data;
325 struct row_queue *rqueue = RQ_ROWQ(rq);
326
Tatyana Brokhmanb7bf9ac2012-10-30 08:33:06 +0200327 if (rqueue->prio >= ROWQ_MAX_PRIO) {
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200328 pr_err("\n\n%s:ROW BUG: row_reinsert_req() rqueue->prio = %d\n",
329 rq->rq_disk->disk_name, rqueue->prio);
Tatyana Brokhmanb7bf9ac2012-10-30 08:33:06 +0200330 blk_dump_rq_flags(rq, "");
331 return -EIO;
332 }
333
334 list_add(&rq->queuelist, &rqueue->fifo);
335 rd->nr_reqs[rq_data_dir(rq)]++;
Tatyana Brokhmanbd56be32013-01-13 22:04:59 +0200336 rqueue->nr_req++;
Tatyana Brokhmanb7bf9ac2012-10-30 08:33:06 +0200337
Tatyana Brokhmanbd56be32013-01-13 22:04:59 +0200338 row_log_rowq(rd, rqueue->prio,
339 "request reinserted (total on queue=%d)", rqueue->nr_req);
Tatyana Brokhmanb7bf9ac2012-10-30 08:33:06 +0200340
341 return 0;
342}
343
344/**
Tatyana Brokhman0ef81432012-12-20 19:23:58 +0200345 * row_urgent_pending() - Return TRUE if there is an urgent
346 * request on scheduler
347 * @q: requests queue
348 */
349static bool row_urgent_pending(struct request_queue *q)
350{
351 struct row_data *rd = q->elevator->elevator_data;
352 int i;
353
354 for (i = 0; i < ROWQ_MAX_PRIO; i++)
Tatyana Brokhman9375bcc2013-01-12 16:23:18 +0200355 if (row_queues_def[i].is_urgent && row_rowq_unserved(rd, i) &&
Tatyana Brokhman8a970bc2013-01-12 16:21:12 +0200356 !list_empty(&rd->row_queues[i].fifo)) {
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200357 row_log_rowq(rd, i, "Urgent request pending");
Tatyana Brokhman0ef81432012-12-20 19:23:58 +0200358 return true;
359 }
360
361 return false;
362}
363
364/**
Tatyana Brokhman16349062012-09-20 10:46:10 +0300365 * row_remove_request() - Remove given request from scheduler
366 * @q: requests queue
367 * @rq: request to remove
368 *
369 */
370static void row_remove_request(struct request_queue *q,
371 struct request *rq)
372{
373 struct row_data *rd = (struct row_data *)q->elevator->elevator_data;
Tatyana Brokhmanbd56be32013-01-13 22:04:59 +0200374 struct row_queue *rqueue = RQ_ROWQ(rq);
Tatyana Brokhman16349062012-09-20 10:46:10 +0300375
376 rq_fifo_clear(rq);
Tatyana Brokhmanbd56be32013-01-13 22:04:59 +0200377 rqueue->nr_req--;
Tatyana Brokhman16349062012-09-20 10:46:10 +0300378 rd->nr_reqs[rq_data_dir(rq)]--;
379}
380
381/*
382 * row_dispatch_insert() - move request to dispatch queue
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200383 * @rd: pointer to struct row_data
384 * @queue_idx: index of the row_queue to dispatch from
Tatyana Brokhman16349062012-09-20 10:46:10 +0300385 *
386 * This function moves the next request to dispatch from
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200387 * the given queue (row_queues[queue_idx]) to the dispatch queue
Tatyana Brokhman16349062012-09-20 10:46:10 +0300388 *
389 */
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200390static void row_dispatch_insert(struct row_data *rd, int queue_idx)
Tatyana Brokhman16349062012-09-20 10:46:10 +0300391{
392 struct request *rq;
393
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200394 rq = rq_entry_fifo(rd->row_queues[queue_idx].fifo.next);
Tatyana Brokhman16349062012-09-20 10:46:10 +0300395 row_remove_request(rd->dispatch_queue, rq);
396 elv_dispatch_add_tail(rd->dispatch_queue, rq);
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200397 rd->row_queues[queue_idx].nr_dispatched++;
398 row_clear_rowq_unserved(rd, queue_idx);
399 row_log_rowq(rd, queue_idx, " Dispatched request nr_disp = %d",
400 rd->row_queues[queue_idx].nr_dispatched);
Tatyana Brokhman16349062012-09-20 10:46:10 +0300401}
402
403/*
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200404 * row_get_ioprio_class_to_serve() - Return the next I/O priority
405 * class to dispatch requests from
Tatyana Brokhman16349062012-09-20 10:46:10 +0300406 * @rd: pointer to struct row_data
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200407 * @force: flag indicating if forced dispatch
Tatyana Brokhman16349062012-09-20 10:46:10 +0300408 *
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200409 * This function returns the next I/O priority class to serve
410 * {IOPRIO_CLASS_NONE, IOPRIO_CLASS_RT, IOPRIO_CLASS_BE, IOPRIO_CLASS_IDLE}.
411 * If there are no more requests in scheduler or if we're idling on some queue
412 * IOPRIO_CLASS_NONE will be returned.
413 * If idling is scheduled on a lower priority queue than the one that needs
414 * to be served, it will be canceled.
Tatyana Brokhman16349062012-09-20 10:46:10 +0300415 *
416 */
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200417static int row_get_ioprio_class_to_serve(struct row_data *rd, int force)
Tatyana Brokhman16349062012-09-20 10:46:10 +0300418{
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200419 int i;
420 int ret = IOPRIO_CLASS_NONE;
Tatyana Brokhman16349062012-09-20 10:46:10 +0300421
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200422 if (!rd->nr_reqs[READ] && !rd->nr_reqs[WRITE]) {
Tatyana Brokhman16349062012-09-20 10:46:10 +0300423 row_log(rd->dispatch_queue, "No more requests in scheduler");
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200424 goto check_idling;
Tatyana Brokhman16349062012-09-20 10:46:10 +0300425 }
426
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200427 /* First, go over the high priority queues */
428 for (i = 0; i < ROWQ_REG_PRIO_IDX; i++) {
429 if (!list_empty(&rd->row_queues[i].fifo)) {
430 if (delayed_work_pending(&rd->rd_idle_data.idle_work)) {
431 (void)cancel_delayed_work(
432 &rd->rd_idle_data.idle_work);
433 row_log_rowq(rd,
434 rd->rd_idle_data.idling_queue_idx,
435 "Canceling delayed work on %d. RT pending",
436 rd->rd_idle_data.idling_queue_idx);
437 rd->rd_idle_data.idling_queue_idx =
438 ROWQ_MAX_PRIO;
439 }
440 ret = IOPRIO_CLASS_RT;
441 goto done;
442 }
443 }
Tatyana Brokhman16349062012-09-20 10:46:10 +0300444
445 /*
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200446 * At the moment idling is implemented only for READ queues.
447 * If enabled on WRITE, this needs updating
Tatyana Brokhman16349062012-09-20 10:46:10 +0300448 */
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200449 if (delayed_work_pending(&rd->rd_idle_data.idle_work)) {
450 row_log(rd->dispatch_queue, "Delayed work pending. Exiting");
451 goto done;
452 }
453check_idling:
454 /* Check for (high priority) idling and enable if needed */
455 for (i = 0; i < ROWQ_REG_PRIO_IDX && !force; i++) {
456 if (rd->row_queues[i].idle_data.begin_idling &&
457 row_queues_def[i].idling_enabled)
458 goto initiate_idling;
Tatyana Brokhman16349062012-09-20 10:46:10 +0300459 }
460
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200461 /* Regular priority queues */
462 for (i = ROWQ_REG_PRIO_IDX; i < ROWQ_LOW_PRIO_IDX; i++) {
463 if (list_empty(&rd->row_queues[i].fifo)) {
464 /* We can idle only if this is not a forced dispatch */
465 if (rd->row_queues[i].idle_data.begin_idling &&
466 !force && row_queues_def[i].idling_enabled)
467 goto initiate_idling;
468 } else {
469 ret = IOPRIO_CLASS_BE;
470 goto done;
471 }
472 }
473
474 if (rd->nr_reqs[READ] || rd->nr_reqs[WRITE])
475 ret = IOPRIO_CLASS_IDLE;
476 goto done;
477
478initiate_idling:
479 if (!queue_delayed_work(rd->rd_idle_data.idle_wq,
480 &rd->rd_idle_data.idle_work, rd->rd_idle_data.idle_time)) {
481 row_log(rd->dispatch_queue, "Work already on queue!");
482 pr_err("ROW_BUG: Work already on queue!");
483 } else {
484 rd->rd_idle_data.idling_queue_idx = i;
485 row_log_rowq(rd, i, "Scheduled delayed work on %d. exiting", i);
486 }
487done:
488 return ret;
489}
490
491static void row_restart_cycle(struct row_data *rd,
492 int start_idx, int end_idx)
493{
494 int i;
495
496 row_dump_queues_stat(rd);
497 for (i = start_idx; i < end_idx; i++) {
498 if (rd->row_queues[i].nr_dispatched <
499 rd->row_queues[i].disp_quantum)
500 row_mark_rowq_unserved(rd, i);
501 rd->row_queues[i].nr_dispatched = 0;
502 }
503 row_log(rd->dispatch_queue, "Restarting cycle for class @ %d-%d",
504 start_idx, end_idx);
505}
506
507/*
508 * row_get_next_queue() - selects the next queue to dispatch from
509 * @q: requests queue
510 * @rd: pointer to struct row_data
511 * @start_idx/end_idx: indexes in the row_queues array to select a queue
512 * from.
513 *
514 * Return index of the queues to dispatch from. Error code if fails.
515 *
516 */
517static int row_get_next_queue(struct request_queue *q, struct row_data *rd,
518 int start_idx, int end_idx)
519{
520 int i = start_idx;
521 bool restart = true;
522 int ret = -EIO;
523
524 do {
525 if (list_empty(&rd->row_queues[i].fifo) ||
526 rd->row_queues[i].nr_dispatched >=
527 rd->row_queues[i].disp_quantum) {
528 i++;
529 if (i == end_idx && restart) {
530 /* Restart cycle for this priority class */
531 row_restart_cycle(rd, start_idx, end_idx);
532 i = start_idx;
533 restart = false;
534 }
535 } else {
536 ret = i;
537 break;
538 }
539 } while (i < end_idx);
540
541 return ret;
Tatyana Brokhman16349062012-09-20 10:46:10 +0300542}
543
544/*
545 * row_dispatch_requests() - selects the next request to dispatch
546 * @q: requests queue
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200547 * @force: flag indicating if forced dispatch
Tatyana Brokhman16349062012-09-20 10:46:10 +0300548 *
549 * Return 0 if no requests were moved to the dispatch queue.
550 * 1 otherwise
551 *
552 */
553static int row_dispatch_requests(struct request_queue *q, int force)
554{
555 struct row_data *rd = (struct row_data *)q->elevator->elevator_data;
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200556 int ret = 0, currq, ioprio_class_to_serve, start_idx, end_idx;
Tatyana Brokhman16349062012-09-20 10:46:10 +0300557
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200558 if (force && delayed_work_pending(&rd->rd_idle_data.idle_work)) {
559 (void)cancel_delayed_work(&rd->rd_idle_data.idle_work);
560 row_log_rowq(rd, rd->rd_idle_data.idling_queue_idx,
561 "Canceled delayed work on %d - forced dispatch",
562 rd->rd_idle_data.idling_queue_idx);
563 rd->rd_idle_data.idling_queue_idx = ROWQ_MAX_PRIO;
Tatyana Brokhman16349062012-09-20 10:46:10 +0300564 }
565
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200566 ioprio_class_to_serve = row_get_ioprio_class_to_serve(rd, force);
567 row_log(rd->dispatch_queue, "Dispatching from %d priority class",
568 ioprio_class_to_serve);
569
570 switch (ioprio_class_to_serve) {
571 case IOPRIO_CLASS_NONE:
572 goto done;
573 case IOPRIO_CLASS_RT:
574 start_idx = ROWQ_HIGH_PRIO_IDX;
575 end_idx = ROWQ_REG_PRIO_IDX;
576 break;
577 case IOPRIO_CLASS_BE:
578 start_idx = ROWQ_REG_PRIO_IDX;
579 end_idx = ROWQ_LOW_PRIO_IDX;
580 break;
581 case IOPRIO_CLASS_IDLE:
582 start_idx = ROWQ_LOW_PRIO_IDX;
583 end_idx = ROWQ_MAX_PRIO;
584 break;
585 default:
586 pr_err("%s(): Invalid I/O priority class", __func__);
Tatyana Brokhman16349062012-09-20 10:46:10 +0300587 goto done;
588 }
589
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200590 currq = row_get_next_queue(q, rd, start_idx, end_idx);
Tatyana Brokhman16349062012-09-20 10:46:10 +0300591
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200592 /* Dispatch */
593 if (currq >= 0) {
594 row_dispatch_insert(rd, currq);
595 ret = 1;
Tatyana Brokhman16349062012-09-20 10:46:10 +0300596 }
Tatyana Brokhman16349062012-09-20 10:46:10 +0300597done:
598 return ret;
599}
600
601/*
602 * row_init_queue() - Init scheduler data structures
603 * @q: requests queue
604 *
605 * Return pointer to struct row_data to be saved in elevator for
606 * this dispatch queue
607 *
608 */
609static void *row_init_queue(struct request_queue *q)
610{
611
612 struct row_data *rdata;
613 int i;
614
615 rdata = kmalloc_node(sizeof(*rdata),
616 GFP_KERNEL | __GFP_ZERO, q->node);
617 if (!rdata)
618 return NULL;
619
620 for (i = 0; i < ROWQ_MAX_PRIO; i++) {
Tatyana Brokhman8a970bc2013-01-12 16:21:12 +0200621 INIT_LIST_HEAD(&rdata->row_queues[i].fifo);
Tatyana Brokhman9375bcc2013-01-12 16:23:18 +0200622 rdata->row_queues[i].disp_quantum = row_queues_def[i].quantum;
Tatyana Brokhman8a970bc2013-01-12 16:21:12 +0200623 rdata->row_queues[i].rdata = rdata;
624 rdata->row_queues[i].prio = i;
625 rdata->row_queues[i].idle_data.begin_idling = false;
626 rdata->row_queues[i].idle_data.last_insert_time =
Tatyana Brokhmanbfb04f62012-12-06 13:17:19 +0200627 ktime_set(0, 0);
Tatyana Brokhman16349062012-09-20 10:46:10 +0300628 }
629
630 /*
631 * Currently idling is enabled only for READ queues. If we want to
632 * enable it for write queues also, note that idling frequency will
633 * be the same in both cases
634 */
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200635 rdata->rd_idle_data.idle_time = msecs_to_jiffies(ROW_IDLE_TIME_MSEC);
Tatyana Brokhmanbfb04f62012-12-06 13:17:19 +0200636 /* Maybe 0 on some platforms */
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200637 if (!rdata->rd_idle_data.idle_time)
638 rdata->rd_idle_data.idle_time = 1;
639 rdata->rd_idle_data.freq = ROW_READ_FREQ_MSEC;
640 rdata->rd_idle_data.idle_wq = alloc_workqueue("row_idle_work",
Tatyana Brokhman16349062012-09-20 10:46:10 +0300641 WQ_MEM_RECLAIM | WQ_HIGHPRI, 0);
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200642 if (!rdata->rd_idle_data.idle_wq)
Tatyana Brokhman16349062012-09-20 10:46:10 +0300643 panic("Failed to create idle workqueue\n");
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200644 INIT_DELAYED_WORK(&rdata->rd_idle_data.idle_work, kick_queue);
Tatyana Brokhman16349062012-09-20 10:46:10 +0300645
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200646 rdata->rd_idle_data.idling_queue_idx = ROWQ_MAX_PRIO;
Tatyana Brokhman16349062012-09-20 10:46:10 +0300647 rdata->dispatch_queue = q;
648
649 rdata->nr_reqs[READ] = rdata->nr_reqs[WRITE] = 0;
650
651 return rdata;
652}
653
654/*
655 * row_exit_queue() - called on unloading the RAW scheduler
656 * @e: poiner to struct elevator_queue
657 *
658 */
659static void row_exit_queue(struct elevator_queue *e)
660{
661 struct row_data *rd = (struct row_data *)e->elevator_data;
662 int i;
663
664 for (i = 0; i < ROWQ_MAX_PRIO; i++)
Tatyana Brokhman8a970bc2013-01-12 16:21:12 +0200665 BUG_ON(!list_empty(&rd->row_queues[i].fifo));
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200666 (void)cancel_delayed_work_sync(&rd->rd_idle_data.idle_work);
667 rd->rd_idle_data.idling_queue_idx = ROWQ_MAX_PRIO;
668 BUG_ON(delayed_work_pending(&rd->rd_idle_data.idle_work));
669 destroy_workqueue(rd->rd_idle_data.idle_wq);
Tatyana Brokhman16349062012-09-20 10:46:10 +0300670 kfree(rd);
671}
672
673/*
674 * row_merged_requests() - Called when 2 requests are merged
675 * @q: requests queue
676 * @rq: request the two requests were merged into
677 * @next: request that was merged
678 */
679static void row_merged_requests(struct request_queue *q, struct request *rq,
680 struct request *next)
681{
682 struct row_queue *rqueue = RQ_ROWQ(next);
683
684 list_del_init(&next->queuelist);
Tatyana Brokhmanbd56be32013-01-13 22:04:59 +0200685 rqueue->nr_req--;
Tatyana Brokhman16349062012-09-20 10:46:10 +0300686
687 rqueue->rdata->nr_reqs[rq_data_dir(rq)]--;
688}
689
690/*
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200691 * row_get_queue_prio() - Get queue priority for a given request
Tatyana Brokhman16349062012-09-20 10:46:10 +0300692 *
693 * This is a helping function which purpose is to determine what
694 * ROW queue the given request should be added to (and
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200695 * dispatched from later on)
Tatyana Brokhman16349062012-09-20 10:46:10 +0300696 *
Tatyana Brokhman16349062012-09-20 10:46:10 +0300697 */
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200698static enum row_queue_prio row_get_queue_prio(struct request *rq)
Tatyana Brokhman16349062012-09-20 10:46:10 +0300699{
700 const int data_dir = rq_data_dir(rq);
701 const bool is_sync = rq_is_sync(rq);
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200702 enum row_queue_prio q_type = ROWQ_MAX_PRIO;
703 int ioprio_class = IOPRIO_PRIO_CLASS(rq->elv.icq->ioc->ioprio);
Tatyana Brokhman16349062012-09-20 10:46:10 +0300704
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200705 switch (ioprio_class) {
706 case IOPRIO_CLASS_RT:
707 if (data_dir == READ)
708 q_type = ROWQ_PRIO_HIGH_READ;
709 else if (is_sync)
710 q_type = ROWQ_PRIO_HIGH_SWRITE;
711 else {
712 pr_err("%s:%s(): got a simple write from RT_CLASS. How???",
713 rq->rq_disk->disk_name, __func__);
714 q_type = ROWQ_PRIO_REG_WRITE;
715 }
716 break;
717 case IOPRIO_CLASS_IDLE:
718 if (data_dir == READ)
719 q_type = ROWQ_PRIO_LOW_READ;
720 else if (is_sync)
721 q_type = ROWQ_PRIO_LOW_SWRITE;
722 else {
723 pr_err("%s:%s(): got a simple write from IDLE_CLASS. How???",
724 rq->rq_disk->disk_name, __func__);
725 q_type = ROWQ_PRIO_REG_WRITE;
726 }
727 break;
728 case IOPRIO_CLASS_NONE:
729 case IOPRIO_CLASS_BE:
730 default:
731 if (data_dir == READ)
732 q_type = ROWQ_PRIO_REG_READ;
733 else if (is_sync)
734 q_type = ROWQ_PRIO_REG_SWRITE;
735 else
736 q_type = ROWQ_PRIO_REG_WRITE;
737 break;
738 }
739
740 return q_type;
Tatyana Brokhman16349062012-09-20 10:46:10 +0300741}
742
743/*
744 * row_set_request() - Set ROW data structures associated with this request.
745 * @q: requests queue
746 * @rq: pointer to the request
747 * @gfp_mask: ignored
748 *
749 */
750static int
751row_set_request(struct request_queue *q, struct request *rq, gfp_t gfp_mask)
752{
753 struct row_data *rd = (struct row_data *)q->elevator->elevator_data;
754 unsigned long flags;
755
756 spin_lock_irqsave(q->queue_lock, flags);
757 rq->elv.priv[0] =
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200758 (void *)(&rd->row_queues[row_get_queue_prio(rq)]);
Tatyana Brokhman16349062012-09-20 10:46:10 +0300759 spin_unlock_irqrestore(q->queue_lock, flags);
760
761 return 0;
762}
763
764/********** Helping sysfs functions/defenitions for ROW attributes ******/
765static ssize_t row_var_show(int var, char *page)
766{
767 return snprintf(page, 100, "%d\n", var);
768}
769
770static ssize_t row_var_store(int *var, const char *page, size_t count)
771{
772 int err;
773 err = kstrtoul(page, 10, (unsigned long *)var);
774
775 return count;
776}
777
778#define SHOW_FUNCTION(__FUNC, __VAR, __CONV) \
779static ssize_t __FUNC(struct elevator_queue *e, char *page) \
780{ \
781 struct row_data *rowd = e->elevator_data; \
782 int __data = __VAR; \
783 if (__CONV) \
784 __data = jiffies_to_msecs(__data); \
785 return row_var_show(__data, (page)); \
786}
787SHOW_FUNCTION(row_hp_read_quantum_show,
788 rowd->row_queues[ROWQ_PRIO_HIGH_READ].disp_quantum, 0);
789SHOW_FUNCTION(row_rp_read_quantum_show,
790 rowd->row_queues[ROWQ_PRIO_REG_READ].disp_quantum, 0);
791SHOW_FUNCTION(row_hp_swrite_quantum_show,
792 rowd->row_queues[ROWQ_PRIO_HIGH_SWRITE].disp_quantum, 0);
793SHOW_FUNCTION(row_rp_swrite_quantum_show,
794 rowd->row_queues[ROWQ_PRIO_REG_SWRITE].disp_quantum, 0);
795SHOW_FUNCTION(row_rp_write_quantum_show,
796 rowd->row_queues[ROWQ_PRIO_REG_WRITE].disp_quantum, 0);
797SHOW_FUNCTION(row_lp_read_quantum_show,
798 rowd->row_queues[ROWQ_PRIO_LOW_READ].disp_quantum, 0);
799SHOW_FUNCTION(row_lp_swrite_quantum_show,
800 rowd->row_queues[ROWQ_PRIO_LOW_SWRITE].disp_quantum, 0);
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200801SHOW_FUNCTION(row_rd_idle_data_show, rowd->rd_idle_data.idle_time, 0);
802SHOW_FUNCTION(row_rd_idle_data_freq_show, rowd->rd_idle_data.freq, 0);
Tatyana Brokhman16349062012-09-20 10:46:10 +0300803#undef SHOW_FUNCTION
804
805#define STORE_FUNCTION(__FUNC, __PTR, MIN, MAX, __CONV) \
806static ssize_t __FUNC(struct elevator_queue *e, \
807 const char *page, size_t count) \
808{ \
809 struct row_data *rowd = e->elevator_data; \
810 int __data; \
811 int ret = row_var_store(&__data, (page), count); \
812 if (__CONV) \
813 __data = (int)msecs_to_jiffies(__data); \
814 if (__data < (MIN)) \
815 __data = (MIN); \
816 else if (__data > (MAX)) \
817 __data = (MAX); \
818 *(__PTR) = __data; \
819 return ret; \
820}
821STORE_FUNCTION(row_hp_read_quantum_store,
Tatyana Brokhman0a0345a2012-10-15 20:50:54 +0200822&rowd->row_queues[ROWQ_PRIO_HIGH_READ].disp_quantum, 1, INT_MAX, 0);
Tatyana Brokhman16349062012-09-20 10:46:10 +0300823STORE_FUNCTION(row_rp_read_quantum_store,
Tatyana Brokhman0a0345a2012-10-15 20:50:54 +0200824 &rowd->row_queues[ROWQ_PRIO_REG_READ].disp_quantum,
825 1, INT_MAX, 0);
Tatyana Brokhman16349062012-09-20 10:46:10 +0300826STORE_FUNCTION(row_hp_swrite_quantum_store,
Tatyana Brokhman0a0345a2012-10-15 20:50:54 +0200827 &rowd->row_queues[ROWQ_PRIO_HIGH_SWRITE].disp_quantum,
828 1, INT_MAX, 0);
Tatyana Brokhman16349062012-09-20 10:46:10 +0300829STORE_FUNCTION(row_rp_swrite_quantum_store,
Tatyana Brokhman0a0345a2012-10-15 20:50:54 +0200830 &rowd->row_queues[ROWQ_PRIO_REG_SWRITE].disp_quantum,
831 1, INT_MAX, 0);
Tatyana Brokhman16349062012-09-20 10:46:10 +0300832STORE_FUNCTION(row_rp_write_quantum_store,
Tatyana Brokhman0a0345a2012-10-15 20:50:54 +0200833 &rowd->row_queues[ROWQ_PRIO_REG_WRITE].disp_quantum,
834 1, INT_MAX, 0);
Tatyana Brokhman16349062012-09-20 10:46:10 +0300835STORE_FUNCTION(row_lp_read_quantum_store,
Tatyana Brokhman0a0345a2012-10-15 20:50:54 +0200836 &rowd->row_queues[ROWQ_PRIO_LOW_READ].disp_quantum,
837 1, INT_MAX, 0);
Tatyana Brokhman16349062012-09-20 10:46:10 +0300838STORE_FUNCTION(row_lp_swrite_quantum_store,
Tatyana Brokhman0a0345a2012-10-15 20:50:54 +0200839 &rowd->row_queues[ROWQ_PRIO_LOW_SWRITE].disp_quantum,
840 1, INT_MAX, 1);
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200841STORE_FUNCTION(row_rd_idle_data_store, &rowd->rd_idle_data.idle_time,
842 1, INT_MAX, 0);
843STORE_FUNCTION(row_rd_idle_data_freq_store, &rowd->rd_idle_data.freq,
844 1, INT_MAX, 0);
Tatyana Brokhman16349062012-09-20 10:46:10 +0300845
846#undef STORE_FUNCTION
847
848#define ROW_ATTR(name) \
849 __ATTR(name, S_IRUGO|S_IWUSR, row_##name##_show, \
850 row_##name##_store)
851
852static struct elv_fs_entry row_attrs[] = {
853 ROW_ATTR(hp_read_quantum),
854 ROW_ATTR(rp_read_quantum),
855 ROW_ATTR(hp_swrite_quantum),
856 ROW_ATTR(rp_swrite_quantum),
857 ROW_ATTR(rp_write_quantum),
858 ROW_ATTR(lp_read_quantum),
859 ROW_ATTR(lp_swrite_quantum),
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200860 ROW_ATTR(rd_idle_data),
861 ROW_ATTR(rd_idle_data_freq),
Tatyana Brokhman16349062012-09-20 10:46:10 +0300862 __ATTR_NULL
863};
864
865static struct elevator_type iosched_row = {
866 .ops = {
867 .elevator_merge_req_fn = row_merged_requests,
868 .elevator_dispatch_fn = row_dispatch_requests,
869 .elevator_add_req_fn = row_add_request,
Tatyana Brokhmanb7bf9ac2012-10-30 08:33:06 +0200870 .elevator_reinsert_req_fn = row_reinsert_req,
Tatyana Brokhman0ef81432012-12-20 19:23:58 +0200871 .elevator_is_urgent_fn = row_urgent_pending,
Tatyana Brokhman16349062012-09-20 10:46:10 +0300872 .elevator_former_req_fn = elv_rb_former_request,
873 .elevator_latter_req_fn = elv_rb_latter_request,
874 .elevator_set_req_fn = row_set_request,
875 .elevator_init_fn = row_init_queue,
876 .elevator_exit_fn = row_exit_queue,
877 },
Tatyana Brokhmandb7c1532013-01-23 17:15:49 +0200878 .icq_size = sizeof(struct io_cq),
879 .icq_align = __alignof__(struct io_cq),
Tatyana Brokhman16349062012-09-20 10:46:10 +0300880 .elevator_attrs = row_attrs,
881 .elevator_name = "row",
882 .elevator_owner = THIS_MODULE,
883};
884
885static int __init row_init(void)
886{
887 elv_register(&iosched_row);
888 return 0;
889}
890
891static void __exit row_exit(void)
892{
893 elv_unregister(&iosched_row);
894}
895
896module_init(row_init);
897module_exit(row_exit);
898
899MODULE_LICENSE("GPLv2");
900MODULE_DESCRIPTION("Read Over Write IO scheduler");