]> git.proxmox.com Git - mirror_zfs.git/commit
Refactor dmu_prefetch().
authorAlexander Motin <mav@FreeBSD.org>
Mon, 7 Aug 2023 20:54:41 +0000 (16:54 -0400)
committerGitHub <noreply@github.com>
Mon, 7 Aug 2023 20:54:41 +0000 (13:54 -0700)
commit6c94e64963139e5e598a9880fe73cd326fa5453b
treed9583b4496591c9852826f50a1c5c66eb21951dd
parenta97b8fc2dd9ed85640b81b0514ff7424e26fc32e
Refactor dmu_prefetch().

- Split dmu_prefetch_dnode() from dmu_prefetch() into a separate
function.  It is quite inconvenient to read the code where len = 0
means dnode prefetch instead indirect/data prefetch.  One function
doing both has no benefits, since the code paths are independent.
 - Improve dmu_prefetch() handling of long block ranges.  Instead
of limiting L0 data length to prefetch for to dmu_prefetch_max,
make dmu_prefetch_max limit the actual amount of prefetch at the
specified level, and, if there is more, prefetch all the rest at
higher indirection level.  It should improve random access times
within the prefetched range of any length, reducing importance of
specific dmu_prefetch_max value.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #15076
include/sys/dmu.h
module/os/freebsd/zfs/zfs_vnops_os.c
module/os/linux/zfs/zfs_vnops_os.c
module/zfs/dmu.c
module/zfs/dsl_deadlist.c
module/zfs/spa_log_spacemap.c
module/zfs/zvol.c