]> git.proxmox.com Git - mirror_zfs.git/commit
Speculative prefetch for reordered requests
authorAlexander Motin <mav@FreeBSD.org>
Mon, 8 Apr 2024 22:13:27 +0000 (18:13 -0400)
committerGitHub <noreply@github.com>
Mon, 8 Apr 2024 22:13:27 +0000 (15:13 -0700)
commit5e5fd0a1785aa65d5c2259f2d43459437ae209eb
treeef62792b62f920ce667b42816dd6825242c80b20
parenteeca9a91d6866879f4d57b4d0644e5da951f3daa
Speculative prefetch for reordered requests

Before this change speculative prefetcher was able to detect a stream
only if all of its accesses are perfectly sequential.  It was easy to
implement and is perfectly fine for single-threaded applications.
Unfortunately multi-threaded network servers, such as iSCSI, SMB or
NFS usually have plenty of threads and may often reorder requests,
preventing successful speculation and prefetch.

This change allows speculative prefetcher to detect streams even if
requests are reordered by introducing a list of 9 non-contiguous
ranges up to 16MB ahead of current stream position and filling the
gaps as more requests arrive.  It also allows stream to proceed
even with holes up to a certain configurable threshold (25%).

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #16022
cmd/arc_summary
include/sys/dmu_zfetch.h
man/man4/zfs.4
module/zfs/dmu.c
module/zfs/dmu_zfetch.c