bug-ddrescue
[Top][All Lists]
Advanced

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

[Bug-ddrescue] really high performance


From: Dave Yost
Subject: [Bug-ddrescue] really high performance
Date: Wed, 7 Sep 2005 19:39:23 -0700

Hi.

How about something like this:

Start up 100 threads. Map a chunk of the device to one of two 10MB buffers. Each time a thread is ready to do some work it calls a method that doles out the next block number to the thread, which then reads the first byte of the buffer, thus faulting it in. If the thread gets an error it adds it to a list. When all threads are done, sort the list, then write out the buffer with holes as appropriate to the output. While this writing is happening, start over again reading into the other buffer. Repeat.

With a perfectly-functioning disk and a good OS, this algorithm should result in a sequential read of the entire buffer. Ideally the OS should let you tell the I/O system to set the paging quantum for the buffer to the block size of the device and let you request 0 error retries. If that is in place, the whole thing even with errors, should go at sequential read speed. After eveything has been copied, you can go back and do retries, but even the retries will be faster because you won't have to do individual reads on each block; you can use the same algorithm for the chunks where there was trouble. So let's say there is a chunk of 8 blocks that all get errors. You'd do the same concurrent algorithm to try to read all of them at once, in other words, in a single disk I/O, then you'd see if any blocks came back OK this time.

Dave




reply via email to

[Prev in Thread] Current Thread [Next in Thread]