From e8a2014436147d07442e52f854e197082748fca6 Mon Sep 17 00:00:00 2001 From: Gvozden Neskovic Date: Sat, 3 Dec 2016 00:59:35 +0100 Subject: Cache ddt_get_dedup_dspace() value if there was no ddt changes Save and reuse ddt dspace calculation when there have been no ddt changes. This avoids unnecessary traversal of 168KiB of ddt histograms. Reviewed-by: Brian Behlendorf Signed-off-by: Gvozden Neskovic Closes #5425 --- module/zfs/spa_misc.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'module/zfs/spa_misc.c') diff --git a/module/zfs/spa_misc.c b/module/zfs/spa_misc.c index 6ec05214e..909002cf5 100644 --- a/module/zfs/spa_misc.c +++ b/module/zfs/spa_misc.c @@ -635,6 +635,9 @@ spa_add(const char *name, nvlist_t *config, const char *altroot) spa->spa_min_ashift = INT_MAX; spa->spa_max_ashift = 0; + /* Reset cached value */ + spa->spa_dedup_dspace = ~0ULL; + /* * As a pool is being created, treat all features as disabled by * setting SPA_FEATURE_DISABLED for all entries in the feature -- cgit v1.2.3