2006-08-04 02:11:04

by Nate Diller

[permalink] [raw]
Subject: [PATCH -mm] [1/3] add elv_extended_request call to iosched API

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 <[email protected]>

---
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 *);


2006-08-04 05:19:51

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH -mm] [1/3] add elv_extended_request call to iosched API

On Thu, Aug 03 2006, Nate Diller wrote:
> 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.

Ok, I suppose. But please rebase patches against the 'block' git branch,
there are extensive changes in this area.

--
Jens Axboe

2006-08-04 05:46:12

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH -mm] [1/3] add elv_extended_request call to iosched API

On Fri, 4 Aug 2006 07:20:32 +0200
Jens Axboe <[email protected]> wrote:

> On Thu, Aug 03 2006, Nate Diller wrote:
> > 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.
>
> Ok, I suppose. But please rebase patches against the 'block' git branch,
> there are extensive changes in this area.
>

argh, the great (but partial ;)) renaming bites again.

A suitable patch to merge against is
http://www.zip.com.au/~akpm/linux/patches/stuff/git-block.patch

2006-08-04 13:38:55

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH -mm] [1/3] add elv_extended_request call to iosched API

On Thu, Aug 03 2006, Andrew Morton wrote:
> On Fri, 4 Aug 2006 07:20:32 +0200
> Jens Axboe <[email protected]> wrote:
>
> > On Thu, Aug 03 2006, Nate Diller wrote:
> > > 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.
> >
> > Ok, I suppose. But please rebase patches against the 'block' git branch,
> > there are extensive changes in this area.
> >
>
> argh, the great (but partial ;)) renaming bites again.
>
> A suitable patch to merge against is
> http://www.zip.com.au/~akpm/linux/patches/stuff/git-block.patch

not so much the renaming (that's easy enough), but the elevator core
parts changed in some areas.

--
Jens Axboe

2006-08-07 23:25:34

by Nate Diller

[permalink] [raw]
Subject: Re: [PATCH -mm] [1/3] add elv_extended_request call to iosched API

On 8/4/06, Jens Axboe <[email protected]> wrote:
> On Thu, Aug 03 2006, Andrew Morton wrote:
> > On Fri, 4 Aug 2006 07:20:32 +0200
> > Jens Axboe <[email protected]> wrote:
> >
> > > On Thu, Aug 03 2006, Nate Diller wrote:
> > > > 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.
> > >
> > > Ok, I suppose. But please rebase patches against the 'block' git branch,
> > > there are extensive changes in this area.
> > >
> >
> > argh, the great (but partial ;)) renaming bites again.
> >
> > A suitable patch to merge against is
> > http://www.zip.com.au/~akpm/linux/patches/stuff/git-block.patch
>
> not so much the renaming (that's easy enough), but the elevator core
> parts changed in some areas.

would it be appropriate to submit against 2.6.18-rc3-mm2? I hope to
have a much-cleaned-up version tomorrow

thanks

NATE

2006-08-07 23:42:41

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH -mm] [1/3] add elv_extended_request call to iosched API

On Mon, 7 Aug 2006 16:14:59 -0700
"Nate Diller" <[email protected]> wrote:

> On 8/4/06, Jens Axboe <[email protected]> wrote:
> > On Thu, Aug 03 2006, Andrew Morton wrote:
> > > On Fri, 4 Aug 2006 07:20:32 +0200
> > > Jens Axboe <[email protected]> wrote:
> > >
> > > > On Thu, Aug 03 2006, Nate Diller wrote:
> > > > > 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.
> > > >
> > > > Ok, I suppose. But please rebase patches against the 'block' git branch,
> > > > there are extensive changes in this area.
> > > >
> > >
> > > argh, the great (but partial ;)) renaming bites again.
> > >
> > > A suitable patch to merge against is
> > > http://www.zip.com.au/~akpm/linux/patches/stuff/git-block.patch
> >
> > not so much the renaming (that's easy enough), but the elevator core
> > parts changed in some areas.
>
> would it be appropriate to submit against 2.6.18-rc3-mm2?

Yes, that should give us a patch which Jens can use.

Be aware that I've just gone and dropped git-block.patch due to
suspend/resume problems. I expect it'll come back within a suitable
timeframe for you, but if it doesn't, inclusion in -mm might be delayed.