On Mon, 4 Mar 2002, Jens Axboe wrote:
On Sun, Mar 03 2002, Peter Osterlund wrote:
The interesting change in this version is that I have changed the way mixing of read and write requests is handled. The driver now inserts a "synchronize cache" command before the first read command following a write command. This has three advantages:
That's a good idea, I definitely agree with that. Some comments on the implementation -- I'd much rather see this done at the lower level, so ide-cd or sr would sync cache on the first read on its own.
I didn't know if this behaviour is always wanted, since there are so many different modes for CDs, and I don't know enough about them all. If it is always wanted, I agree it would be better to put this functionality at a lower level.
The implementation might be a bit nastier though, as you would have to handle that async and not blocking like you do now.
For the 2.5 version of the packet driver, doing the syncs at a lower level may actually simplify things. The 2.5 version is not limited to handling of a single packet at a time. A state machine is used for driving each packet and the packet driver can submit multiple reads and writes asynchronously to the underlying cdrom device queue, which is then responsible for sorting and merging the requests. In this scenario it would be quite hard for the packet driver to insert cache sync commands at the right spots in the request queue without limiting the amount of request reordering the underlying CD queue can do. The 2.5 version is actually already working, except for two things: 1. It doesn't have the "cache sync before read" logic implemented. 2. Since everything is now done with "bio" objects, the functionality to fill in missing parts of packets with data from the buffer cache doesn't work. The latest 2.5 version is available here: http://w1.894.telia.com/~u89404340/patches/packet/2.5/packet-2.5.5.patch.bz2 -- Peter Osterlund - petero2@telia.com http://w1.894.telia.com/~u89404340