Skip to content

Commit

Permalink
ZFS traverse_visitbp optimization to limit prefetch.
Browse files Browse the repository at this point in the history
Traversal code, traverse_visitbp() does visit blocks recursively.
Indirect (Non L0) Block of size 128k could contain, 1024 block pointers
of 128 bytes. In case of full traverse OR incremental traverse, where
all blocks were modified, it could traverse large number of blocks
pointed by indirect. Traversal code does issue prefetch of blocks
traversed below indirect. This could result into large number of
async reads queued on vdev queue. So, account for prefetch issued for
blocks pointed by indirect and limit max prefetch in one go.

Module Param:
zfs_traverse_indirect_prefetch_limit: Limit of prefetch while traversing
an indirect block

Local counters:
prefetched: Local counter to account for number prefetch done.
prefetchidx: Index for which next prefetch to be issued.
prefetchtriggeridx: Index at which next prefetch to be triggered.

Keeps prefetchtriggeridx somewhere in the middle of blocks prefetched, so
that prefetching blocks gets a enough time window before their demand
read is issued.

Signed-off-by: Jitendra Patidar <jitendra.patidar@nutanix.com>
Closes openzfs#11802
  • Loading branch information
jsai20 committed Mar 30, 2021
1 parent 602ea38 commit b03db55
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions module/zfs/dmu_traverse.c
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,10 @@ module_param(zfs_traverse_indirect_prefetch_limit, int, 0644);
MODULE_PARM_DESC(zfs_traverse_indirect_prefetch_limit,
"Traverse prefetch number of blocks pointed by indirect block");

module_param(zfs_traverse_indirect_prefetch_limit, int, 0644);
MODULE_PARM_DESC(zfs_traverse_indirect_prefetch_limit,
"Traverse prefetch number of blocks pointed by indirect block");

module_param_named(ignore_hole_birth, send_holes_without_birth_time, int, 0644);
MODULE_PARM_DESC(ignore_hole_birth,
"Alias for send_holes_without_birth_time");
Expand Down

0 comments on commit b03db55

Please sign in to comment.