HomeFreeBSD

zpool: speed up importing large pools (#11469)

Description

zpool: speed up importing large pools (#11469)

The ZFS_IOC_POOL_TRYIMPORT ioctl returns an nvlist from the kernel to a
preallocated buffer in userland. Userland must guess how large the
buffer should be. If it undersizes it, it must reallocate and try
again. That can cost a lot of time for large pools.

OpenZFS commit 28b40c8a6e3 set the guess at "zc.zc_nvlist_conf_size * 4"
without explanation. On my system, that is too small. From experiment,
x 32 is a better multiplier. But I don't know how to calculate it
theoretically.

Sponsored by: Axcient
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alek Pinchuk <apinchuk@axcient.com>
Signed-off-by: Alan Somers <asomers@gmail.com>
Closes #11469

Details

Provenance
asomersAuthored on Jan 21 2021, 8:55 PM
GitHub <noreply@github.com>Committed on Jan 21 2021, 8:55 PM
Parents
rGe50b5217e7a8: libzutil: optimize zpool_read_label with AIO
Branches
Unknown
Tags
Unknown