HomeFreeBSD

Add explicit prefetches to bpobj_iterate().

Description

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

Details

Provenance
mavAuthored on Jul 21 2023, 6:50 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Jul 21 2023, 11:35 PM
Parents
rGb6f618f8ffda: Don't emit cksum_{actual_expected} in ereport.fs.zfs.checksum events
Branches
Unknown
Tags
Unknown

Event Timeline