]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit - contrib/ntp/tests/libntp/run-timespecops.c
MFV r314910: 7843 get_clones_stat() is suboptimal for lots of clones
authorAndriy Gapon <avg@FreeBSD.org>
Wed, 8 Mar 2017 13:48:26 +0000 (13:48 +0000)
committerAndriy Gapon <avg@FreeBSD.org>
Wed, 8 Mar 2017 13:48:26 +0000 (13:48 +0000)
commit7e4b3a6fa2160ce2a17a832cd5f12967ae79e75c
tree106e2451f886ed6a30e49582293b1095a7a6e3cf
parent4d5832bc128eed034f3bf91ed8e7239bc20ac381
parentf1a99e4268dce584ef4e9cf6dd8b119f228a94cd
MFV r314910: 7843 get_clones_stat() is suboptimal for lots of clones

illumos/illumos-gate@c5bde7273ef861a8dc54cfb9abe48d56062177da
https://github.com/illumos/illumos-gate/commit/c5bde7273ef861a8dc54cfb9abe48d56062177da

https://www.illumos.org/issues/7843
  get_clones_stat() could be very slow if a snapshot has many (thousands) clones.
  Clone names are added to an nvlist that's created with NV_UNIQUE_NAME.
  So, each time a new name is appended to the list, the whole list is searched
  linearly to see if that name is not already in the list. That results in the
  quadratic complexity.
  That should be easy to fix as we know in advance that we should not get any
  duplicate names, so we can drop NV_UNIQUE_NAME when creating the list.

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Andriy Gapon <avg@FreeBSD.org>

MFC after: 1 week
Sponsored by: ClusterHQ
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c