Reviewed by: Matt Ahrens <[email protected]> Reviewed by: George Wilson <[email protected]>
Every time we want to unmount a snapshot (happens during snapshot deletion or renaming) we unnecessarily iterate through all the mountpoints in the VFS layer (see zfs_get_vfs). The current patch completely gets rid of that code and changes the approach while keeping the behavior of that code path the same. Specifically, it puts a hold on the dataset/snapshot and gets its vfs resource reference directly, instead of linearly searching for it. If that reference exists we attempt to amount it. With the above change, it became obvious that the nvlist manipulations that we do (add_boolean and add_nvlist) take a significant amount of time ensuring uniqueness of every new element even though they don't have too. Thus, we updated the patch so those nvlists are not trying to enforce the uniqueness of their elements. A more complete analysis of the problem solved by this patch can be found below: https://sdimitro.github.io/post/snap-unmount-perf/ Upstream Bugs: DLPX-53221 You can view, comment on, or merge this pull request online at: https://github.com/openzfs/openzfs/pull/459 -- Commit Summary -- * 8604 Avoid unnecessary work search in VFS when unmounting snapshots -- File Changes -- M usr/src/uts/common/fs/zfs/dsl_destroy.c (18) M usr/src/uts/common/fs/zfs/sys/zfs_ioctl.h (5) M usr/src/uts/common/fs/zfs/zfs_ioctl.c (67) -- Patch Links -- https://github.com/openzfs/openzfs/pull/459.patch https://github.com/openzfs/openzfs/pull/459.diff -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/openzfs/openzfs/pull/459 ------------------------------------------ openzfs-developer Archives: https://openzfs.topicbox.com/groups/developer/discussions/Tff1a200abd9112b9-M6ee9f9ebb6f819ab999d4cbc Powered by Topicbox: https://topicbox.com
