Skip to content
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.

8604 Avoid unnecessary search in VFS when unmounting snapshots #459

Closed
wants to merge 1 commit into from

Commits on Sep 1, 2017

  1. 8604 Avoid unnecessary work search in VFS when unmounting snapshots

    Reviewed by: Matt Ahrens <mahrens@delphix.com>
    Reviewed by: George Wilson <george.wilson@delphix.com>
    
    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
    sdimitro committed Sep 1, 2017
    Configuration menu
    Copy the full SHA
    4734f88 View commit details
    Browse the repository at this point in the history