aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/dsl_pool.c
diff options
context:
space:
mode:
authorGeorge Melikov <[email protected]>2017-02-01 01:44:03 +0300
committerBrian Behlendorf <[email protected]>2017-01-31 14:44:03 -0800
commit539d33c791da2f970cfa5a1bddf0533b23146265 (patch)
tree5a59b80e96d34734909339cba2740d348e2095e9 /module/zfs/dsl_pool.c
parenta873815b95a4a66294c31db70cdce0e1a6ff650f (diff)
OpenZFS 6569 - large file delete can starve out write ops
Authored by: Alek Pinchuk <[email protected]> Reviewed by: Matt Ahrens <[email protected]> Reviewed by: Sanjay Nadkarni <[email protected]> Reviewed by: Pavel Zakharov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Ported-by: George Melikov <[email protected]> Tested-by: kernelOfTruth <[email protected]> OpenZFS-issue: https://www.illumos.org/issues/6569 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/1bf4b6f2 Closes #5706
Diffstat (limited to 'module/zfs/dsl_pool.c')
-rw-r--r--module/zfs/dsl_pool.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/module/zfs/dsl_pool.c b/module/zfs/dsl_pool.c
index 2ff3ae456..1b8b780aa 100644
--- a/module/zfs/dsl_pool.c
+++ b/module/zfs/dsl_pool.c
@@ -23,6 +23,7 @@
* Copyright (c) 2011, 2015 by Delphix. All rights reserved.
* Copyright (c) 2013 Steven Hartland. All rights reserved.
* Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
+ * Copyright 2016 Nexenta Systems, Inc. All rights reserved.
*/
#include <sys/dsl_pool.h>
@@ -510,6 +511,16 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t txg)
dsl_pool_undirty_space(dp, dp->dp_dirty_pertxg[txg & TXG_MASK], txg);
/*
+ * Update the long range free counter after
+ * we're done syncing user data
+ */
+ mutex_enter(&dp->dp_lock);
+ ASSERT(spa_sync_pass(dp->dp_spa) == 1 ||
+ dp->dp_long_free_dirty_pertxg[txg & TXG_MASK] == 0);
+ dp->dp_long_free_dirty_pertxg[txg & TXG_MASK] = 0;
+ mutex_exit(&dp->dp_lock);
+
+ /*
* After the data blocks have been written (ensured by the zio_wait()
* above), update the user/group space accounting.
*/