diff options
author | mav <mav@FreeBSD.org> | 2015-01-25 14:29:40 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2015-01-25 14:29:40 +0000 |
commit | 35b060644047dd0c6c136101f14d7b52f1b34ca7 (patch) | |
tree | bb33e393fe9afac41af9912b1ab95c7a28bd373a /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c | |
parent | a833c07b8b656a1a2147493d437b49b83c32fd42 (diff) | |
download | FreeBSD-src-35b060644047dd0c6c136101f14d7b52f1b34ca7.zip FreeBSD-src-35b060644047dd0c6c136101f14d7b52f1b34ca7.tar.gz |
MFC r276952: Add LBA as secondary sort key for synchronous I/O requests.
On FreeBSD gethrtime() implemented via getnanouptime(), that has 1ms (1/hz)
precision. It makes primary sort key (timestamp) collision very possible.
In such situations sorting by secondary key of LBA is much more reasonable
then by totally meaningless zio pointer value.
With this change on multi-threaded synchronous ZVOL read I've measured 10%
throughput increase and average latency reduction.
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c index 7ce67aa..1dba319 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c @@ -313,6 +313,11 @@ vdev_queue_timestamp_compare(const void *x1, const void *x2) if (z1->io_timestamp > z2->io_timestamp) return (1); + if (z1->io_offset < z2->io_offset) + return (-1); + if (z1->io_offset > z2->io_offset) + return (1); + if (z1 < z2) return (-1); if (z1 > z2) |