]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit - sys/dev/mcd/mcd.c
MFV r297831: 6322 ZFS indirect block predictive prefetch
authorAlexander Motin <mav@FreeBSD.org>
Mon, 11 Apr 2016 21:09:15 +0000 (21:09 +0000)
committerAlexander Motin <mav@FreeBSD.org>
Mon, 11 Apr 2016 21:09:15 +0000 (21:09 +0000)
commit78aec5c61002bc3bdb1b26a298dcf463a09d9b44
tree690c9aa9be0e5aee96d66a877f29d5b0f5b900d8
parent341f552d8c069e849fb1d974e487dcaccc297cc8
parent6257b60dd05e0cf49ddf79ea98d7a2308384660e
MFV r297831: 6322 ZFS indirect block predictive prefetch

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Author: Alexander Motin <mav@FreeBSD.org>

Improve speculative prefetch of indirect blocks.

Scalability of many operations on wide ZFS pool can be limited by
requirement to prefetch indirect blocks first.  Recently added
asynchronous indirect block read partially helped, but did not
solve the problem completely.  This patch extends existing prefetcher
functionality to explicitly work with indirect blocks.

Before this change prefetcher issued reads for up to 8MB of data in
advance.  With this change it also issues indirect block reads
for up to 64MB of data in advance, so that when it will be time to
actually read those data, it can be done immediately.  Alike effect
can be achieved by just increasing maximal data prefetch distance,
but at higher memory cost.

Also this change introduces indirect block prefetch for rewrite
operations, that was never done before.  Previously ARC miss for
Indirect blocks regularly blocked rewrites, converting perfectly
aligned asynchronous operations into synchronous read-write pairs,
significantly reducing maximal rewrite speed.

While being there this issue was also fixed:
 - prefetch was done always, even if caching for the dataset was
completely disabled.

Testing on FreeBSD with zvol on top of 6x striped 2x mirrored pool
of 12 assorted HDDs shown me such performance numbers:
------- BEFORE --------
Write       491363677 bytes/sec
Read        312430631 bytes/sec
Rewrite      97680464 bytes/sec
-------- AFTER --------
Write       493524146 bytes/sec
Read        438598079 bytes/sec
Rewrite     277506044 bytes/sec

Closes #65
Closes #80

openzfs/openzfs@792fd28ac04f78cc5e43ead2d72a96f244ea84e8
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_zfetch.h
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h