Skip to content

Commit d576926

Browse files
asomersjsai20
authored andcommitted
zpool: speed up importing large pools (openzfs#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 28b40c8 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 <[email protected]> Reviewed-by: Alek Pinchuk <[email protected]> Signed-off-by: Alan Somers <[email protected]> Closes openzfs#11469
1 parent 5f4e29d commit d576926

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/libzfs/libzfs_import.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ refresh_config(libzfs_handle_t *hdl, nvlist_t *config)
7777
if (zcmd_write_conf_nvlist(hdl, &zc, config) != 0)
7878
return (NULL);
7979

80-
dstbuf_size = MAX(CONFIG_BUF_MINSIZE, zc.zc_nvlist_conf_size * 4);
80+
dstbuf_size = MAX(CONFIG_BUF_MINSIZE, zc.zc_nvlist_conf_size * 32);
8181

8282
if (zcmd_alloc_dst_nvlist(hdl, &zc, dstbuf_size) != 0) {
8383
zcmd_free_nvlists(&zc);

0 commit comments

Comments
 (0)