On Sun, Mar 03 2002, Peter Osterlund wrote:
Hi!
I have uploaded a new version of the packet writing driver here:
http://w1.894.telia.com/~u89404340/patches/packet/packet-2.4.19-pre2.patch.b...
This patch was generated from kernel 2.4.19-pre2, but should work also with kernel 2.4.18. (and probably 2.4.17 too.)
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. The implementation might be a bit nastier though, as you would have to handle that async and not blocking like you do now. BTW, what is the cache_sync_mutex good for?! AFAICS, we don't need to serialize this from the pktcdvd view point, and the cd drivers will serialize special commands on its own. unflushed_writes does need a barrier at least, but I'd rather see that be a bit flag instead. A block mutex for a simple variable is quite costly and risks schedule storms. -- Jens Axboe