]> git.proxmox.com Git - mirror_zfs.git/commit
Add explicit prefetches to bpobj_iterate().
authorAlexander Motin <mav@FreeBSD.org>
Fri, 21 Jul 2023 18:50:48 +0000 (14:50 -0400)
committerGitHub <noreply@github.com>
Fri, 21 Jul 2023 18:50:48 +0000 (11:50 -0700)
commit28430b51e3e2387e6f36d5b4ee5b30ef33095993
tree3f789bd8e9a4d72b4651dd746f7cc76c1ca31afe
parent6fd87e1d8df1cab8d6087026cbc361a0886a2a97
Add explicit prefetches to bpobj_iterate().

To simplify error handling bpobj_iterate_blkptrs() iterates through
the list of block pointers backwards.  Unfortunately speculative
prefetcher is currently unable to detect such patterns, that makes
each block read there synchronous and very slow on HDD pools.

According to my tests, added explicit prefetch reduces time needed
to asynchronously delete 8 snapshots of 4 million blocks each from
20 seconds to less than one, that should free sync thread for other
useful work, such as async writes, scrub, etc.

While there, plug one memory leak in case of bpobj_open() error and
harmonize some variable names.

Reviewed-by: Allan Jude <allan@klarasystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #15071
include/sys/bpobj.h
module/zfs/bpobj.c