simplify disksort, please review.

Pawel Jakub Dawidek pjd at FreeBSD.org
Thu Jun 9 19:30:10 GMT 2005


On Wed, Jun 08, 2005 at 04:43:03PM -0400, Jeff Roberson wrote:
+> http://www.chesapeake.net/~jroberson/disksort.diff
+> 
+> Our disksort algorithm used to be complicated by the BIO_ORDERED flag,
+> which could cause us to make some exceptions in the sorting.  When the
+> ordered support was removed we never simplified the algorithm.  The patch
+> above gets rid of the switch point and associated logic.  It's now a
+> simple hinted insertion sort with a one way scan.  Since it's a fairly
+> central algorithm, I'd appreciate a review.

It is not related to you patch, but I think our disk sort is just too
trivial.
The one example of how the order can be broken (write(offset, size)):

	write(1024, 512)
	write(0, 2048)

It'll be sorted to:

	write(0, 2048)
	write(1024, 512)

because we're sorting only based on offset.
AFAIR we now require from file system not to send next request to the same
area until previous request is not finished, so we should be safe (for now).

-- 
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd at FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20050609/96b6abf5/attachment.bin


More information about the freebsd-arch mailing list