-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speed up "zpool import" on FreeBSD in the presence of many zvols #11502
Conversation
By default, FreeBSD does not allow zpools to be backed by zvols (that can be changed with the "vfs.zfs.vol.recursive" sysctl). When that sysctl is set to 0, the kernel does not attempt to read zvols when looking for vdevs. But the zpool command still does. This change brings the zpool command into line with the kernel's behavior. It speeds "zpool import" when an already imported pool has many zvols, or a zvol with many snapshots. https://svnweb.freebsd.org/base?view=revision&revision=357235 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241083 https://reviews.freebsd.org/D22077 Obtained from: FreeBSD PR: 241083 Reported by: Martin Birgmeier <d8zNeCFG@aon.at> Sponsored by: Axcient Signed-off-by: Alan Somers <asomers@gmail.com>
cc the original reviewers: @amotin @freqlabs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part looks good to me. Just not sure why move some headers forward.
I am just thinking whether we should also somehow filter out /dev/zvol from the zpool_find_import_scan or it would be too big hack?
Good point. The |
I don't think it would be worthwhile. zpool_find_import_scan is only used with the |
By default, FreeBSD does not allow zpools to be backed by zvols (that can be changed with the "vfs.zfs.vol.recursive" sysctl). When that sysctl is set to 0, the kernel does not attempt to read zvols when looking for vdevs. But the zpool command still does. This change brings the zpool command into line with the kernel's behavior. It speeds "zpool import" when an already imported pool has many zvols, or a zvol with many snapshots. https://svnweb.freebsd.org/base?view=revision&revision=357235 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241083 https://reviews.freebsd.org/D22077 Obtained from: FreeBSD Reported by: Martin Birgmeier <d8zNeCFG@aon.at> Sponsored by: Axcient Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Alan Somers <asomers@gmail.com> Closes openzfs#11502
By default, FreeBSD does not allow zpools to be backed by zvols (that can be changed with the "vfs.zfs.vol.recursive" sysctl). When that sysctl is set to 0, the kernel does not attempt to read zvols when looking for vdevs. But the zpool command still does. This change brings the zpool command into line with the kernel's behavior. It speeds "zpool import" when an already imported pool has many zvols, or a zvol with many snapshots. https://svnweb.freebsd.org/base?view=revision&revision=357235 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241083 https://reviews.freebsd.org/D22077 Obtained from: FreeBSD Reported by: Martin Birgmeier <d8zNeCFG@aon.at> Sponsored by: Axcient Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Alan Somers <asomers@gmail.com> Closes openzfs#11502
Motivation and Context
By default, FreeBSD does not allow zpools to be backed by zvols (that can be changed with the "vfs.zfs.vol.recursive" sysctl). When that sysctl is set to 0, the kernel does not attempt to read zvols when looking for vdevs. But the zpool command still does.
Description
This change brings the zpool command into line with the kernel's behavior. It speeds "zpool import" when an already imported pool has many zvols, or a zvol with many snapshots.
How Has This Been Tested?
Tested with FreeBSD's ZFS test suite. And it shipped in FreeBSD 12.2-RELEASE.
Performance-wise, the time to import a nonexistent pool is linear in the number of geom devices present. That includes both disks and zvols. With an SSD-backed pool on my FreeBSD 13.0-CURRENT test system, I find that the import time takes about 13.3s with 10,000 zvols present. With the patch, that falls to 0.79s. For comparison, when no zvols are present it takes only 0.09s.
https://svnweb.freebsd.org/base?view=revision&revision=357235
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241083
https://reviews.freebsd.org/D22077
Obtained from: FreeBSD
PR: 241083
Reported by: Martin Birgmeier d8zNeCFG@aon.at
Sponsored by: Axcient
Signed-off-by: Alan Somers asomers@gmail.com
Types of changes
Checklist:
Signed-off-by
.