[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Howto implement device detection without thrashing



On Sun, Mar 14, 1999 at 06:39:15PM -0500, Jonathan P Tomer wrote:
 
> windows checkpointing thrashes because they explicitly turn off caching
> and writes after each device tested for. that's a lot of devices, and
> it's very quick to test for each -- quicker than it is to write the
> checkpoint info. but they decided it's worth it in order to have
> bulletproof autodetection. it's not, imho.
 
I think it is well worth it. But the way they write the info is simple and
bad. They just append to a file and sync the file contents AND the filesystem.
This could be avoided (but I am not really sure about the possibilities of the
vfs interface of linux) in at least two ways:

1. we know how many tests we are running. This way we could just fill the file
with this much of null bytes. Then we can start writing at the beginning and
sync after each test but ONLY the file contents. This way the harddisk will
not trash because it does not have to write the filesystem information.

2. Have a small file of, say, 32KByte. Use it as wrap-around tape, e.g. we
start writing at the beginning of the file if we reach the end. Combined with
1. we will not have to update the filesystem each time we write something and
the writes are very localized. This way even the hard disk cache will help us
to avoid a slow down. This cache is not influenced by the system crashing.

Oh - if the detection crashes, we will search the last record written, move it
to the start of the file and start again with the next test. Of course this
record should not be overwritten.


I think it is a good idea to try to implement this. AND we should offer the
possibility to anonymously send the crash records to master.debian.org to
reorder the testing process.

Comments?

cu
    Torsten

Attachment: pgpkdVVIqaJIn.pgp
Description: PGP signature


Reply to: