Re: [PATCH] Speed up the cdrw packet writing driver

From: Peter Osterlund
Date: Tue Aug 24 2004 - 17:17:20 EST


Andrew Morton <akpm@xxxxxxxx> writes:

> Peter Osterlund <petero2@xxxxxxxxx> wrote:
> >
> > Jens Axboe <axboe@xxxxxxx> writes:
> >
> > > On Mon, Aug 23 2004, Peter Osterlund wrote:
> > > > Jens Axboe <axboe@xxxxxxx> writes:
> > > >
> > > > > On Sat, Aug 14 2004, Peter Osterlund wrote:
> > > > > >
> > > > > > This patch replaces the pd->bio_queue linked list with an rbtree. The
> > > > > > list can get very long (>200000 entries on a 1GB machine), so keeping
> > > > > > it sorted with a naive algorithm is far too expensive.
> > > > >
> > > > > It looks like you are assuming that bio->bi_sector is unique which isn't
> > > > > necessarily true. In that respect, list -> rbtree conversion isn't
> > > > > trivial (or, at least it requires extra code to handle this).
> > > >
> > > > I don't think that is assumed anywhere.
> > > >
> > > > [...]
> > >
> > > You are right, the code looks fine indeed. The bigger problem is
> > > probably that a faster data structure is needed at all, having hundreds
> > > of thousands bio's pending for a packet writing device is not nice at
> > > all.
> >
> > Why is it not nice? If the VM has decided to create 400MB of dirty
> > data on a DVD+RW packet device, I don't see a problem with submitting
> > all bio's at the same time to the packet device.
>
> We also have a limit on the number of in-flight requests:
> /sys/block/sda/queue/nr_requests. It defaults to 128.
>
> Are you saying that your requests are so huge that each one has 1000 BIOs?
> That would be odd, for an IDE interface.

No, the thing is that the packet driver doesn't create requests at
all. It stuffs incoming bio's in the rbtree, then the worker thread
collects bio's from the rbtree for the same "zone" on the disc (each
zone is 64kb on a CDRW and 32KB on a DVD). The driver then creates a
new bio with the same size as the zone size and submits it to the real
CD/DVD device.

--
Peter Osterlund - petero2@xxxxxxxxx
http://w1.894.telia.com/~u89404340
-
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/