HomeFreeBSD

Avoid memory copies during mirror scrub

Description

Avoid memory copies during mirror scrub

Issuing several scrub reads for a block we may use the parent ZIO
buffer for one of child ZIOs. If that read complete successfully,
then we won't need to copy the data explicitly. If block has only
one copy (typical for root vdev, which is also a mirror inside),
then we never need to copy -- succeed or fail as-is. Previous
code also copied data from buffer of every successfully completed
child ZIO, but that just does not make any sense.

On healthy N-wide mirror this saves all N+1 (or even more in case
of ditto blocks) memory copies for each scrubbed block, allowing
CPU to focus mostly on check-summing. For other vdev types it
should save one memory copy per block copy at root vdev.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Mark Maybee <mark.maybee@delphix.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #13606

Details

Provenance
mavAuthored on Jul 5 2022, 11:26 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Jul 26 2022, 5:10 PM
Parents
rG4b8f16072d9c: Fix and disable blocks statistics during scrub
Branches
Unknown
Tags
Unknown

Event Timeline