Project

General

Profile

Bug #7843

get_clones_stat() is suboptimal for lots of clones

Added by Andriy Gapon over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
zfs - Zettabyte File System
Start date:
2017-02-07
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage

Description

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.

History

#1

Updated by Electric Monk over 2 years ago

  • % Done changed from 0 to 100
  • Status changed from New to Closed

git commit c5bde7273ef861a8dc54cfb9abe48d56062177da

commit  c5bde7273ef861a8dc54cfb9abe48d56062177da
Author: Andriy Gapon <avg@FreeBSD.org>
Date:   2017-03-01T05:12:23.000Z

    7843 get_clones_stat() is suboptimal for lots of clones
    Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
    Reviewed by: Matthew Ahrens <mahrens@delphix.com>
    Approved by: Dan McDonald <danmcd@omniti.com>

Also available in: Atom PDF