Re: [PATCH] block: fix request sorting at unplug

From: Jens Axboe
Date: Sun Apr 03 2011 - 18:11:21 EST


On 2011-04-02 17:37, Konstantin Khlebnikov wrote:
> Comparison function for list_sort() must be anticommutative,
> otherwise it is not sorting in ordinary meaning.
>
> But fortunately list_sort() always check ((*cmp)(priv, a, b) <= 0)
> it not distinguish negative and zero, so comparison function can
> implement only less-or-equal instead of full three-way comparison.

Thanks, good catch! It's an optimization, so no breakage. But if you end
up often having > 1 queue plugged, it's a good optimization.

--
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/