[PATCH -mm] [1/3] add elv_extended_request call to iosched API
From: Nate Diller
Date: Thu Aug 03 2006 - 22:09:03 EST
the Elevator iosched would prefer to be unconditionally notified of a
merge, but the current API calls only one 'merge' notifier
(elv_merge_requests or elv_merged_requests), even if both front and
back merges happened.
elv_extended_request satisfies this requirement in conjunction with
elv_merge_requests.
Signed-off-by: Nate Diller <nate.diller@xxxxxxxxx>
---
block/elevator.c | 9 +++++++++
block/ll_rw_blk.c | 2 ++
include/linux/elevator.h | 4 ++++
3 files changed, 15 insertions(+)
---
diff -urpN -X dontdiff linux-2.6.18-rc1-mm2/block/elevator.c
linux-dput/block/elevator.c
--- linux-2.6.18-rc1-mm2/block/elevator.c 2006-07-18 14:52:29.000000000 -0700
+++ linux-dput/block/elevator.c 2006-08-03 18:42:00.000000000 -0700
@@ -287,6 +287,15 @@ void elv_merged_request(request_queue_t
q->last_merge = rq;
}
+void elv_extended_request(request_queue_t *q, struct request *rq,
+ int direction, int nr_sectors)
+{
+ elevator_t *e = q->elevator;
+
+ if (e->ops->elevator_extended_req_fn)
+ e->ops->elevator_extended_req_fn(q, rq, direction, nr_sectors);
+}
+
void elv_merge_requests(request_queue_t *q, struct request *rq,
struct request *next)
{
diff -urpN -X dontdiff linux-2.6.18-rc1-mm2/block/ll_rw_blk.c
linux-dput/block/ll_rw_blk.c
--- linux-2.6.18-rc1-mm2/block/ll_rw_blk.c 2006-07-18 15:00:44.000000000 -0700
+++ linux-dput/block/ll_rw_blk.c 2006-08-03 18:42:00.000000000 -0700
@@ -2895,6 +2895,7 @@ static int __make_request(request_queue_
req->nr_sectors = req->hard_nr_sectors += nr_sectors;
req->ioprio = ioprio_best(req->ioprio, prio);
drive_stat_acct(req, nr_sectors, 0);
+ elv_extended_request(q, req, el_ret, nr_sectors);
if (!attempt_back_merge(q, req))
elv_merged_request(q, req);
goto out;
@@ -2922,6 +2923,7 @@ static int __make_request(request_queue_
req->nr_sectors = req->hard_nr_sectors += nr_sectors;
req->ioprio = ioprio_best(req->ioprio, prio);
drive_stat_acct(req, nr_sectors, 0);
+ elv_extended_request(q, req, el_ret, nr_sectors);
if (!attempt_front_merge(q, req))
elv_merged_request(q, req);
goto out;
diff -urpN -X dontdiff linux-2.6.18-rc1-mm2/include/linux/elevator.h
linux-dput/include/linux/elevator.h
--- linux-2.6.18-rc1-mm2/include/linux/elevator.h 2006-06-17
18:49:35.000000000 -0700
+++ linux-dput/include/linux/elevator.h 2006-08-03 18:42:00.000000000 -0700
@@ -6,6 +6,8 @@ typedef int (elevator_merge_fn) (request
typedef void (elevator_merge_req_fn) (request_queue_t *, struct
request *, struct request *);
+typedef void (elevator_extended_req_fn) (request_queue_t *, struct
request *, int, int);
+
typedef void (elevator_merged_fn) (request_queue_t *, struct request *);
typedef int (elevator_dispatch_fn) (request_queue_t *, int);
@@ -28,6 +30,7 @@ struct elevator_ops
{
elevator_merge_fn *elevator_merge_fn;
elevator_merged_fn *elevator_merged_fn;
+ elevator_extended_req_fn *elevator_extended_req_fn;
elevator_merge_req_fn *elevator_merge_req_fn;
elevator_dispatch_fn *elevator_dispatch_fn;
@@ -94,6 +97,7 @@ extern void elv_insert(request_queue_t *
extern int elv_merge(request_queue_t *, struct request **, struct bio *);
extern void elv_merge_requests(request_queue_t *, struct request *,
struct request *);
+extern void elv_extended_request(request_queue_t *, struct request *,
int, int);
extern void elv_merged_request(request_queue_t *, struct request *);
extern void elv_dequeue_request(request_queue_t *, struct request *);
extern void elv_requeue_request(request_queue_t *, struct request *);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/