Re: [2.5.2-pre3] Harddisk Performance

From: Peter Osterlund (
Date: Fri Jan 04 2002 - 11:28:48 EST

Jens Axboe <> writes:

> On Sat, Dec 29 2001, Heinz Diehl wrote:
> >
> > Running 2.5.2-pre3, hdparm shows up very poor harddisk performance
> > on my system compared to 2.4.x:
> Yes I just noticed that too (someone else reported it) -- seems to be
> due to missed merges, I'm investigating.

I have found that if the elevator says BACK_MERGE or FRONT_MERGE, but
the request queue doesn't allow the merge, the request will be put
last in the queue instead of next to the request where the merge would
have been done if allowed.

I first noticed this when playing with the pktcdvd.o module, where the
result was duplicated writes to the same packet, but it does happen
also for normal IDE hard disks.

I think this is a problem in 2.4 too, so it probably doesn't explain
why 2.5 is slower than 2.4. Maybe this is a problem with the "deadline
I/O scheduler" too. I haven't tested it yet, but it doesn't seem to
touch this part of ll_rw_blk.c.

This patch has been running for some time now on my system without

--- ll_rw_blk.c.old Fri Jan 4 17:10:18 2002
+++ ll_rw_blk.c Fri Jan 4 17:10:57 2002
@@ -1121,8 +1121,10 @@
         switch (el_ret) {
                 case ELEVATOR_BACK_MERGE:
- if (!q->back_merge_fn(q, req, bio))
+ if (!q->back_merge_fn(q, req, bio)) {
+ insert_here = &req->queuelist;
+ }
                         elv_merge_cleanup(q, req, nr_sectors);
@@ -1135,8 +1137,10 @@
                 case ELEVATOR_FRONT_MERGE:
- if (!q->front_merge_fn(q, req, bio))
+ if (!q->front_merge_fn(q, req, bio)) {
+ insert_here = req->queuelist.prev;
+ }
                         elv_merge_cleanup(q, req, nr_sectors);

Peter Osterlund -
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Jan 07 2002 - 21:00:25 EST