Project

General

Profile

Bug #7741

get_zfs_dataset() takes an unreasonable amount of time

Added by Prakash Surya about 4 years ago. Updated about 4 years ago.

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

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

get_zfs_dataset() currently takes an unreasonable amount of time in the
process of sharing filesystems. It does multiple lookups of zfs
properties per filesystem on the machine, per filesystem that needs to
be shared (yes, quadratic in most cases).

The naive solution implemented in this change, is to make an optimistic
assumption that the mountpoint for a zfs filesystem is within a few
leading slashes of its name. So we cut off those leading slashes and
then check to see if such a filesystem exists. Only if the filesystem
has a custom mountpoint does this not work, so we turn a quadratic
operation into a constant time one (most of the time).

To verify the improvement, 10,000 zfs filesystems were created on a VM,
and the following command was used to share them all:

  1. sharemgr start zfs

Without this change, this operation took about 6.5 minutes; and with
this change, it took about 6.8 seconds.


Related issues

Related to illumos gate - Bug #7857: zfs/zpool commands print scary errors after 7741Closed2017-02-13

Actions
Related to illumos gate - Bug #7887: get_zfs_dataset() optimised path leaks zfs handleClosedAndrew Stormont2017-02-17

Actions
#1

Updated by Electric Monk about 4 years ago

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

git commit 95e79c0b22e3ef2a1ac6412a4ab12cd99922fc12

commit  95e79c0b22e3ef2a1ac6412a4ab12cd99922fc12
Author: Daniel Hoffman <dj.hoffman@delphix.com>
Date:   2017-01-18T22:45:59.000Z

    7741 get_zfs_dataset() takes an unreasonable amount of time
    Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
    Reviewed by: George Wilson <george.wilson@delphix.com>
    Reviewed by: Matthew Ahrens <mahrens@delphix.com>
    Approved by: Dan McDonald <danmcd@omniti.com>

#2

Updated by Andrew Stormont about 4 years ago

  • Related to Bug #7857: zfs/zpool commands print scary errors after 7741 added
#3

Updated by Andrew Stormont about 4 years ago

  • Related to Bug #7887: get_zfs_dataset() optimised path leaks zfs handle added

Also available in: Atom PDF