]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
6171 dsl_prop_unregister() slows down dataset eviction.
authorAndriy Gapon <avg@FreeBSD.org>
Mon, 21 Sep 2015 12:00:12 +0000 (12:00 +0000)
committerAndriy Gapon <avg@FreeBSD.org>
Mon, 21 Sep 2015 12:00:12 +0000 (12:00 +0000)
commitddd84277c975e36e62d674a572459a078f662912
tree4c72cac1ef76d1b038a11bfcf3cddec4943271d1
parentf38dd2a62537b788bb92e99ed679eae074d5265c
6171 dsl_prop_unregister() slows down dataset eviction.

https://github.com/illumos/illumos-gate/commit/03bad06fbb261fd4a7151a70dfeff2f5041cce1f

https://www.illumos.org/issues/6171
  A change to a property on a dataset must be propagated to its descendants
  in case that property is inherited. For datasets whose information is
  not currently loaded into memory (e.g. a snapshot that isn't currently
  mounted), there is nothing to do; the property change will take effect
  the next time that dataset is loaded. To handle updates to datasets that
  are in-core, ZFS registers a callback entry for each property of each
  loaded dataset with the dsl directory that holds that dataset. There
  is a dsl directory associated with each live dataset that references
  both the live dataset and any snapshots of the live dataset. A property
  change is effected by doing a traversal of the tree of dsl directories
  for a pool, starting at the directory sourcing the change, and invoking
  these callbacks.
  The current implementation both registers and de-registers properties
  individually for each loaded dataset. While registration for a property is
  O(1) (insert into a list), de-registration is O(n) (search list and then
  remove). The 'n' for de-registration, however, is not limited to the size
  (number of snapshots + 1) of the dsl directory. The eviction portion
  of the life cycle for the in core state of datasets is asynchronous,
  which allows multiple copies of the dataset information to be in-core
  at once. Only one of these copies is active at any time with the rest
  going through tear down processing, but all copies contribute to the
  cost of performing a dsl_prop_unregister().
  ...
  The fix employed here is to make property de-registration O(1). With
  this change in place, it is hoped that a single thread is more than
  sufficient to handle eviction processing. If it isn't, the problem can
  be solved by increasing the number of threads devoted to the eviction
  taskq.

Author: Justin Gibbs <gibbs@scsiguy.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
uts/common/fs/zfs/dmu_objset.c
uts/common/fs/zfs/dsl_dataset.c
uts/common/fs/zfs/dsl_dir.c
uts/common/fs/zfs/dsl_prop.c
uts/common/fs/zfs/sys/dsl_dataset.h
uts/common/fs/zfs/sys/dsl_dir.h
uts/common/fs/zfs/sys/dsl_prop.h
uts/common/fs/zfs/zfs_vfsops.c