Print this page
Optimize creation and removal of temporary "user holds" placed on
snapshots by a zfs send, by ensuring all the required holds and
releases are done in a single dsl_sync_task.
Creation now collates the required holds during a dry run and
then uses a single lzc_hold call via zfs_hold_apply instead of
processing each snapshot in turn.
Defered (on exit) cleanup by the kernel is also now done in
dsl_sync_task by reusing dsl_dataset_user_release.
On a test with 11 volumes in a tree each with 8 snapshots on a
single HDD zpool this reduces the time required to perform a full
send from 20 seconds to under 0.8 seconds.
For reference eliminating the hold entirely reduces this 0.15
seconds.
While I'm here:-
* Remove some unused structures
* Fix nvlist_t leak in zfs_release_one

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/sys/dsl_dataset.h
          +++ new/usr/src/uts/common/fs/zfs/sys/dsl_dataset.h
↓ open down ↓ 179 lines elided ↑ open up ↑
 180  180  int dsl_dataset_hold_obj(struct dsl_pool *dp, uint64_t dsobj, void *tag,
 181  181      dsl_dataset_t **);
 182  182  void dsl_dataset_rele(dsl_dataset_t *ds, void *tag);
 183  183  int dsl_dataset_own(struct dsl_pool *dp, const char *name,
 184  184      void *tag, dsl_dataset_t **dsp);
 185  185  int dsl_dataset_own_obj(struct dsl_pool *dp, uint64_t dsobj,
 186  186      void *tag, dsl_dataset_t **dsp);
 187  187  void dsl_dataset_disown(dsl_dataset_t *ds, void *tag);
 188  188  void dsl_dataset_name(dsl_dataset_t *ds, char *name);
 189  189  boolean_t dsl_dataset_tryown(dsl_dataset_t *ds, void *tag);
 190      -void dsl_register_onexit_hold_cleanup(dsl_dataset_t *ds, const char *htag,
 191      -    minor_t minor);
      190 +void dsl_register_onexit_hold_cleanup(nvlist_t *holds, minor_t minor);
 192  191  uint64_t dsl_dataset_create_sync(dsl_dir_t *pds, const char *lastname,
 193  192      dsl_dataset_t *origin, uint64_t flags, cred_t *, dmu_tx_t *);
 194  193  uint64_t dsl_dataset_create_sync_dd(dsl_dir_t *dd, dsl_dataset_t *origin,
 195  194      uint64_t flags, dmu_tx_t *tx);
 196  195  int dsl_dataset_snapshot(nvlist_t *snaps, nvlist_t *props, nvlist_t *errors);
 197  196  int dsl_dataset_promote(const char *name, char *conflsnap);
 198  197  int dsl_dataset_clone_swap(dsl_dataset_t *clone, dsl_dataset_t *origin_head,
 199  198      boolean_t force);
 200  199  int dsl_dataset_rename_snapshot(const char *fsname,
 201  200      const char *oldsnapname, const char *newsnapname, boolean_t recursive);
↓ open down ↓ 86 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX